32class Euclidian3Geometry
37 : m_coords(coords) { }
39 virtual ~Euclidian3Geometry() { }
83 IComputeLine(Euclidian3Geometry * geom) : m_geom(geom), m_coords(geom->m_coords) { }
84 virtual ~IComputeLine() { }
85 virtual void computeOrientedMeasureAndCenter(
const ItemWithNodes & item,
Real3 & orientation,
Real3 & center) = 0;
86 Euclidian3Geometry * m_geom;
90 struct ComputeLine2 :
public IComputeLine {
91 ComputeLine2(Euclidian3Geometry * geom) : IComputeLine(geom) { }
95 struct IComputeSurface {
96 IComputeSurface(Euclidian3Geometry * geom) : m_geom(geom), m_coords(geom->m_coords) { }
97 virtual ~IComputeSurface() { }
98 virtual void computeOrientedMeasureAndCenter(
const ItemWithNodes & item,
Real3 & orientation,
Real3 & center) = 0;
99 Euclidian3Geometry * m_geom;
103 struct ComputeTriangle3
104 :
public IComputeSurface {
105 ComputeTriangle3(Euclidian3Geometry * geom) : IComputeSurface(geom) { }
109 struct ComputeQuad4 :
public IComputeSurface {
110 ComputeQuad4(Euclidian3Geometry * geom) : IComputeSurface(geom) { }
114 struct ComputePentagon5 :
public IComputeSurface {
115 ComputePentagon5(Euclidian3Geometry * geom) : IComputeSurface(geom) { }
119 struct ComputeHexagon6 :
public IComputeSurface {
120 ComputeHexagon6(Euclidian3Geometry * geom) : IComputeSurface(geom) { }
124 struct IComputeVolume {
125 IComputeVolume(Euclidian3Geometry * geom) : m_geom(geom), m_coords(geom->m_coords) { }
126 virtual ~IComputeVolume() { }
127 virtual void computeOrientedMeasureAndCenter(
const ItemWithNodes & item,
Real & measure,
Real3 & center) = 0;
129 Euclidian3Geometry * m_geom;
133 struct ComputeTetraedron4 :
public IComputeVolume {
134 ComputeTetraedron4(Euclidian3Geometry * geom) : IComputeVolume(geom) { }
139 struct ComputeHeptaedron10 :
public IComputeVolume {
140 ComputeHeptaedron10(Euclidian3Geometry * geom) : IComputeVolume(geom) { }
144 ARCANE_UNUSED(measure);
145 ARCANE_UNUSED(center);
156 struct ComputeOctaedron12
157 :
public IComputeVolume
159 ComputeOctaedron12(Euclidian3Geometry * geom) : IComputeVolume(geom) { }
163 ARCANE_UNUSED(measure);
164 ARCANE_UNUSED(center);
175 struct ComputeGenericVolume :
public IComputeVolume {
176 ComputeGenericVolume(Euclidian3Geometry * geom) : IComputeVolume(geom) { }
198 static inline Real computeTriangleSurface(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2)
205 return (n0+n1+n2) / 3.0;
208 static inline Real computeTetraedronVolume(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2,
const Real3 & n3)
213 static inline Real3 computeTetraedronCenter(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2,
const Real3 & n3)
215 return 0.25 * (n0+n1+n2+n3);
218 static inline Real3 computeQuadrilateralCenter(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2,
const Real3 & n3)
220 const Real s0 = computeTriangleSurface(n0,n1,n2);
221 const Real s1 = computeTriangleSurface(n0,n2,n3);
222 const Real s2 = computeTriangleSurface(n1,n2,n3);
223 const Real s3 = computeTriangleSurface(n0,n1,n3);
224 return (s0 * computeTriangleCenter(n0,n1,n2) +
225 s1 * computeTriangleCenter(n0,n2,n3) +
226 s2 * computeTriangleCenter(n1,n2,n3) +
227 s3 * computeTriangleCenter(n0,n1,n3)) / (s0+s1+s2+s3);
230 static inline Real3 computePentagonalCenter(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2,
const Real3 & n3,
const Real3 & n4)
232 const Real s0 = computeTriangleSurface(n4,n0,n1);
233 const Real s1 = computeTriangleSurface(n0,n1,n2);
234 const Real s2 = computeTriangleSurface(n1,n2,n3);
235 const Real s3 = computeTriangleSurface(n2,n3,n4);
236 const Real s4 = computeTriangleSurface(n3,n4,n0);
237 const Real s5 = computeTriangleSurface(n0,n2,n3);
238 const Real s6 = computeTriangleSurface(n1,n3,n4);
239 const Real s7 = computeTriangleSurface(n2,n4,n0);
240 const Real s8 = computeTriangleSurface(n3,n0,n1);
241 const Real s9 = computeTriangleSurface(n4,n1,n2);
243 return (2*(s0 * computeTriangleCenter(n4,n0,n1) +
244 s1 * computeTriangleCenter(n0,n1,n2) +
245 s2 * computeTriangleCenter(n1,n2,n3) +
246 s3 * computeTriangleCenter(n2,n3,n4) +
247 s4 * computeTriangleCenter(n3,n4,n0)) +
248 s5 * computeTriangleCenter(n0,n2,n3) +
249 s6 * computeTriangleCenter(n1,n3,n4) +
250 s7 * computeTriangleCenter(n2,n4,n0) +
251 s8 * computeTriangleCenter(n3,n0,n1) +
252 s9 * computeTriangleCenter(n4,n1,n2)) / (2*(s0+s1+s2+s3+s4) + s5 + s6 + s7 + s8 + s9);
255 static inline Real3 computeHexagonalCenter(
const Real3 & n0,
const Real3 & n1,
const Real3 & n2,
const Real3 & n3,
const Real3 & n4,
const Real3 & n5)
257 const Real s0 = computeTriangleSurface(n0,n1,n5);
258 const Real s1 = computeTriangleSurface(n1,n2,n3);
259 const Real s2 = computeTriangleSurface(n3,n4,n5);
260 const Real s3 = computeTriangleSurface(n1,n3,n5);
261 const Real s4 = computeTriangleSurface(n0,n1,n2);
262 const Real s5 = computeTriangleSurface(n2,n3,n4);
263 const Real s6 = computeTriangleSurface(n4,n5,n0);
264 const Real s7 = computeTriangleSurface(n0,n2,n4);
266 return (s0 * computeTriangleCenter(n0,n1,n5) +
267 s1 * computeTriangleCenter(n1,n2,n3) +
268 s2 * computeTriangleCenter(n3,n4,n5) +
269 s3 * computeTriangleCenter(n1,n3,n5) +
270 s4 * computeTriangleCenter(n0,n1,n2) +
271 s5 * computeTriangleCenter(n2,n3,n4) +
272 s6 * computeTriangleCenter(n4,n5,n0) +
273 s7 * computeTriangleCenter(n0,n2,n4)) / (s0 + s1 + s2 + s3 + s4 + s5 + s6 + s7);