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;
void size(const label n)
Older name for setAddressableSize.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
void cellSizeAndAlignment(const point &pt, scalar &size, tensor &alignment) const
tensor cellAlignment(const point &pt) const
Return the cell alignment at the given location.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
bool uninitialised(const VertexType &v)
static const Identity< scalar > I
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
defineTypeNameAndDebug(combustionModel, 0)
CellSizeDelaunay::Cell_handle Cell_handle
vector point
Point is a vector.
Tensor of scalars, i.e. Tensor<scalar>.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
scalar cellSize(const point &pt) const
Return the cell size at the given location.
static constexpr const zero Zero
Global zero (0)