30 template<
class GeoField>
34 const typename GeoField::Mesh&
mesh,
43 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
56 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
62 const bool readOldTime
71 fields.resize(fieldObjects.size());
75 fields.emplace_set(i, fieldObjects[i],
mesh, readOldTime);
80 template<
class Mesh,
class GeoField>
84 const IOobjectList& objects,
89 UPtrList<const IOobject> fieldObjects(objects.sorted<GeoField>());
92 fields.resize(fieldObjects.size());
101 template<
class BoolListType,
class GeoField,
class MeshSubsetter>
102 void Foam::fieldsDistributor::readFieldsImpl
104 refPtr<fileOperation>* readHandlerPtr,
105 const BoolListType& haveMeshOnProc,
106 const MeshSubsetter* subsetter,
107 const typename GeoField::Mesh&
mesh,
108 IOobjectList& allObjects,
109 PtrList<GeoField>&
fields,
110 const bool deregister
114 IOobjectList objects(allObjects.lookupClass<GeoField>());
126 && objectNames != masterNames
130 <<
"Objects not synchronised across processors." <<
nl 144 bitSet localValues(haveMeshOnProc);
145 bitSet masterValues(localValues);
148 localValues ^= masterValues;
150 if (localValues.any())
153 <<
"haveMeshOnProc not synchronised across processors." <<
nl 155 <<
" differs at these positions: " 164 fields.resize(masterNames.size());
171 HashTable<const GeoField*> other
173 mesh.
thisDb().objectRegistry::template lookupClass<GeoField>()
178 GeoField&
fld =
const_cast<GeoField&
>(*iter.val());
180 if (!
fld.ownedByRegistry())
193 bool decompose =
true;
198 if (haveMeshOnProc.test(proci))
214 const word&
name = masterNames[i];
215 IOobject&
io = *objects[
name];
232 ? readHandlerPtr->good()
238 refPtr<fileOperation> oldHandler;
249 const word&
name = masterNames[i];
250 IOobject&
io = *objects[
name];
269 PtrList<dictionary> fieldDicts;
278 const label nDicts = (subsetter ?
fields.size() : label(0));
282 if (nDicts && subsetter)
289 tmp<GeoField> tsubfld = subsetter->interpolate(
fld);
292 toProcs.beginBlock();
293 toProcs << tsubfld();
310 fromMaster >> fieldDicts;
332 noreadIO.resetHeader(masterNames[i]);
334 fields.emplace_set(i, noreadIO,
mesh, fieldDicts[i]);
354 HashTable<const GeoField*> other
356 mesh.
thisDb().objectRegistry::template lookupClass<GeoField>()
361 GeoField&
fld =
const_cast<GeoField&
>(*iter.val());
363 if (!
fld.ownedByRegistry())
372 template<
class GeoField,
class MeshSubsetter>
375 const bitSet& haveMeshOnProc,
376 const MeshSubsetter* subsetter,
377 const typename GeoField::Mesh&
mesh,
378 IOobjectList& allObjects,
379 PtrList<GeoField>&
fields,
380 const bool deregister
397 template<
class GeoField,
class MeshSubsetter>
401 const MeshSubsetter* subsetter,
402 const typename GeoField::Mesh&
mesh,
405 const bool deregister
422 template<
class GeoField,
class MeshSubsetter>
426 const typename GeoField::Mesh&
mesh,
430 const bool deregister
447 template<
class GeoField,
class MeshSubsetter>
452 const typename GeoField::Mesh&
mesh,
456 const bool deregister
static void readField(const IOobject &io, const typename GeoField::Mesh &mesh, const label i, PtrList< GeoField > &fields)
Generic mesh-based field reading.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
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.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects.
constexpr char nl
The newline '\n' character (0x0a)
wordList sortedNames() const
The sorted names of the IOobjects.
static bool & parRun() noexcept
Test if this a parallel run.
Begin list [isseparator].
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
Generic GeometricField class.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
const Time & time() const
Return the top-level database.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
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.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
#define forAll(list, i)
Loop across all elements in list.
writeOption writeOpt() const noexcept
Get the write option.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static void readFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fields, const bool readOldTime)
Read fields and store on the pointer list.
static constexpr int masterNo() noexcept
Relative rank for the master process - is always 0.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
static label commWorld() noexcept
Communicator for all ranks (respecting any local worlds)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< word > wordList
List of word.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
Automatically write from objectRegistry::writeObject()
T * get() noexcept
Return pointer to managed object without nullptr checking.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
static const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
forAllConstIters(mixture.phases(), phase)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.