53 cellShapesPtr_(nullptr),
71 cellCentresPtr_(nullptr),
72 faceCentresPtr_(nullptr),
73 cellVolumesPtr_(nullptr),
74 faceAreasPtr_(nullptr)
81 const label nInternalFaces,
89 nInternalFaces_(nInternalFaces),
93 cellShapesPtr_(nullptr),
111 cellCentresPtr_(nullptr),
112 faceCentresPtr_(nullptr),
113 cellVolumesPtr_(nullptr),
114 faceAreasPtr_(nullptr)
130 label& nInternalPoints,
133 const label nInternalFaces,
147 label nBoundaryPoints = 0;
148 for (label facei = nInternalFaces; facei < faces.
size(); ++facei)
150 const face&
f = faces[facei];
152 for (label pointi :
f)
154 if (oldToNew[pointi] == -1)
156 oldToNew[pointi] = nBoundaryPoints++;
163 nInternalPoints =
nPoints - nBoundaryPoints;
168 if (oldToNew[pointi] != -1)
170 oldToNew[pointi] += nInternalPoints;
178 label internalPointi = 0;
182 for (label facei = 0; facei < nInternalFaces; facei++)
184 const face&
f = faces[facei];
186 for (label pointi :
f)
188 if (oldToNew[pointi] == -1)
190 if (pointi >= nInternalPoints)
194 oldToNew[pointi] = internalPointi++;
206 const label nInternalFaces,
215 nInternal0Edges_ = -1;
216 nInternal1Edges_ = -1;
217 nInternalEdges_ = -1;
219 nInternalFaces_ = nInternalFaces;
224 label nInternalPoints;
227 bool isOrdered = calcPointOrder
238 nInternalPoints_ = nInternalPoints;
242 nInternalPoints_ = -1;
247 Pout<<
"primitiveMesh::reset : mesh reset to" 248 <<
" nInternalPoints:" << nInternalPoints_
249 <<
" nPoints:" << nPoints_
250 <<
" nEdges:" << nEdges_
251 <<
" nInternalFaces:" << nInternalFaces_
252 <<
" nFaces:" << nFaces_
253 <<
" nCells:" << nCells_
262 const label nInternalFaces,
290 faceCentres.size() != nFaces_
291 || faceAreas.size() != nFaces_
292 || cellCentres.size() != nCells_
293 || cellVolumes.size() != nCells_
297 <<
"Wrong sizes of passed in face/cell data" 304 faceCentresPtr_ =
new pointField(std::move(faceCentres));
305 faceAreasPtr_ =
new pointField(std::move(faceAreas));
306 cellCentresPtr_ =
new pointField(std::move(cellCentres));
307 cellVolumesPtr_ =
new scalarField(std::move(cellVolumes));
311 Pout<<
"primitiveMesh::resetGeometry : geometry reset for" 312 <<
" nFaces:" << faceCentresPtr_->size()
313 <<
" nCells:" << cellCentresPtr_->size() <<
endl;
339 return *cellShapesPtr_;
345 if (!faceCentresPtr_ || !faceAreasPtr_)
348 calcFaceCentresAndAreas();
351 if (!cellCentresPtr_ || !cellVolumesPtr_)
354 calcCellCentresAndVols();
void size(const label n)
Older name for setAddressableSize.
List< cell > cellList
List of cell.
A face is a list of labels corresponding to mesh vertices.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Cell-face mesh analysis engine.
const cellShapeList & cellShapes() const
Return cell shapes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
primitiveMesh()
Construct null.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void movePoints(const pointField &p, const pointField &oldP)
Move points.
#define forAll(list, i)
Loop across all elements in list.
void resetGeometry(pointField &&faceCentres, pointField &&faceAreas, pointField &&cellCentres, scalarField &&cellVolumes)
Reset the local geometry.
vectorField pointField
pointField is a vectorField.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void updateGeom()
Update all geometric data.
errorManip< error > abort(error &err)
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
virtual ~primitiveMesh()
Destructor.
List< label > labelList
A List of labels.
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.