30 template<
class GeoField>
34 const typename GeoField::Mesh&
mesh,
42 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
59 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
65 const bool readOldTime
78 fields.set(i,
new GeoField(fieldObjects[i],
mesh, readOldTime));
83 template<
class Mesh,
class GeoField>
87 const IOobjectList& objects,
92 UPtrList<const IOobject> fieldObjects(objects.sorted<GeoField>());
95 fields.resize(fieldObjects.size());
99 fields.set(i,
new GeoField(fieldObjects[i],
mesh));
104 template<
class BoolListType,
class GeoField,
class MeshSubsetter>
105 void Foam::fieldsDistributor::readFieldsImpl
107 const BoolListType& haveMeshOnProc,
108 const MeshSubsetter* subsetter,
109 const typename GeoField::Mesh&
mesh,
110 IOobjectList& allObjects,
111 PtrList<GeoField>&
fields,
112 const bool deregister
116 IOobjectList objects(allObjects.lookupClass<GeoField>());
128 <<
"Objects not synchronised across processors." <<
nl 136 fields.resize(masterNames.size());
143 HashTable<const GeoField*> other
145 mesh.
thisDb().objectRegistry::template lookupClass<GeoField>()
150 GeoField&
fld =
const_cast<GeoField&
>(*iter.val());
152 if (!
fld.ownedByRegistry())
173 bool decompose =
true;
176 if (haveMeshOnProc.test(proci))
191 const word&
name = masterNames[i];
192 IOobject&
io = *objects[
name];
206 const word&
name = masterNames[i];
207 IOobject&
io = *objects[
name];
221 PtrList<dictionary> fieldDicts;
230 const label nDicts = (subsetter ?
fields.size() : label(0));
234 if (nDicts && subsetter)
241 tmp<GeoField> tsubfld = subsetter->interpolate(
fld);
244 toProcs.beginBlock();
245 toProcs << tsubfld();
262 fromMaster >> fieldDicts;
310 HashTable<const GeoField*> other
312 mesh.
thisDb().objectRegistry::template lookupClass<GeoField>()
317 GeoField&
fld =
const_cast<GeoField&
>(*iter.val());
319 if (!
fld.ownedByRegistry())
328 template<
class GeoField,
class MeshSubsetter>
331 const bitSet& haveMeshOnProc,
332 const MeshSubsetter* subsetter,
333 const typename GeoField::Mesh&
mesh,
334 IOobjectList& allObjects,
335 PtrList<GeoField>&
fields,
336 const bool deregister
352 template<
class GeoField,
class MeshSubsetter>
356 const MeshSubsetter* subsetter,
357 const typename GeoField::Mesh&
mesh,
360 const bool deregister
376 template<
class GeoField,
class MeshSubsetter>
380 const typename GeoField::Mesh&
mesh,
384 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].
Generic GeometricField class.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
const Time & time() const
Return the top-level database.
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
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
Process index of the master (always 0)
label size() const noexcept
The number of elements in the list.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
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
A List of words.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
static bool master(const label communicator=worldComm)
Am I the master rank.
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...
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
Defines the attributes of an object for which implicit objectRegistry management is supported...
forAllConstIters(mixture.phases(), phase)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.