83 class faMeshBoundaryHalo;
84 class faMeshLduAddressing;
112 virtual bool hasDb()
const {
return true; }
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)
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;
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...
static int myProcNo(label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
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.
faMeshRegistry(const word &areaName, const polyMesh &mesh)
Construct an objectRegistry for given area region name. Treat an empty name like polyMesh::defaultReg...
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.
const word & regionName() const
The 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.
bool isInternalEdge(label edgeIndex) const noexcept
True if given edge label is internal to the mesh.
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()
static const objectRegistry & Registry(const polyMesh &pMesh)
Return the singleton parent registry (on the polyMesh) that contains all objects related to finite-ar...
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()
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...
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
The name of the area mesh.
const fileName & pointsInstance() const
Return the current instance directory for points.
static autoPtr< faMesh > TryNew(const word &areaName, const polyMesh &pMesh)
Read construction from polyMesh if all files are available.
Finite area boundary mesh, which is a faPatch list with registered IO, a reference to the associated ...
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)
Find the singleton parent registry (on the polyMesh) that contains all objects related to finite-area...
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.