Go to the documentation of this file.
55 int Foam::faMesh::origPointAreaMethod_ = 0;
57 const int Foam::faMesh::quadricsFit_ = 0;
85 <<
"No matching patches: " << polyPatchNames <<
nl
89 label nFaceLabels = 0;
90 for (
const label patchi : patchIDs)
92 nFaceLabels += pbm[patchi].size();
98 for (
const label patchi : patchIDs)
100 for (
const label facei : pbm[patchi].
range())
102 faceLabels[nFaceLabels] = facei;
115 void Foam::faMesh::checkBoundaryEdgeLabelRange
122 for (
const label edgei : edgeLabels)
124 if (edgei < nInternalEdges_ || edgei >= nEdges_)
129 <<
"Boundary edge label out of range "
130 << nInternalEdges_ <<
".." << (nEdges_-1) <<
nl
145 void Foam::faMesh::initPatch()
const
151 UIndirectList<face>(
mesh().faces(), faceLabels_),
155 bndConnectPtr_.reset(
nullptr);
156 haloMapPtr_.reset(
nullptr);
157 haloFaceCentresPtr_.reset(
nullptr);
158 haloFaceNormalsPtr_.reset(
nullptr);
162 void Foam::faMesh::setPrimitiveMeshData()
171 nEdges_ = bp.nEdges();
172 nInternalEdges_ = bp.nInternalEdges();
174 nPoints_ = bp.nPoints();
177 edgeOwner_.resize(nEdges_);
178 edgeNeighbour_.resize(nInternalEdges_);
181 for (label edgei = 0; edgei < nInternalEdges_; ++edgei)
183 edges_[edgei] = bp.edges()[edgei];
185 edgeOwner_[edgei] = edgeFaces[edgei][0];
187 edgeNeighbour_[edgei] = edgeFaces[edgei][1];
191 label edgei = nInternalEdges_;
195 for (
const label patchEdgei :
p.edgeLabels())
197 edges_[edgei] = bp.edges()[patchEdgei];
199 edgeOwner_[edgei] = edgeFaces[patchEdgei][0];
207 void Foam::faMesh::clearHalo()
const
211 haloMapPtr_.reset(
nullptr);
212 haloFaceCentresPtr_.reset(
nullptr);
213 haloFaceNormalsPtr_.reset(
nullptr);
217 void Foam::faMesh::clearGeomNotAreas()
const
222 patchPtr_.reset(
nullptr);
223 bndConnectPtr_.reset(
nullptr);
232 pointAreaNormalsPtr_.reset(
nullptr);
238 void Foam::faMesh::clearGeom()
const
249 void Foam::faMesh::clearAddressing()
const
257 void Foam::faMesh::clearOut()
const
261 globalMeshDataPtr_.reset(
nullptr);
285 time().findInstance(meshDir(),
"faceLabels"),
297 time().findInstance(meshDir(),
"faBoundary"),
307 bndConnectPtr_(nullptr),
313 patchStartsPtr_(nullptr),
316 centresPtr_(nullptr),
317 edgeCentresPtr_(nullptr),
318 faceAreaNormalsPtr_(nullptr),
319 edgeAreaNormalsPtr_(nullptr),
320 pointAreaNormalsPtr_(nullptr),
321 faceCurvaturesPtr_(nullptr),
322 edgeTransformTensorsPtr_(nullptr),
323 correctPatchPointNormalsPtr_(nullptr),
324 globalMeshDataPtr_(nullptr),
326 haloMapPtr_(nullptr),
327 haloFaceCentresPtr_(nullptr),
328 haloFaceNormalsPtr_(nullptr)
332 setPrimitiveMeshData();
381 mesh().facesInstance(),
394 mesh().facesInstance(),
405 bndConnectPtr_(
nullptr),
411 patchStartsPtr_(
nullptr),
414 centresPtr_(
nullptr),
415 edgeCentresPtr_(
nullptr),
416 faceAreaNormalsPtr_(
nullptr),
417 edgeAreaNormalsPtr_(
nullptr),
418 pointAreaNormalsPtr_(
nullptr),
419 faceCurvaturesPtr_(
nullptr),
420 edgeTransformTensorsPtr_(
nullptr),
421 correctPatchPointNormalsPtr_(
nullptr),
422 globalMeshDataPtr_(
nullptr),
424 haloMapPtr_(
nullptr),
425 haloFaceCentresPtr_(
nullptr),
426 haloFaceNormalsPtr_(
nullptr)
443 createOnePatch(
"default")
448 setPrimitiveMeshData();
476 faMeshDefinition.
get<
wordRes>(
"polyMeshPatches")
486 faMeshDefinition.
subDict(
"boundary"),
492 faMeshDefinition.
findDict(
"defaultPatch")
497 addFaPatches(newPatches);
506 boundary_.updateMesh();
509 boundary_.calcGeometry();
578 if (!patchStartsPtr_)
583 return *patchStartsPtr_;
622 if (!edgeCentresPtr_)
627 return *edgeCentresPtr_;
649 <<
"S0 is not available"
684 if (!faceAreaNormalsPtr_)
686 calcFaceAreaNormals();
689 return *faceAreaNormalsPtr_;
695 if (!edgeAreaNormalsPtr_)
697 calcEdgeAreaNormals();
700 return *edgeAreaNormalsPtr_;
706 if (!pointAreaNormalsPtr_)
710 if (origPointAreaMethod_)
712 calcPointAreaNormals_orig(*pointAreaNormalsPtr_);
716 calcPointAreaNormals(*pointAreaNormalsPtr_);
719 if (quadricsFit_ > 0)
721 calcPointAreaNormalsByQuadricsFit(*pointAreaNormalsPtr_);
725 return *pointAreaNormalsPtr_;
731 if (!faceCurvaturesPtr_)
733 calcFaceCurvatures();
736 return *faceCurvaturesPtr_;
743 if (!edgeTransformTensorsPtr_)
745 calcEdgeTransformTensors();
748 return *edgeTransformTensorsPtr_;
754 if (!globalMeshDataPtr_)
759 return *globalMeshDataPtr_;
782 if (S00Ptr_ && S0Ptr_)
812 curTimeIndex_ = time().timeIndex();
820 patchPtr_->movePoints(newPoints);
841 <<
"patchID is not in the valid range"
845 if (correctPatchPointNormalsPtr_)
847 return (*correctPatchPointNormalsPtr_)[
patchID];
856 if (!correctPatchPointNormalsPtr_)
861 return *correctPatchPointNormalsPtr_;
The class contains the addressing required by the lduMatrix: upper, lower and losort.
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
List< label > labelList
A List of labels.
virtual const pointField & points() const
Return raw points.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const edgeVectorField & Le() const
Return edge length vectors.
void updateMesh()
Correct faBoundaryMesh after topology update.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static labelList selectPatchFaces(const polyBoundaryMesh &pbm, const wordRes &polyPatchNames)
A class for handling words, derived from Foam::string.
A class for handling file names.
A field of fields is a PtrList of fields with reference counting.
virtual bool write(const bool valid=true) const
Write mesh.
void resize(const label len)
Adjust allocated size of list.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
Template functions to aid in the implementation of demand driven data.
static const word prefix
The prefix to local: finite-area.
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
void calcGeometry()
Calculate the geometry for the patches.
const fileName & facesInstance() const
Return the current instance directory for faces.
List< bool > boolList
A List of bools.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
const fileOperation & fileHandler()
Get current file handler.
Various mesh related information for a parallel run.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const vectorField & pointAreaNormals() const
Return point area normals.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual ~faMesh()
Destructor.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
Mesh consisting of general polyhedral cells.
const labelList & patchStarts() const
Return patch starts.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const faGlobalMeshData & globalData() const
Return parallel info.
Registry of regIOobjects.
void deleteDemandDrivenData(DataPtr &dataPtr)
const fileName & pointsInstance() const
Return the current instance directory for points.
Finite area boundary mesh.
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
bool operator==(const faMesh &m) const
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
#define DebugInFunction
Report an information message using Foam::Info.
A patch is a list of labels that address the faces in the global face list.
fileName timePath() const
Return current time path.
const areaVectorField & faceAreaNormals() const
Return face area normals.
const Time & time() const
Return reference to time.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
const edgeScalarField & magLe() const
Return edge length magnitudes.
const fileName & facesInstance() const
Return the current instance directory for faces.
bool operator!=(const faMesh &m) const
const polyMesh & mesh() const
Return access to polyMesh.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManip< error > abort(error &err)
bool movePoints() const
Do what is necessary if the mesh has moved.
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
errorManipArg< error, int > exit(error &err, const int errNo=1)
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
#define DebugInfo
Report an information message using Foam::Info.
const areaScalarField & faceCurvatures() const
Return face curvatures.
const std::string patch
OpenFOAM patch number as a std::string.
Inter-processor communications stream.
static label worldComm
Default communicator (all processors)
static bool & parRun() noexcept
Test if this a parallel run.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
void addFaPatches(PtrList< faPatch > &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
static const word null
An empty word.
Finite area mesh. Used for 2-D non-Euclidian finite area method.
const Time & time() const
Return the top-level database.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const word & name() const noexcept
The patch name.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
const fileName & pointsInstance() const
Return the current instance directory for points.
UList< label > labelUList
A UList of labels.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
Face to edge interpolation scheme. Included in faMesh.
Database for solution data, solver performance and other reduced data.
const Time & time() const noexcept
Return time registry.
virtual bool movePoints()
Update after mesh motion.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...