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,
138 convertGKVector(normals[0]), convertGKVector(normals[1]),
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])
172 indexB = jB[iA]->indexB();
173 if (indexB != voidIndex) {
174 if (minIndexB == voidIndex)
177 minIndexB =
math::min(minIndexB, indexB);
185 : m_face_array(face_array)
186 , m_void_index(voidIndex)
190 if (index == m_void_index)
193 return m_face_array[index];
200 } convertFace(face_arrayB, voidIndex);
203 Face faceB = convertFace(minIndexB);
206 FaceFaceContact c(faceA, faceB);
210 for (
Integer iA = 0; iA < split_sizeA; ++iA) {
211 while (jB[iA] != endB[iA] and convertFace(jB[iA]->indexB()) == faceB) {
212 const Handle& handle = *jB[iA];
213 Real3 normal = convertGKVector(handle.normalA());
214 Real3 center = convertGKVector(handle.centreA());
216 if (face_reorientA[indexA + iA])
221 if (not faceB.
null()) {
222 Real3 normal = convertGKVector(handle.normalB());
223 Real3 center = convertGKVector(handle.centreB());
225 if (face_reorientB[jB[iA]->indexB()])
232 canContinue |= (jB[iA] != endB[iA]);
235 if (not faceB.
null())
240 indexA += split_sizeA;
244 Iter jB = s.beginB(voidIndex);
245 Iter endB = s.endB(voidIndex);
247 ARCANE_ASSERT((jB->indexB() != voidIndex), (
"By construction indexB cannot be voidIndex when indexA is voidIndex"));
248 Face faceB = face_arrayB[jB->indexB()];
251 FaceFaceContact c(
Face(), faceB);
254 while (jB != endB and face_arrayB[jB->indexB()] == faceB) {
255 const Handle& handle = *jB;
256 Real3 normal = convertGKVector(handle.normalB());
257 Real3 center = convertGKVector(handle.centreB());
259 if (face_reorientB[jB->indexB()])
271 info() <<
"Co-refinement"
272 <<
" : maxDeviation = " << s.maxDeviation()
273 <<
" ; meanDeviation = " << s.meanDeviation()
274 <<
" ; connections = " << count;