45 Foam::cellShapeControl::cellShapeControl
48 const cvControls& foamyHexMeshControls,
49 const searchableSurfaces& allGeometry,
50 const conformationSurfaces& geometryToConformTo
55 foamyHexMeshControls.foamyHexMeshDict().subDict(
"motionControl")
58 allGeometry_(allGeometry),
59 geometryToConformTo_(geometryToConformTo),
60 defaultCellSize_(foamyHexMeshControls.defaultCellSize()),
61 minimumCellSize_(foamyHexMeshControls.minimumCellSize()),
62 shapeControlMesh_(runTime),
67 subDict(
"shapeControlFunctions"),
91 cellSizes[i] = cellSize(pts[i]);
103 shapeControlMesh_.barycentricCoords(pt, bary, ch);
107 if (shapeControlMesh_.dimension() < 3)
109 size = sizeAndAlignment_.cellSize(pt);
111 else if (shapeControlMesh_.is_infinite(ch))
136 size = sizeAndAlignment_.cellSize(pt);
140 label nFarPoints = 0;
141 for (
label pI = 0; pI < 4; ++pI)
143 if (ch->vertex(pI)->farPoint())
151 for (
label pI = 0; pI < 4; ++pI)
155 size = ch->vertex(pI)->targetCellSize();
164 size += bary[pI]*ch->vertex(pI)->targetCellSize();
178 shapeControlMesh_.barycentricCoords(pt, bary, ch);
182 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
188 label nFarPoints = 0;
189 for (
label pI = 0; pI < 4; ++pI)
191 if (ch->vertex(pI)->farPoint())
211 for (
label pI = 0; pI < 4; ++pI)
213 if (bary[pI] > SMALL)
215 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
250 shapeControlMesh_.barycentricCoords(pt, bary, ch);
255 if (shapeControlMesh_.dimension() < 3 || shapeControlMesh_.is_infinite(ch))
258 size = sizeAndAlignment_.cellSize(pt);
263 label nFarPoints = 0;
264 for (
label pI = 0; pI < 4; ++pI)
266 if (ch->vertex(pI)->farPoint())
274 for (
label pI = 0; pI < 4; ++pI)
278 size = ch->vertex(pI)->targetCellSize();
279 alignment = ch->vertex(pI)->alignment();
287 for (
label pI = 0; pI < 4; ++pI)
289 size += bary[pI]*ch->vertex(pI)->targetCellSize();
291 if (bary[pI] > SMALL)
293 tri += triad(bary[pI]*ch->vertex(pI)->alignment());
313 for (
label dir = 0; dir < 3; dir++)
317 if (!v.set(dir) || size == 0)
321 scalar dotProd = GREAT;
324 dotProd = v[1] & v[2];
326 v[dir] = v[1] ^ v[2];
330 dotProd = v[0] & v[2];
332 v[dir] = v[0] ^ v[2];
336 dotProd = v[0] & v[1];
338 v[dir] = v[0] ^ v[1];
344 Pout<<
"Dot prod = " << dotProd <<
endl;
#define forAll(list, i)
Loop across all elements in list.
void cellSizeAndAlignment(const point &pt, scalar &size, tensor &alignment) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar cellSize(const point &pt) const
Return the cell size at the given location.
Ostream & endl(Ostream &os)
Add newline and flush stream.
~cellShapeControl()
Destructor.
vectorField pointField
pointField is a vectorField.
bool uninitialised(const VertexType &v)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< scalar > scalarList
A List of scalars.
tensor cellAlignment(const point &pt) const
Return the cell alignment at the given location.
prefixOSstream Pout(cout,"Pout")
defineTypeNameAndDebug(combustionModel, 0)
CellSizeDelaunay::Cell_handle Cell_handle
vector point
Point is a vector.
Tensor< scalar > tensor
Tensor of scalars.