47 const word& defaultPatchFieldType,
48 const bool validBoundary
53 label patchi = polyPatches.
findPatchID(patch.name());
62 label insertPatchi = polyPatches.size();
65 if (!isA<processorPolyPatch>(patch))
67 forAll(polyPatches, patchi)
69 const polyPatch& pp = polyPatches[patchi];
71 if (isA<processorPolyPatch>(pp))
73 insertPatchi = patchi;
74 startFacei = pp.
start();
87 label sz = polyPatches.size();
104 fvPatches.resize(sz+1);
119 #define doLocalCode(FieldType) \
121 addPatchFields<FieldType> \
123 mesh, patchFieldDict, defaultPatchFieldType, Zero \
152 for (label i = insertPatchi; i < sz; ++i)
156 oldToNew[sz] = insertPatchi;
160 polyPatches.reorder(oldToNew, validBoundary);
161 fvPatches.reorder(oldToNew);
166 #define doLocalCode(FieldType) \
168 reorderPatchFields<FieldType>(mesh, oldToNew); \
193void Foam::fvMeshTools::setPatchFields
203 #define doLocalCode(FieldType) \
205 setPatchFields<FieldType>(mesh, patchi, patchFieldDict); \
233 #define doLocalCode(FieldType) \
235 setPatchFields<FieldType>(mesh, patchi, Zero); \
267 if (polyPatches.empty())
270 <<
"No patches in mesh"
275 for (label patchi =
nPatches; patchi < polyPatches.size(); patchi++)
284 <<
"There are still " <<
nFaces
296 #define doLocalCode(FieldType) \
298 trimPatchFields<FieldType>(mesh, nPatches); \
325 const label nNewPatches,
326 const bool validBoundary
333 polyPatches.
reorder(oldToNew, validBoundary);
334 fvPatches.reorder(oldToNew);
339 #define doLocalCode(FieldType) \
341 reorderPatchFields<FieldType>(mesh, oldToNew); \
363 trimPatches(
mesh, nNewPatches);
370 const bool validBoundary
385 if (!isA<processorPolyPatch>(pp))
395 newToOld[newI] = patchI;
396 oldToNew[patchI] = newI++;
406 if (isA<processorPolyPatch>(pp) && pp.size())
408 newToOld[newI] = patchI;
409 oldToNew[patchI] = newI++;
418 if (oldToNew[patchI] == -1)
420 oldToNew[patchI] = newI++;
424 reorderPatches(
mesh, oldToNew, newToOld.
size(), validBoundary);
453 const bool masterOnlyReading,
529 IOobject cmptIO(meshIO,
"points", meshSubDir);
537 bool haveMesh =
isDir(meshDir);
581 cmptIO.
rename(
"neighbour");
625 forAll(patchEntries, patchi)
627 const entry&
e = patchEntries[patchi];
646 patchDict.
set(
"nFaces", 0);
647 patchDict.
set(
"startFace", 0);
736 const bool decompose,
817 forAll(patchEntries, patchi)
819 const entry&
e = patchEntries[patchi];
836 patchDict.
set(
"nFaces", 0);
837 patchDict.
set(
"startFace", 0);
847 dummyMesh.boundaryMesh()
853 dummyMesh.addFvPatches(
patches,
false);
863 new pointZone(
"dummyPointZone", 0, dummyMesh.pointZones())
868 new faceZone(
"dummyFaceZone", 0, dummyMesh.faceZones())
873 new cellZone(
"dummyCellZone", 0, dummyMesh.cellZones())
875 dummyMesh.addZones(pz, fz, cz);
876 dummyMesh.pointZones().clear();
877 dummyMesh.faceZones().clear();
878 dummyMesh.cellZones().clear();
909 forAll(patchEntries, patchi)
911 const entry&
e = patchEntries[patchi];
927 <<
"Non-processor patches not synchronised."
931 <<
" patches, master has "
943 <<
"Non-processor patches not synchronised."
945 <<
"Master patch " << patchi
949 <<
" patch " << patchi
951 <<
" type:" <<
patches[patchi].type()
1025 for (
const word& setName : pointSetNames)
1029 for (
const word& setName : faceSetNames)
1033 for (
const word& setName : cellSetNames)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
A primitive field of type <T> with automated input and output.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List of IOobjects with searching and retrieving facilities.
wordList sortedNames() const
The sorted names of the IOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const Time & time() const
Return Time associated with the objectRegistry.
readOption readOpt() const noexcept
The read option.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
bool registerObject() const noexcept
Should object created with this IOobject be registered?
const fileName & instance() const noexcept
Read access to instance path component.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void rename(const word &newName)
Rename the object.
writeOption writeOpt() const noexcept
The write option.
void resize(const label len)
Adjust allocated size of list.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
PtrList< T > clone(Args &&... args) const
Make a copy by cloning each of the list elements.
void resize(const label newLen)
Adjust size of PtrList.
const word & system() const
Return system name.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
fileName path() const
Return path.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
void size(const label n)
Older name for setAddressableSize.
static label worldComm
Default communicator (all processors)
static bool & parRun() noexcept
Test if this a parallel run.
void reorder(const labelUList &oldToNew, const bool check=false)
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
label size() const noexcept
The number of elements in the list.
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
void clear()
Clear the zones.
wordList names() const
A list of the zone names.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Default geometry calculation scheme. Slight stabilisation for bad meshes.
A collection of cell labels.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
A keyword and a list of tokens is an 'entry'.
A subset of mesh faces organised as a primitive patch.
A class for handling file names.
virtual bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true) const =0
Does the name exist as a FILE in the file system?
Mesh data needed to do the Finite Volume discretisation.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void addFvPatches(polyPatchList &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
const Time & time() const
Return the top-level database.
void clearOut()
Clear all geometry and addressing.
Registry of regIOobjects.
Read and store dictionary entries for boundary patches.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
bool checkDefinition(const bool report=false) const
Check boundary definition.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const fileName & facesInstance() const
Return the current instance directory for faces.
const globalMeshData & globalData() const
Return parallel info.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
label nInternalFaces() const noexcept
Number of internal faces.
label nFaces() const noexcept
Number of mesh faces.
int myProcNo() const noexcept
Return processor number.
virtual bool write(const bool valid=true) const
Write using setting from DB.
splitCell * master() const
virtual const fvGeometryScheme & geometry() const
Return reference to geometry calculation scheme.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const polyBoundaryMesh & patches
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
const fileOperation & fileHandler()
Get current file handler.
GeometricField< vector, fvPatchField, volMesh > volVectorField
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
GeometricField< sphericalTensor, fvsPatchField, surfaceMesh > surfaceSphericalTensorField
errorManip< error > abort(error &err)
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
GeometricField< symmTensor, fvsPatchField, surfaceMesh > surfaceSymmTensorField
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.
#define doLocalCode(GeoField)