46 obr.checkOut(
"faBoundaryMesh");
47 obr.checkOut(
"faSchemes");
48 obr.checkOut(
"faSolution");
58 (void)
mesh.areaCentres();
59 (void)
mesh.edgeCentres();
61 (void)
mesh.faceAreaNormals();
62 (void)
mesh.edgeAreaNormals();
63 (void)
mesh.pointAreaNormals();
64 (void)
mesh.faceCurvatures();
65 (void)
mesh.edgeTransformTensors();
76 const bool masterOnlyReading,
140 meshIO.instance() = facesInstance;
144 IOobject cmptIO(meshIO,
"faceLabels", meshSubDir);
147 cmptIO.registerObject(
false);
152 const fileName meshDir =
io.
time().
path()/facesInstance/meshSubDir;
153 bool haveMesh =
isDir(meshDir);
178 cmptIO.rename(
"faceLabels");
202 const bool isEmptyMesh = (
mesh.faceLabels().
empty());
204 forAll(patchEntries, patchi)
206 const entry&
e = patchEntries[patchi];
207 const word
type(
e.dict().get<word>(
"type"));
208 const word&
name =
e.keyword();
212 type == processorFaPatch::typeName
221 dictionary patchDict(
e.dict());
225 patchDict.set(
"edgeLabels",
labelList());
255 Foam::faMeshTools::loadOrCreateMeshImpl
258 refPtr<fileOperation>* readHandlerPtr,
259 const polyMesh& pMesh,
260 const bool decompose,
267 const fileName meshSubDir
277 PtrList<entry> patchEntries;
284 patchEntries = faBoundaryMeshEntries
301 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
311 bool haveLocalMesh =
false;
316 haveLocalMesh = (*readHandlerPtr).good();
332 io.time().
path()/
io.instance()/meshSubDir/
"faceLabels" 342 UPstream::allGatherValues<bool>(haveLocalMesh)
372 forAll(patchEntries, patchi)
374 const entry&
e = patchEntries[patchi];
375 const word
type(
e.dict().get<word>(
"type"));
376 const word&
name =
e.keyword();
380 type == processorFaPatch::typeName
389 dictionary patchDict(
e.dict());
390 patchDict.set(
"edgeLabels",
labelList());
429 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
433 else if (readHandlerPtr && haveLocalMesh)
437 UPstream::communicator newCommunicator;
440 auto& readHandler = *readHandlerPtr;
454 meshProcIds.size() == handlerProcIds.size()
457 meshProcIds.cbegin(),
459 handlerProcIds.cbegin()
518 forAll(patchEntries, patchi)
520 const entry&
e = patchEntries[patchi];
521 const word
type(
e.dict().get<word>(
"type"));
522 const word&
name =
e.keyword();
526 type == processorFaPatch::typeName
535 <<
"Non-processor patches not synchronised." <<
endl 538 <<
" patches, master has " 550 <<
"Non-processor patches not synchronised." <<
endl 551 <<
"Master patch " << patchi
555 <<
" patch " << patchi
557 <<
" type:" <<
patches[patchi].type()
590 const bool decompose,
594 return faMeshTools::loadOrCreateMeshImpl
614 return faMeshTools::loadOrCreateMeshImpl
PtrList< faPatch > faPatchList
Store lists of faPatch as a PtrList.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
static autoPtr< faPatch > New(const word &name, const dictionary &dict, const label index, const faBoundaryMesh &bm)
Return pointer to a new patch created on freestore from dictionary.
fileName path() const
Return path.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
word findInstance(const fileName &dir, const word &name=word::null, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, const word &stopInstance=word::null) const
Return time instance (location) of dir that contains the file name (eg, used in reading mesh data)...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
bool checkOut(regIOobject *io) const
Remove a regIOobject from registry and free memory if the object is ownedByRegistry. A nullptr is ignored.
Ignore writing from objectRegistry::writeObject()
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
labelList faceLabels(nFaceLabels)
A class for managing references or pointers (no reference counting)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
#define forAll(list, i)
Loop across all elements in list.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
const dimensionedScalar e
Elementary charge.
IOList< label > labelIOList
IO for a List of label.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
label size() const noexcept
The number of entries in the list.
Reading is optional [identical to LAZY_READ].
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const globalMeshData & globalData() const
Return parallel info.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
bool empty() const noexcept
True if the hash table is empty.
static int cacheLevel() noexcept
Return cache level.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static label commWorld() noexcept
Communicator for all ranks (respecting any local worlds)
void resize(const label newLen)
Adjust size of PtrList.
const fileName & instance() const noexcept
Read access to instance path component.
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
Read and store dictionary entries for finite-area boundary patches.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
static word meshSubDir
The mesh sub-directory name (usually "faMesh")
static List< int > & procID(const label communicator)
The list of ranks within a given communicator.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
Automatically write from objectRegistry::writeObject()
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
Mesh consisting of general polyhedral cells.
static const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Registry of regIOobjects.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
Defines the attributes of an object for which implicit objectRegistry management is supported...
List< bool > boolList
A List of bools.
static const word & regionName(const word ®ion)
The mesh region name or word::null if polyMesh::defaultRegion.
Do not request registration (bool: false)