82 class faMeshBoundaryHalo;
83 class faMeshLduAddressing;
111 virtual bool hasDb()
const {
return true; }
166 for (
auto& tuples : list)
188 return (procNo() >= 0 && patchi() != -1);
192 label procNo()
const {
return (*
this)[0]; }
193 void procNo(label val) { (*this)[0] = val; }
196 label patchi()
const {
return (*
this)[1]; }
197 void patchi(label val) { (*this)[1] = val; }
201 label patchEdgei()
const {
return (*
this)[2]; }
202 void patchEdgei(label val) { (*this)[2] = val; }
205 label meshFacei()
const {
return (*
this)[3]; }
206 void meshFacei(label val) { (*this)[3] = val; }
209 label realPatchi()
const 211 const label
id = patchi();
212 return (
id < -1 ? -(
id + 2) :
id);
216 void faPatchi(label val)
224 return (patchi() < -1);
228 bool is_localProc()
const 259 mutable label nPoints_;
262 mutable label nEdges_;
265 mutable label nInternalEdges_;
268 mutable label nFaces_;
280 mutable label curTimeIndex_;
286 mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
289 mutable std::unique_ptr<List<labelPair>> polyPatchFacesPtr_;
292 mutable std::unique_ptr<labelList> polyPatchIdsPtr_;
295 mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
298 mutable std::unique_ptr<faMeshLduAddressing> lduPtr_;
304 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> SPtr_;
307 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> S0Ptr_;
310 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> S00Ptr_;
313 mutable std::unique_ptr<labelList> patchStartsPtr_;
316 mutable std::unique_ptr<edgeVectorField> LePtr_;
319 mutable std::unique_ptr<edgeScalarField> magLePtr_;
322 mutable std::unique_ptr<areaVectorField> faceCentresPtr_;
325 mutable std::unique_ptr<edgeVectorField> edgeCentresPtr_;
328 mutable std::unique_ptr<areaVectorField> faceAreaNormalsPtr_;
331 mutable std::unique_ptr<edgeVectorField> edgeAreaNormalsPtr_;
334 mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
337 mutable std::unique_ptr<areaScalarField> faceCurvaturesPtr_;
340 mutable std::unique_ptr<FieldField<Field, tensor>>
341 edgeTransformTensorsPtr_;
344 mutable std::unique_ptr<boolList> correctPatchPointNormalsPtr_;
353 mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
356 mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
359 mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
365 static const word prefix_;
368 static const int quadricsFit_;
375 void initPatch()
const;
379 void setPrimitiveMeshData();
386 void calcBoundaryConnections()
const;
390 void setBoundaryConnections
399 void calcLduAddressing()
const;
402 void calcPatchStarts()
const;
406 void calcWhichPatchFaces()
const;
419 void calcMagLe()
const;
423 void calcFaceCentres()
const;
427 void calcEdgeCentres()
const;
435 void calcFaceAreaNormals()
const;
439 void calcEdgeAreaNormals()
const;
443 void calcPointAreaNormals(
vectorField& result)
const;
446 void calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const;
450 void calcFaceCurvatures()
const;
453 void calcEdgeTransformTensors()
const;
456 void clearGeomNotAreas()
const;
459 bool hasHaloFaceGeometry()
const noexcept;
462 void clearHalo()
const;
465 void clearGeom()
const;
468 void clearAddressing()
const;
471 void clearOut()
const;
477 void calcHaloFaceGeometry()
const;
485 const word& patchName,
486 const word& patchType =
"" 493 const word& emptyPatchName =
"",
494 const dictionary* defaultPatchDefinition =
nullptr 499 void checkBoundaryEdgeLabelRange(
const labelUList& edgeLabels)
const;
511 checkBoundaryEdgeLabelRange(edgeLabels);
517 result[i] = bndField[edgeLabels[i] - nInternalEdges_];
526 static bool hasSystemFiles
528 const word& meshName,
533 static bool hasMeshFiles
535 const word& meshName,
596 const word& meshName,
632 const word& meshName,
653 const word& meshName,
666 const word& meshName,
668 const bool doInit =
true 677 const word& meshName,
680 const bool doInit =
true 688 const bool doInit =
true 717 const word& meshName,
733 const bool validBoundary =
true 740 const bool validBoundary =
true 744 bool init(
const bool doInit);
871 virtual
bool hasDb()
const {
return true; }
881 virtual const fileName&
dbDir()
const 888 const word&
name()
const 898 static fileName
dbDir(
const word& areaRegion);
902 static fileName
dbDir(
const word& volRegion,
const word& areaRegion);
906 static fileName
dbDir 908 const polyMesh& pMesh,
914 static fileName
meshDir(
const word& areaRegion);
918 static fileName
meshDir(
const word& volRegion,
const word& areaRegion);
924 const polyMesh& pMesh,
941 inline label
whichFace(const label meshFacei) const;
974 return (edgeIndex < nInternalEdges_);
1014 void removeFiles(
const fileName& instanceDir)
const;
1038 return bool(faceAreaNormalsPtr_);
1044 return bool(edgeAreaNormalsPtr_);
1050 return bool(pointAreaNormalsPtr_);
1056 return bool(faceCurvaturesPtr_);
1062 return bool(correctPatchPointNormalsPtr_);
1160 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.
faMesh(const faMesh &)=delete
No copy construct.
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.
faSolution(const faSolution &)=delete
No copy construct.
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
virtual bool hasDb() const
True - thisDb() is a valid registry.
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...
List< edge > edgeList
List of edge.
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 const fileName & dbDir() const
Local directory path of the objectRegistry relative to Time with override for the single-region case...
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.
The objectRegistry for faMesh.
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.
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.
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.
UList< label > labelUList
A UList of labels.
label nPoints() const noexcept
Number of local mesh points.
A field of fields is a PtrList of fields with reference counting.
virtual const objectRegistry & thisDb() const
Reference to the mesh database.
#define forAll(list, i)
Loop across all elements in list.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
void operator=(const faMesh &)=delete
No copy assignment.
static int geometryOrder() noexcept
Return the current geometry treatment.
virtual const fileName & dbDir() const
Local directory path of the objectRegistry relative to Time with override for the single-region case...
List< face > faceList
List of faces.
const labelUList & neighbour() const
Internal face neighbour.
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.
faMeshRegistry(const word &areaRegion, const polyMesh &mesh)
Construct an objectRegistry for given area region name.
bool hasPointAreaNormals() const noexcept
Has point area normals: pointAreaNormals()
bool hasAreaCentres() const noexcept
Has face centres: areaCentres()
bool hasInternalEdgeLabels() const noexcept
True if the internalEdges use an ordering that does not correspond 1-to-1 with the patch internalEdge...
static const word null
An empty word.
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...
virtual bool hasDb() const
True - thisDb() is a valid registry.
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.
faSchemes(const faSchemes &)=delete
No copy construct.
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...
static autoPtr< faMesh > TryNew(const word &meshName, const polyMesh &pMesh)
Read construction from polyMesh if all files are available.
bool moving() const
Is mesh moving.
bool hasEdgeCentres() const noexcept
Has edge centres: edgeCentres()
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const faSchemes * hasSchemes() const
Non-null if faSchemes exists (can test as bool).
bool hasFaceAreas() const noexcept
Has face areas: S()
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
void clear()
Clear all entries from the registry.
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.
Mesh consisting of general polyhedral cells.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
virtual const objectRegistry & thisDb() const
Reference to the mesh database.
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()
static const word & prefix() noexcept
The prefix to the parent registry name: finite-area.
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 & solution() const
Read-access to the faSolution controls.
const faSolution * hasSolution() const
Non-null if faSolution exists (can test as bool).
objectRegistry(const Time &db, const label initialCapacity=128)
Construct the time objectRegistry, with estimated table capacity (default: 128)
const labelList & edgeOwner() const noexcept
Edge owner addressing.
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.