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_null(fieldObjects.size());
75 fields.emplace_set(i, fieldObjects[i],
mesh, readOldTime);
80 template<
class Mesh,
class GeoField>
84 const IOobjectList& objects,
89 const UPtrList<const IOobject> fieldObjects(objects.csorted<GeoField>());
92 fields.resize_null(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: " 163 fields.resize_null(masterNames.size());
173 :
mesh.
thisDb().objectRegistry::template csorted<GeoField>()
176 if (!
fld.ownedByRegistry())
178 const_cast<GeoField&
>(
fld).checkOut();
189 bool decompose =
true;
194 if (haveMeshOnProc.test(proci))
210 const word&
name = masterNames[i];
211 IOobject&
io = *objects[
name];
228 ? readHandlerPtr->good()
234 refPtr<fileOperation> oldHandler;
245 const word&
name = masterNames[i];
246 IOobject&
io = *objects[
name];
265 PtrList<dictionary> fieldDicts;
274 const label nDicts = (subsetter ?
fields.size() : label(0));
278 if (nDicts && subsetter)
285 tmp<GeoField> tsubfld = subsetter->interpolate(
fld);
288 toProcs.beginBlock();
289 toProcs << tsubfld();
306 fromMaster >> fieldDicts;
328 noreadIO.resetHeader(masterNames[i]);
330 fields.emplace_set(i, noreadIO,
mesh, fieldDicts[i]);
353 :
mesh.
thisDb().objectRegistry::template csorted<GeoField>()
356 if (!
fld.ownedByRegistry())
358 const_cast<GeoField&
>(
fld).checkOut();
365 template<
class GeoField,
class MeshSubsetter>
368 const bitSet& haveMeshOnProc,
369 const MeshSubsetter* subsetter,
370 const typename GeoField::Mesh&
mesh,
371 IOobjectList& allObjects,
372 PtrList<GeoField>&
fields,
373 const bool deregister
390 template<
class GeoField,
class MeshSubsetter>
394 const MeshSubsetter* subsetter,
395 const typename GeoField::Mesh&
mesh,
398 const bool deregister
415 template<
class GeoField,
class MeshSubsetter>
419 const typename GeoField::Mesh&
mesh,
423 const bool deregister
440 template<
class GeoField,
class MeshSubsetter>
445 const typename GeoField::Mesh&
mesh,
449 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.
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 communicator ranks. Does nothing in non-paral...
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 expressions::valueTypeCode::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.
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 a time name for the given scalar time value 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...
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
Request registration (bool: true)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.