51 const cvControls& foamyHexMeshControls,
52 const searchableSurfaces& allGeometry,
53 const conformationSurfaces& geometryToConformTo
58 foamyHexMeshControls.foamyHexMeshDict().subDict(
"motionControl")
61 allGeometry_(allGeometry),
62 geometryToConformTo_(geometryToConformTo),
63 defaultCellSize_(foamyHexMeshControls.defaultCellSize()),
64 minimumCellSize_(foamyHexMeshControls.minimumCellSize()),
65 shapeControlMesh_(runTime),
70 subDict(
"shapeControlFunctions"),
94 cellSizes[i] = cellSize(pts[i]);
106 shapeControlMesh_.barycentricCoords(pt, bary, ch);
110 if (shapeControlMesh_.dimension() < 3)
112 size = sizeAndAlignment_.cellSize(pt);
114 else if (shapeControlMesh_.is_infinite(ch))
139 size = sizeAndAlignment_.cellSize(pt);
143 label nFarPoints = 0;
144 for (
label pI = 0; pI < 4; ++pI)
146 if (ch->vertex(pI)->farPoint())
154 for (
label pI = 0; pI < 4; ++pI)
158 size = ch->vertex(pI)->targetCellSize();
167 size += bary[pI]*ch->vertex(pI)->targetCellSize();
182 shapeControlMesh_.barycentricCoords(pt, bary, ch);
186 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
192 label nFarPoints = 0;
193 for (
label pI = 0; pI < 4; ++pI)
195 if (ch->vertex(pI)->farPoint())
215 for (
label pI = 0; pI < 4; ++pI)
217 if (bary[pI] > SMALL)
219 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
254 shapeControlMesh_.barycentricCoords(pt, bary, ch);
259 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
262 size = sizeAndAlignment_.cellSize(pt);
267 label nFarPoints = 0;
268 for (
label pI = 0; pI < 4; ++pI)
270 if (ch->vertex(pI)->farPoint())
278 for (
label pI = 0; pI < 4; ++pI)
282 size = ch->vertex(pI)->targetCellSize();
283 alignment = ch->vertex(pI)->alignment();
291 for (
label pI = 0; pI < 4; ++pI)
293 size += bary[pI]*ch->vertex(pI)->targetCellSize();
295 if (bary[pI] > SMALL)
297 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
317 for (
label dir = 0; dir < 3; dir++)
321 if (!v.set(dir) || size == 0)
325 scalar dotProd = GREAT;
328 dotProd = v[1] & v[2];
330 v[dir] = v[1] ^ v[2];
334 dotProd = v[0] & v[2];
336 v[dir] = v[0] ^ v[2];
340 dotProd = v[0] & v[1];
342 v[dir] = v[0] ^ v[1];
348 Pout<<
"Dot prod = " << dotProd <<
endl;