112 virtual bool hasDb()
const {
return true; }
115 virtual const objectRegistry&
thisDb()
const {
return *
this; }
167 for (
auto& tuples : list)
189 return (procNo() >= 0 && patchi() != -1);
193 label procNo()
const {
return (*
this)[0]; }
194 void procNo(label val) { (*this)[0] = val; }
197 label patchi()
const {
return (*
this)[1]; }
198 void patchi(label val) { (*this)[1] = val; }
202 label patchEdgei()
const {
return (*
this)[2]; }
203 void patchEdgei(label val) { (*this)[2] = val; }
206 label meshFacei()
const {
return (*
this)[3]; }
207 void meshFacei(label val) { (*this)[3] = val; }
210 label realPatchi()
const
212 const label
id = patchi();
213 return (
id < -1 ? -(
id + 2) :
id);
217 void faPatchi(label val)
223 bool is_finiteArea()
const noexcept
225 return (patchi() < -1);
229 bool is_localProc()
const
260 mutable label nPoints_;
263 mutable label nEdges_;
266 mutable label nInternalEdges_;
269 mutable label nFaces_;
281 mutable label curTimeIndex_;
287 mutable std::unique_ptr<uindirectPrimitivePatch> patchPtr_;
290 mutable std::unique_ptr<List<labelPair>> polyPatchFacesPtr_;
293 mutable std::unique_ptr<labelList> polyPatchIdsPtr_;
296 mutable std::unique_ptr<List<labelPair>> bndConnectPtr_;
299 mutable std::unique_ptr<faMeshLduAddressing> lduPtr_;
305 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> SPtr_;
308 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> S0Ptr_;
311 mutable std::unique_ptr<DimensionedField<scalar, areaMesh>> S00Ptr_;
314 mutable std::unique_ptr<labelList> patchStartsPtr_;
317 mutable std::unique_ptr<edgeVectorField> LePtr_;
320 mutable std::unique_ptr<edgeScalarField> magLePtr_;
323 mutable std::unique_ptr<areaVectorField> faceCentresPtr_;
326 mutable std::unique_ptr<edgeVectorField> edgeCentresPtr_;
329 mutable std::unique_ptr<areaVectorField> faceAreaNormalsPtr_;
332 mutable std::unique_ptr<edgeVectorField> edgeAreaNormalsPtr_;
335 mutable std::unique_ptr<vectorField> pointAreaNormalsPtr_;
338 mutable std::unique_ptr<areaScalarField> faceCurvaturesPtr_;
341 mutable std::unique_ptr<FieldField<Field, tensor>>
342 edgeTransformTensorsPtr_;
345 mutable std::unique_ptr<boolList> correctPatchPointNormalsPtr_;
354 mutable std::unique_ptr<faMeshBoundaryHalo> haloMapPtr_;
357 mutable std::unique_ptr<pointField> haloFaceCentresPtr_;
360 mutable std::unique_ptr<vectorField> haloFaceNormalsPtr_;
366 static const word prefix_;
369 static const int quadricsFit_;
376 void initPatch()
const;
380 void setPrimitiveMeshData();
387 void calcBoundaryConnections()
const;
391 void setBoundaryConnections
400 void calcLduAddressing()
const;
403 void calcPatchStarts()
const;
407 void calcWhichPatchFaces()
const;
420 void calcMagLe()
const;
424 void calcFaceCentres()
const;
428 void calcEdgeCentres()
const;
436 void calcFaceAreaNormals()
const;
440 void calcEdgeAreaNormals()
const;
444 void calcPointAreaNormals(
vectorField& result)
const;
447 void calcPointAreaNormalsByQuadricsFit(
vectorField& result)
const;
451 void calcFaceCurvatures()
const;
454 void calcEdgeTransformTensors()
const;
457 void clearGeomNotAreas()
const;
460 bool hasHaloFaceGeometry()
const noexcept;
463 void clearHalo()
const;
466 void clearGeom()
const;
469 void clearAddressing()
const;
472 void clearOut()
const;
478 void calcHaloFaceGeometry()
const;
486 const word& patchName,
487 const word& patchType =
""
494 const word& emptyPatchName =
"",
495 const dictionary* defaultPatchDefinition =
nullptr
500 void checkBoundaryEdgeLabelRange(
const labelUList& edgeLabels)
const;
512 checkBoundaryEdgeLabelRange(edgeLabels);
518 result[i] = bndField[edgeLabels[i] - nInternalEdges_];
527 static bool hasSystemFiles
529 const word& areaName,
534 static bool hasMeshFiles
536 const word& areaName,
597 const word& areaName,
633 const word& areaName,
654 const word& areaName,
667 const word& areaName,
669 const bool doInit =
true
678 const word& areaName,
681 const bool doInit =
true
689 const bool doInit =
true
718 const word& areaName,
734 const bool validBoundary =
true
741 const bool validBoundary =
true
745 bool init(
const bool doInit);
876 virtual
bool hasDb()
const {
return true; }
886 virtual const fileName&
dbDir()
const
892 const word&
name()
const
902 static fileName
dbDir(
const word& areaRegion);
906 static fileName
dbDir(
const word& volRegion,
const word& areaRegion);
910 static fileName
dbDir
912 const polyMesh& pMesh,
918 static fileName
meshDir(
const word& areaRegion);
922 static fileName
meshDir(
const word& volRegion,
const word& areaRegion);
928 const polyMesh& pMesh,
945 inline label
whichFace(const label meshFacei) const;
978 return (edgeIndex < nInternalEdges_);
1018 void removeFiles(
const fileName& instanceDir)
const;
1042 return bool(faceAreaNormalsPtr_);
1048 return bool(edgeAreaNormalsPtr_);
1054 return bool(pointAreaNormalsPtr_);
1060 return bool(faceCurvaturesPtr_);
1066 return bool(correctPatchPointNormalsPtr_);
1164 virtual bool write(
const bool writeOnProc =
true)
const;
Forwards and collection of common area field types.
labelList faceLabels(nFaceLabels)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A field of fields is a PtrList of fields with reference counting.
A 1D vector of objects of type <T> with a fixed length <N>.
friend Ostream & operator(Ostream &, const HashTable< regIOobject *, word, Foam::Hash< word > > &tbl)
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
const word & name() const noexcept
Return the object name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An ordered pair of two objects of type <T> with first() and second() elements.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
edgeInterpolation(const edgeInterpolation &)=delete
No copy construct.
Finite area boundary mesh, which is a faPatch list with registered IO, a reference to the associated ...
lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch with only those pointing to interfaces being set.
Various mesh related information for a parallel run.
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ord...
lduAddressing wrapper for faMesh
Class holds all the necessary information for mapping fields associated with faMesh.
The objectRegistry for faMesh.
virtual const objectRegistry & thisDb() const
Reference to the mesh database.
virtual const fileName & dbDir() const
Local directory path of the objectRegistry relative to Time with override for the single-region case.
faMeshRegistry(const word &areaName, const polyMesh &mesh)
Construct an objectRegistry for given area region name. Treat an empty name like polyMesh::defaultReg...
virtual bool hasDb() const
True - thisDb() is a valid registry.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
virtual bool movePoints()
Update after mesh motion.
boolList & correctPatchPointNormals() const
Set whether point normals should be corrected for a patch.
labelList internalPoints() const
Return internal point labels.
virtual const objectRegistry & thisDb() const
Reference to the mesh database.
bool operator==(const faMesh &m) const
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels().
static int geometryOrder() noexcept
Return the current geometry treatment.
const fileName & facesInstance() const
Return the current instance directory for faces.
bool hasAreaCentres() const noexcept
Has face centres: areaCentres().
const vectorField & haloFaceNormals() const
Face unit-normals of boundary halo neighbours.
const labelList & patchStarts() const
Return patch starts.
label & comm() noexcept
Return communicator used for parallel communication.
bool hasGlobalData() const noexcept
Is demand-driven parallel info available?
bool hasPatchPointNormalsCorrection() const noexcept
Has patch point normals corrections.
virtual void mapOldAreas(const faMeshMapper &mapper) const
Map face areas in time using given map.
faBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
bool hasInternalEdgeLabels() const noexcept
True if the internalEdges use an ordering that does not correspond 1-to-1 with the patch internalEdge...
const Time & time() const
Return reference to time.
tmp< edgeVectorField > unitLe() const
Return normalised edge length vectors.
const faBoundaryMesh & boundary() const noexcept
Return constant reference to boundary mesh.
bool hasPointAreaNormals() const noexcept
Has point area normals: pointAreaNormals().
faMesh(const faMesh &)=delete
No copy construct.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir).
const pointField & haloFaceCentres() const
Face centres of boundary halo neighbours.
virtual const fileName & dbDir() const
Local directory path of the objectRegistry relative to Time with override for the single-region case.
bool hasFaceAreas() const noexcept
Has face areas: S().
label nEdges() const noexcept
Number of local mesh edges.
bool hasLe() const noexcept
Has edge length vectors: Le().
const edgeVectorField & edgeCentres() const
Return edge centres as edgeVectorField.
const DimensionedField< scalar, areaMesh > & S00() const
Return old-old-time face areas.
label nBoundaryEdges() const noexcept
Number of boundary edges (== nEdges - nInternalEdges).
const faceList & faces() const
Return local faces.
bool isInternalEdge(const label edgeIndex) const noexcept
True if given edge label is internal to the mesh.
const polyMesh & mesh() const
Return access to polyMesh.
bool init(const bool doInit)
Initialise non-demand-driven data etc.
const edgeScalarField & magLe() const
Return edge length magnitudes.
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
void operator=(const faMesh &)=delete
No copy assignment.
const edgeList::subList internalEdges() const
Sub-list of local internal edges.
const word & name() const
The name of the area mesh.
label whichFace(const label meshFacei) const
The area-face corresponding to the mesh-face, -1 if not found.
const faSchemes * hasSchemes() const
Non-null if faSchemes exists (can test as bool).
meshState & data()
Reference to the mesh and solver state data.
static const objectRegistry * registry(const polyMesh &pMesh)
Find the singleton parent registry (on the polyMesh) that contains all objects related to finite-area...
virtual void mapFields(const faMeshMapper &mapper) const
Map all fields in time using given map.
const faSolution & solution() const
Read-access to the faSolution controls.
const edgeList & edges() const noexcept
Return local edges with reordered boundary.
bool hasEdgeCentres() const noexcept
Has edge centres: edgeCentres().
const meshState & data() const
Const reference to the mesh and solver state data.
const uindirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
const faSchemes & schemes() const
Read-access to the faSchemes controls.
const edgeVectorField & Le() const
Return edge length vectors.
const FieldField< Field, tensor > & edgeTransformTensors() const
Return edge transformation tensors.
const fileName & pointsInstance() const
Return the current instance directory for points.
const labelUList & owner() const
Internal face owner.
static int geometryOrder_
Geometry treatment.
bool operator!=(const faMesh &m) const
label nInternalEdges() const noexcept
Number of internal faces.
const faGlobalMeshData & globalData() const
Return parallel info (demand-driven).
const DimensionedField< scalar, areaMesh > & S0() const
Return old-time face areas.
static int geometryOrder(int order) noexcept
Set the preferred geometry treatment.
const areaScalarField & faceCurvatures() const
Return face curvatures.
tmp< edgeScalarField > edgeLengthCorrection() const
Return edge length correction.
label nPoints() const noexcept
Number of local mesh points.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
const labelUList & neighbour() const
Internal face neighbour.
labelList faceCells() const
The volume (owner) cells associated with the area-mesh.
void syncGeom()
Processor/processor synchronisation for geometry fields.
virtual bool hasDb() const
True - thisDb() is a valid registry.
label nFaces() const noexcept
Number of patch faces.
const List< labelPair > & boundaryConnections() const
List of proc/face for the boundary edge neighbours using primitive patch edge numbering.
void operator()() const =delete
No call operator. Prior to 2312 was used to obtain polyMesh.
static autoPtr< faMesh > TryNew(const word &areaName, const polyMesh &pMesh)
Read construction from polyMesh if all files are available.
faMesh Mesh
The mesh type.
static const word & prefix() noexcept
The prefix to the parent registry name: finite-area.
labelList boundaryProcs() const
Boundary edge neighbour processors (does not include own proc).
const edgeVectorField & edgeAreaNormals() const
Return edge area normals.
label comm() const noexcept
Return communicator used for parallel communication.
const labelList & whichPolyPatches() const
The polyPatches related to the areaMesh, in sorted order.
static const objectRegistry & Registry(const polyMesh &pMesh)
Return the singleton parent registry (on the polyMesh) that contains all objects related to finite-ar...
const pointField & points() const
Return local points.
void addFaPatches(faPatchList &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
void removeFiles() const
Remove all files from mesh instance().
bool hasFaceCurvatures() const noexcept
Has face curvatures: faceCurvatures().
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
const labelList & edgeOwner() const noexcept
Edge owner addressing.
List< labelPair > boundaryProcSizes() const
List of proc/size for the boundary edge neighbour processors (does not include own proc).
bool hasEdgeAreaNormals() const noexcept
Has edge area normals: edgeAreaNormals().
virtual void updateMesh(const mapPolyMesh &)
Update after topo change.
const vectorField & pointAreaNormals() const
Return point area normals.
virtual ~faMesh()
Destructor.
static word meshSubDir
The mesh sub-directory name (usually "faMesh").
bool hasMagLe() const noexcept
Has edge length magnitudes: magLe().
TypeName("faMesh")
Runtime type information.
bool hasFaceAreaNormals() const noexcept
Has face area normals: faceAreaNormals().
const word & regionName() const
The region name or word::null if polyMesh::defaultRegion.
const areaVectorField & faceAreaNormals() const
Return face area normals.
const faMeshBoundaryHalo & boundaryHaloMap() const
Mapping/swapping for boundary halo neighbours.
const faSolution * hasSolution() const
Non-null if faSolution exists (can test as bool).
labelList boundaryPoints() const
Return boundary point labels.
bool moving() const
Is mesh moving.
const areaVectorField & areaCentres() const
Return face centres as areaVectorField.
Helper class for holding data during faPatch construction. Most data members are exposed at the momen...
Selector class for finite area differencing schemes. faMesh is derived from faSchemes so that all fie...
faSchemes(const faSchemes &)=delete
No copy construct.
Selector class for finite area solution. faMesh is derived from faSolution so that all fields have ac...
faSolution(const faSolution &)=delete
No copy construct.
A class for handling file names.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Database for mesh data, solution data, solver performance and other reduced data.
Registry of regIOobjects.
void clear()
Clear all entries from the registry.
Mesh consisting of general polyhedral cells.
bool moving() const noexcept
Is mesh moving.
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
A patch is a list of labels that address the faces in the global face list.
Selector class for relaxation factors, solver type and solution.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Forwards for edge field types.
List< edge > edgeList
List of edge.
Pair< label > labelPair
A pair of labels.
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
List< label > labelList
A List of labels.
IOList< label > labelIOList
IO for a List of label.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
List< face > faceList
List of faces.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
void sort(UList< T > &list)
Sort the list.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< bool > boolList
A List of bools.
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
vectorField pointField
pointField is a vectorField.
PtrList< faPatch > faPatchList
Store lists of faPatch as a PtrList.
UList< label > labelUList
A UList of labels.
void stableSort(UList< T > &list)
Stable sort the list.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
#define forAll(list, i)
Loop across all elements in list.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.