Go to the documentation of this file.
39 const word& defaultPatchFieldType,
40 const bool validBoundary
58 if (!isA<processorPolyPatch>(patch))
60 forAll(polyPatches, patchI)
62 const polyPatch& pp = polyPatches[patchI];
64 if (isA<processorPolyPatch>(pp))
66 insertPatchI = patchI;
67 startFaceI = pp.
start();
108 addPatchFields<volScalarField>
112 defaultPatchFieldType,
115 addPatchFields<volVectorField>
119 defaultPatchFieldType,
122 addPatchFields<volSphericalTensorField>
126 defaultPatchFieldType,
129 addPatchFields<volSymmTensorField>
133 defaultPatchFieldType,
136 addPatchFields<volTensorField>
140 defaultPatchFieldType,
146 addPatchFields<surfaceScalarField>
150 defaultPatchFieldType,
153 addPatchFields<surfaceVectorField>
157 defaultPatchFieldType,
160 addPatchFields<surfaceSphericalTensorField>
164 defaultPatchFieldType,
167 addPatchFields<surfaceSymmTensorField>
171 defaultPatchFieldType,
174 addPatchFields<surfaceTensorField>
178 defaultPatchFieldType,
185 for (
label i = 0; i < insertPatchI; i++)
190 for (
label i = insertPatchI; i < sz; i++)
195 oldToNew[sz] = insertPatchI;
198 polyPatches.
reorder(oldToNew, validBoundary);
201 reorderPatchFields<volScalarField>(
mesh, oldToNew);
202 reorderPatchFields<volVectorField>(
mesh, oldToNew);
203 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
204 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
205 reorderPatchFields<volTensorField>(
mesh, oldToNew);
206 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
207 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
208 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
209 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
210 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
223 setPatchFields<volScalarField>(
mesh, patchI, patchFieldDict);
224 setPatchFields<volVectorField>(
mesh, patchI, patchFieldDict);
225 setPatchFields<volSphericalTensorField>(
mesh, patchI, patchFieldDict);
226 setPatchFields<volSymmTensorField>(
mesh, patchI, patchFieldDict);
227 setPatchFields<volTensorField>(
mesh, patchI, patchFieldDict);
228 setPatchFields<surfaceScalarField>(
mesh, patchI, patchFieldDict);
229 setPatchFields<surfaceVectorField>(
mesh, patchI, patchFieldDict);
230 setPatchFields<surfaceSphericalTensorField>
236 setPatchFields<surfaceSymmTensorField>(
mesh, patchI, patchFieldDict);
237 setPatchFields<surfaceTensorField>(
mesh, patchI, patchFieldDict);
245 setPatchFields<volSphericalTensorField>
251 setPatchFields<volSymmTensorField>
260 setPatchFields<surfaceSphericalTensorField>
266 setPatchFields<surfaceSymmTensorField>
286 if (polyPatches.
empty())
289 <<
"No patches in mesh"
296 nFaces += polyPatches[patchI].
size();
303 <<
"There are still " << nFaces
314 trimPatchFields<volSphericalTensorField>(
mesh,
nPatches);
320 trimPatchFields<surfaceSphericalTensorField>(
mesh,
nPatches);
321 trimPatchFields<surfaceSymmTensorField>(
mesh,
nPatches);
330 const label nNewPatches,
331 const bool validBoundary
339 polyPatches.
reorder(oldToNew, validBoundary);
342 reorderPatchFields<volScalarField>(
mesh, oldToNew);
343 reorderPatchFields<volVectorField>(
mesh, oldToNew);
344 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
345 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
346 reorderPatchFields<volTensorField>(
mesh, oldToNew);
347 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
348 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
349 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
350 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
351 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
354 trimPatches(
mesh, nNewPatches);
361 const bool validBoundary
376 if (!isA<processorPolyPatch>(pp))
378 label nFaces = pp.size();
386 newToOld[newI] = patchI;
387 oldToNew[patchI] = newI++;
397 if (isA<processorPolyPatch>(pp) && pp.size())
399 newToOld[newI] = patchI;
400 oldToNew[patchI] = newI++;
409 if (oldToNew[patchI] == -1)
411 oldToNew[patchI] = newI++;
415 reorderPatches(
mesh, oldToNew, newToOld.
size(), validBoundary);
424 const bool masterOnlyReading
481 toSlave << patchEntries;
488 fromMaster >> patchEntries;
499 bool haveMesh =
isDir(meshDir);
575 forAll(patchEntries, patchI)
577 const entry&
e = patchEntries[patchI];
578 const word type(
e.dict().lookup(
"type"));
582 type == processorPolyPatch::typeName
583 ||
type == processorCyclicPolyPatch::typeName
589 patchDict.
set(
"nFaces", 0);
590 patchDict.
set(
"startFace", 0);
596 patchEntries[patchI].keyword(),
A keyword and a list of tokens is an 'entry'.
vectorField pointField
pointField is a vectorField.
void clear()
Clear the zones.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label findPatchID(const word &patchName) const
Find patch index given a name.
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
A class for handling file names.
List< label > labelList
A List of labels.
Foam::polyBoundaryMeshEntries.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Output inter-processor communications stream.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void reorder(const labelUList &, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
const fileName & instance() const
const Time & time() const
Return time.
const faceZoneMesh & faceZones() const
Return face zone mesh.
const objectRegistry & db() const
Return the local objectRegistry.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
bool set(const label) const
Is element set.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
readOption readOpt() const
A subset of mesh faces organised as a primitive patch.
static int lastSlave(const label communicator=0)
Process index of last slave.
A patch is a list of labels that address the faces in the global face list.
const pointZoneMesh & pointZones() const
Return point zone mesh.
bool empty() const
Return true if the PtrList is empty (ie, size() is zero).
const word & name() const
Return name.
static int masterNo()
Process index of the master.
fileCheckTypes
Types of communications.
void reorder(const labelUList &)
Reorders elements. Ordering does not have to be done in.
A list of keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
static int firstSlave()
Process index of first slave.
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
const double e
Elementary charge.
List< bool > boolList
Bool container classes.
label start() const
Return start label of this patch in the polyMesh face list.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Return the location of "dir" containing the file "name".
wordList names() const
Return a list of zone names.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
static bool master(const label communicator=0)
Am I the master process.
static fileCheckTypes fileModificationChecking
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
fileName path() const
Return path.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Traits class for primitives.
Foam::autoPtr< IOobject > clone() const
Clone.
label size() const
Return the number of elements in the PtrList.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Input inter-processor communications stream.
void size(const label)
Override size to be inconsistent with allocated storage.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const word & name() const
Return name.
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
void clearOut()
Clear all geometry and addressing.
void set(entry *)
Assign a new entry, overwrite any existing entry.