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,
137 meshIO.instance() = facesInstance;
141 IOobject cmptIO(
io.
time(),
"faceLabels", meshSubDir);
142 cmptIO.instance() = facesInstance;
150 const fileName meshDir =
io.
time().
path()/facesInstance/meshSubDir;
151 bool haveMesh =
isDir(meshDir);
176 cmptIO.rename(
"faceLabels");
200 const bool isEmptyMesh = (
mesh.faceLabels().
empty());
202 forAll(patchEntries, patchi)
204 const entry&
e = patchEntries[patchi];
205 const word
type(
e.dict().get<word>(
"type"));
206 const word&
name =
e.keyword();
210 type == processorFaPatch::typeName
223 patchDict.set(
"edgeLabels",
labelList());
253 Foam::faMeshTools::loadOrCreateMeshImpl
256 refPtr<fileOperation>* readHandlerPtr,
257 const polyMesh& pMesh,
258 const bool decompose,
263 const fileName meshSubDir
273 PtrList<entry> patchEntries;
280 patchEntries = faBoundaryMeshEntries
297 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
307 bool haveLocalMesh =
false;
312 haveLocalMesh = (*readHandlerPtr).good();
328 io.time().
path()/
io.instance()/meshSubDir/
"faceLabels" 338 UPstream::allGatherValues<bool>(haveLocalMesh)
368 forAll(patchEntries, patchi)
370 const entry&
e = patchEntries[patchi];
371 const word
type(
e.dict().get<word>(
"type"));
372 const word&
name =
e.keyword();
376 type == processorFaPatch::typeName
386 patchDict.set(
"edgeLabels",
labelList());
425 const_cast<fileOperation&
>(
fileHandler()).nProcs(oldNumProcs);
429 else if (readHandlerPtr && haveLocalMesh)
433 UPstream::communicator newCommunicator;
436 auto& readHandler = *readHandlerPtr;
450 meshProcIds.size() == handlerProcIds.size()
453 meshProcIds.cbegin(),
455 handlerProcIds.cbegin()
514 forAll(patchEntries, patchi)
516 const entry&
e = patchEntries[patchi];
517 const word
type(
e.dict().get<word>(
"type"));
518 const word&
name =
e.keyword();
522 type == processorFaPatch::typeName
531 <<
"Non-processor patches not synchronised." <<
endl 534 <<
" patches, master has " 546 <<
"Non-processor patches not synchronised." <<
endl 547 <<
"Master patch " << patchi
551 <<
" patch " << patchi
553 <<
" type:" <<
patches[patchi].type()
586 const bool decompose,
590 return faMeshTools::loadOrCreateMeshImpl
610 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 = rootPath/caseName. Same as TimePaths::path()
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 communicator ranks. Does nothing in non-paral...
#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 expressions::valueTypeCode::INVALID.
word findInstance(const fileName &directory, const word &name=word::null, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, const word &stopInstance=word::null, const bool constant_fallback=true) const
Return time instance (location) of directory containing the file name (eg, used in reading mesh data)...
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
label size() const noexcept
The number of entries in the list.
Reading is optional [identical to LAZY_READ].
static const word null
An empty word.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
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 communicator ranks. Does nothing in non-parallel. ...
Read and store dictionary entries for finite-area boundary patches. The object is *never* registered ...
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 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.
Do not request registration (bool: false)