66 FaceFaceContactList & contact)
71 GK::TriangulationDataStructurePtr gkSurface1 = surface1->m_triangulation;
72 GK::TriangulationDataStructurePtr gkSurface2 = surface2->m_triangulation;
75 GK::TriangulationDataStructurePtr surfaceA = gkSurface1;
76 GK::TriangulationDataStructurePtr surfaceB = gkSurface2;
106#ifndef NO_USER_WARNING
107#warning "Work around strange UniqueArray<Real3> reduction"
110 __normals[0] = normals[0].x;
111 __normals[1] = normals[0].y;
112 __normals[2] = normals[0].z;
113 __normals[3] = normals[1].x;
114 __normals[4] = normals[1].y;
115 __normals[5] = normals[1].z;
117 normals[0].x = __normals[0];
118 normals[0].y = __normals[1];
119 normals[0].z = __normals[2];
120 normals[1].x = __normals[3];
121 normals[1].y = __normals[4];
122 normals[1].z = __normals[5];
128 if (surfaceA->numberOfFaces() == 0)
131 typedef GK::SurfaceCorefinement::IntersectionIterator Iter;
132 typedef GK::SurfaceCorefinement::IntersectionHandle Handle;
133 long requested_info = GK::SurfaceCorefinement::NORMAL | GK::SurfaceCorefinement::CENTRE;
134#ifndef NO_USER_WARNING
135#warning "global plane computation disabled"
137 GK::SurfaceCorefinement s(surfaceA, surfaceB,
139 requested_info, options()->areaEpsilon());
141 const Integer voidIndex = s.indexVoid();
151 for (
Integer indexA = s.beginA(); indexA < s.endA(); ) {
152 ARCANE_ASSERT((indexA != voidIndex),(
"indexA cannot be voidIndex by documentation"));
153 Face faceA = face_arrayA[indexA];
159 bool canContinue =
false;
160 for(
Integer iA=0;iA<split_sizeA;++iA) {
161 jB[iA] = s.beginB(indexA+iA);
162 endB[iA] = s.endB(indexA+iA);
163 canContinue |= (jB[iA] != endB[iA]);
166 while (canContinue) {
169 for(
Integer iA=0;iA<split_sizeA;++iA) {
171 if (jB[iA] != endB[iA]) indexB = jB[iA]->indexB();
172 if (indexB != voidIndex) {
173 if (minIndexB == voidIndex) minIndexB = indexB;
174 else minIndexB =
math::min(minIndexB,indexB);
180 ConvertFace(
const Array<Face> & face_array,
const Integer voidIndex) : m_face_array(face_array), m_void_index(voidIndex) { }
182 if (index == m_void_index)
return Face();
183 else return m_face_array[index];
188 } convertFace(face_arrayB,voidIndex);
191 Face faceB = convertFace(minIndexB);
194 FaceFaceContact c(faceA,faceB);
198 for(
Integer iA=0;iA<split_sizeA;++iA) {
199 while (jB[iA] != endB[iA] and convertFace(jB[iA]->indexB()) == faceB) {
200 const Handle & handle = *jB[iA];
204 if (face_reorientA[indexA+iA])
209 if (not faceB.
null()) {
213 if (face_reorientB[jB[iA]->indexB()])
220 canContinue |= (jB[iA] != endB[iA]);
223 if (not faceB.
null())
228 indexA += split_sizeA;
232 Iter jB = s.beginB(voidIndex);
233 Iter endB = s.endB(voidIndex);
235 ARCANE_ASSERT((jB->indexB() != voidIndex),(
"By construction indexB cannot be voidIndex when indexA is voidIndex"));
236 Face faceB = face_arrayB[jB->indexB()];
239 FaceFaceContact c(
Face(),faceB);
242 while (jB != endB and face_arrayB[jB->indexB()] == faceB) {
243 const Handle & handle = *jB;
247 if (face_reorientB[jB->indexB()])
259 info() <<
"Co-refinement"
260 <<
" : maxDeviation = " << s.maxDeviation()
261 <<
" ; meanDeviation = " << s.meanDeviation()
262 <<
" ; connections = " << count;