47 Foam::cellShapeControl::cellShapeControl
50 const cvControls& foamyHexMeshControls,
51 const searchableSurfaces& allGeometry,
52 const conformationSurfaces& geometryToConformTo
57 foamyHexMeshControls.foamyHexMeshDict().subDict(
"motionControl")
59 geometryToConformTo_(geometryToConformTo),
60 defaultCellSize_(foamyHexMeshControls.defaultCellSize()),
61 minimumCellSize_(foamyHexMeshControls.minimumCellSize()),
67 subDict(
"shapeControlFunctions"),
85 cellSizes[i] = cellSize(pts[i]);
97 shapeControlMesh_.barycentricCoords(pt, bary, ch);
101 if (shapeControlMesh_.dimension() < 3)
103 size = sizeAndAlignment_.cellSize(pt);
105 else if (shapeControlMesh_.is_infinite(ch))
130 size = sizeAndAlignment_.cellSize(pt);
134 label nFarPoints = 0;
135 for (label pI = 0; pI < 4; ++pI)
137 if (ch->vertex(pI)->farPoint())
145 for (label pI = 0; pI < 4; ++pI)
149 size = ch->vertex(pI)->targetCellSize();
158 size += bary[pI]*ch->vertex(pI)->targetCellSize();
172 shapeControlMesh_.barycentricCoords(pt, bary, ch);
176 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
182 label nFarPoints = 0;
183 for (label pI = 0; pI < 4; ++pI)
185 if (ch->vertex(pI)->farPoint())
205 for (label pI = 0; pI < 4; ++pI)
207 if (bary[pI] > SMALL)
209 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
244 shapeControlMesh_.barycentricCoords(pt, bary, ch);
249 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
252 size = sizeAndAlignment_.cellSize(pt);
257 label nFarPoints = 0;
258 for (label pI = 0; pI < 4; ++pI)
260 if (ch->vertex(pI)->farPoint())
268 for (label pI = 0; pI < 4; ++pI)
272 size = ch->vertex(pI)->targetCellSize();
273 alignment = ch->vertex(pI)->alignment();
281 for (label pI = 0; pI < 4; ++pI)
283 size += bary[pI]*ch->vertex(pI)->targetCellSize();
285 if (bary[pI] > SMALL)
287 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
307 for (label dir = 0; dir < 3; dir++)
311 if (!v.set(dir) || size == 0)
315 scalar dotProd = GREAT;
318 dotProd = v[1] & v[2];
320 v[dir] = v[1] ^ v[2];
324 dotProd = v[0] & v[2];
326 v[dir] = v[0] ^ v[2];
330 dotProd = v[0] & v[1];
332 v[dir] = v[0] ^ v[1];
338 Pout<<
"Dot prod = " << dotProd <<
endl;