83 class faMeshBoundaryHalo;
84 class faMeshLduAddressing;
94 public MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>,
132 for (
auto& tuples : list)
154 return (procNo() >= 0 && patchi() != -1);
158 label procNo()
const {
return (*
this)[0]; }
159 void procNo(label val) { (*this)[0] = val; }
162 label patchi()
const {
return (*
this)[1]; }
163 void patchi(label val) { (*this)[1] = val; }
167 label patchEdgei()
const {
return (*
this)[2]; }
168 void patchEdgei(label val) { (*this)[2] = val; }
171 label meshFacei()
const {
return (*
this)[3]; }
172 void meshFacei(label val) { (*this)[3] = val; }
175 label realPatchi()
const 177 const label
id = patchi();
178 return (
id < -1 ? -(
id + 2) :
id);
182 void faPatchi(label val)
190 return (patchi() < -1);
194 bool is_localProc()
const 225 mutable label nPoints_;
228 mutable label nEdges_;
231 mutable label nInternalEdges_;
234 mutable label nFaces_;
246 mutable label curTimeIndex_;
252 mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
255 mutable std::unique_ptr<List<labelPair>> polyPatchFacesPtr_;
258 mutable std::unique_ptr<labelList> polyPatchIdsPtr_;
261 mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
300 mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
309 mutable boolList* correctPatchPointNormalsPtr_;
318 mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
321 mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
324 mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
330 static const int quadricsFit_;
339 void operator=(
const faMesh&) =
delete;
343 void initPatch()
const;
347 void setPrimitiveMeshData();
354 void calcBoundaryConnections()
const;
358 void setBoundaryConnections
367 void calcLduAddressing()
const;
370 void calcPatchStarts()
const;
374 void calcWhichPatchFaces()
const;
387 void calcMagLe()
const;
391 void calcFaceCentres()
const;
395 void calcEdgeCentres()
const;
403 void calcFaceAreaNormals()
const;
407 void calcEdgeAreaNormals()
const;
411 void calcPointAreaNormals(
vectorField& result)
const;
414 void calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const;
418 void calcFaceCurvatures()
const;
421 void calcEdgeTransformTensors()
const;
424 void clearGeomNotAreas()
const;
427 bool hasHaloFaceGeometry()
const noexcept;
430 void clearHalo()
const;
433 void clearGeom()
const;
436 void clearAddressing()
const;
439 void clearOut()
const;
445 void calcHaloFaceGeometry()
const;
453 const word& patchName,
454 const word& patchType =
"" 461 const word& emptyPatchName =
"",
462 const dictionary* defaultPatchDefinition =
nullptr 467 void checkBoundaryEdgeLabelRange(
const labelUList& edgeLabels)
const;
479 checkBoundaryEdgeLabelRange(edgeLabels);
485 result[i] = bndField[edgeLabels[i] - nInternalEdges_];
494 static bool hasSystemFiles(
const polyMesh& pMesh);
497 static bool hasFiles(
const polyMesh& pMesh);
579 const bool doInit =
true 617 const bool validBoundary =
true 624 const bool validBoundary =
true 628 bool init(
const bool doInit);
751 virtual
bool hasDb() const;
779 inline label
whichFace(const label meshFacei) const;
812 return (edgeIndex < nInternalEdges_);
852 void removeFiles(
const fileName& instanceDir)
const;
876 return bool(faceAreaNormalsPtr_);
882 return bool(edgeAreaNormalsPtr_);
888 return bool(pointAreaNormalsPtr_);
894 return bool(faceCurvaturesPtr_);
900 return bool(correctPatchPointNormalsPtr_);
998 virtual bool write(
const bool writeOnProc =
true)
const;
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
labelList internalPoints() const
Return internal point labels.
void size(const label n)
Older name for setAddressableSize.
virtual void updateMesh(const mapPolyMesh &)
Update after topo change.
void addFaPatches(faPatchList &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
A class for handling file names.
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
A 1D vector of objects of type <T> with a fixed length <N>.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch with only those pointing to interfaces being set...
const Time & time() const
Return reference to time.
const word & name() const noexcept
Return the object name.
void syncGeom()
Processor/processor synchronisation for geometry fields.
virtual void mapFields(const faMeshMapper &mapper) const
Map all fields in time using given map.
label comm() const noexcept
Return communicator used for parallel communication.
const edgeList::subList internalEdges() const
Sub-list of local internal edges.
const pointField & haloFaceCentres() const
Face centres of boundary halo neighbours.
Database for mesh data, solution data, solver performance and other reduced data. ...
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
Face to edge interpolation scheme. Included in faMesh.
bool operator!=(const faMesh &m) const
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
label whichFace(const label meshFacei) const
The area-face corresponding to the mesh-face, -1 if not found.
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
Various mesh related information for a parallel run.
void operator()() const =delete
No call operator. Prior to 2312 was used to obtain polyMesh.
void stableSort(UList< T > &list)
Stable sort the list.
const labelList & whichPolyPatches() const
The polyPatches related to the areaMesh, in sorted order.
Generic GeometricField class.
const faGlobalMeshData & globalData() const
Return parallel info (demand-driven)
const labelList & patchStarts() const
Return patch starts.
bool isInternalEdge(const label edgeIndex) const noexcept
True if given edge label is internal to the mesh.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
const List< labelPair > & boundaryConnections() const
List of proc/face for the boundary edge neighbours using primitive patch edge numbering.
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
labelList boundaryProcs() const
Boundary edge neighbour processors (does not include own proc)
bool hasMagLe() const noexcept
Has edge length magnitudes: magLe()
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
const edgeScalarField & magLe() const
Return edge length magnitudes.
bool hasGlobalData() const noexcept
Is demand-driven parallel info available?
label nFaces() const noexcept
Number of patch faces.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
label nPoints() const noexcept
Number of local mesh points.
A field of fields is a PtrList of fields with reference counting.
#define forAll(list, i)
Loop across all elements in list.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
static int geometryOrder() noexcept
Return the current geometry treatment.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const labelUList & neighbour() const
Internal face neighbour.
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
const faceList & faces() const
Return local faces.
A list of faces which address into the list of points.
List< labelPair > boundaryProcSizes() const
List of proc/size for the boundary edge neighbour processors (does not include own proc) ...
bool hasLe() const noexcept
Has edge length vectors: Le()
vectorField pointField
pointField is a vectorField.
Forwards for edge field types.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
An ordered pair of two objects of type <T> with first() and second() elements.
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
virtual ~faMesh()
Destructor.
bool hasEdgeAreaNormals() const noexcept
Has edge area normals: edgeAreaNormals()
A class for handling words, derived from Foam::string.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
bool operator==(const faMesh &m) const
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
void sort(UList< T > &list)
Sort the list.
const edgeVectorField & Le() const
Return edge length vectors.
bool hasFaceCurvatures() const noexcept
Has face curvatures: faceCurvatures()
const faMeshBoundaryHalo & boundaryHaloMap() const
Mapping/swapping for boundary halo neighbours.
const meshState & data() const
Const reference to the mesh and solver state data.
bool hasPointAreaNormals() const noexcept
Has point area normals: pointAreaNormals()
bool hasAreaCentres() const noexcept
Has face centres: areaCentres()
static const word prefix
The prefix to local: finite-area.
bool hasInternalEdgeLabels() const noexcept
True if the internalEdges use an ordering that does not correspond 1-to-1 with the patch internalEdge...
const pointField & points() const
Return local points.
const vectorField & haloFaceNormals() const
Face unit-normals of boundary halo neighbours.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
virtual void mapOldAreas(const faMeshMapper &mapper) const
Map face areas in time using given map.
virtual bool movePoints()
Update after mesh motion.
virtual bool write(const bool writeOnProc=true) const
Write mesh.
const edgeList & edges() const noexcept
Return local edges with reordered boundary.
faBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
const polyMesh & mesh() const
Return access to polyMesh.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
const areaScalarField & faceCurvatures() const
Return face curvatures.
label nEdges() const noexcept
Number of local mesh edges.
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
const labelUList & owner() const
Internal face owner.
bool moving() const noexcept
Is mesh moving.
labelList boundaryPoints() const
Return boundary point labels.
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
const fileName & facesInstance() const
Return the current instance directory for faces.
label nInternalEdges() const noexcept
Number of internal faces.
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
bool moving() const
Is mesh moving.
bool hasEdgeCentres() const noexcept
Has edge centres: edgeCentres()
static autoPtr< faMesh > TryNew(const polyMesh &pMesh)
Read construction from polyMesh if all files are available.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
const faSchemes * hasSchemes() const
Non-null if faSchemes exists (can test as bool).
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
bool hasFaceAreas() const noexcept
Has face areas: S()
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
const word & name() const
Name function is needed to disambiguate those inherited from base classes.
const fileName & pointsInstance() const
Return the current instance directory for points.
Finite area boundary mesh.
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
bool init(const bool doInit)
Initialise non-demand-driven data etc.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
labelList faceCells() const
The volume (owner) cells associated with the area-mesh.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static const objectRegistry * registry(const polyMesh &pMesh)
The parent registry containing all finite-area meshes on the polyMesh.
static int geometryOrder_
Geometry treatment.
faMesh Mesh
The mesh type.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Selector class for relaxation factors, solver type and solution.
Mesh consisting of general polyhedral cells.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
List< label > labelList
A List of labels.
A class for managing temporary objects.
TypeName("faMesh")
Runtime type information.
void removeFiles() const
Remove all files from mesh instance()
Registry of regIOobjects.
A patch is a list of labels that address the faces in the global face list.
label nBoundaryEdges() const noexcept
Number of boundary edges (== nEdges - nInternalEdges)
bool hasFaceAreaNormals() const noexcept
Has face area normals: faceAreaNormals()
const vectorField & pointAreaNormals() const
Return point area normals.
const areaVectorField & faceAreaNormals() const
Return face area normals.
bool hasPatchPointNormalsCorrection() const noexcept
Has patch point normals corrections.
tmp< edgeVectorField > unitLe() const
Return normalised edge length vectors.
const faSolution * hasSolution() const
Non-null if faSolution exists (can test as bool).
const labelList & edgeOwner() const noexcept
Edge owner addressing.
lduAddressing wrapper for faMesh
Forwards and collection of common area field types.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
const faSchemes & schemes() const
Read-access to the faSchemes controls.
Class holds all the necessary information for mapping fields associated with faMesh.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.