38 template<
class GeoField>
39 void Foam::parFaFieldDistributorCache::redistributeAndWrite
41 const faMeshDistributor& distributor,
43 const bool isWriteProc
48 tmp<GeoField> tfld = distributor.distributeField(
fld);
62 const Time& baseRunTime,
63 const fileName& proc0CaseName,
67 refPtr<fileOperation>& readHandler,
68 const fileName& areaMeshInstance,
75 autoPtr<faMeshSubset> subsetterPtr;
78 if (areaMeshOnProc.found(
false))
85 subsetterPtr.reset(
new faMeshSubset(
mesh, zero{}));
91 auto& obr =
const_cast<objectRegistry&
> 93 subsetterPtr->subMesh().thisDb()
96 obr.checkOut(faMesh::typeName);
97 obr.checkOut(
"faBoundaryMesh");
98 obr.checkOut(
"faSchemes");
99 obr.checkOut(
"faSolution");
109 IOobjectList objects;
130 <<
" have objects:" << objects.names() <<
endl;
139 #undef doFieldReading 140 #define doFieldReading(Storage) \ 141 fieldsDistributor::readFields \ 143 areaMeshOnProc, readHandler, mesh, subsetterPtr, objects, \ 149 doFieldReading(scalarAreaFields_);
150 doFieldReading(vectorAreaFields_);
151 doFieldReading(sphericalTensorAreaFields_);
152 doFieldReading(symmTensorAreaFields_);
153 doFieldReading(tensorAreaFields_);
156 doFieldReading(scalarEdgeFields_);
157 doFieldReading(vectorEdgeFields_);
158 doFieldReading(tensorEdgeFields_);
159 doFieldReading(sphericalTensorEdgeFields_);
160 doFieldReading(symmTensorEdgeFields_);
161 #undef doFieldReading 165 void Foam::parFaFieldDistributorCache::redistributeAndWrite
167 const faMeshDistributor& distributor,
168 const bool isWriteProc
171 redistributeAndWrite(distributor, scalarAreaFields_, isWriteProc);
172 redistributeAndWrite(distributor, vectorAreaFields_, isWriteProc);
173 redistributeAndWrite(distributor, sphericalTensorAreaFields_, isWriteProc);
174 redistributeAndWrite(distributor, symmTensorAreaFields_, isWriteProc);
175 redistributeAndWrite(distributor, tensorAreaFields_, isWriteProc);
177 redistributeAndWrite(distributor, scalarEdgeFields_, isWriteProc);
178 redistributeAndWrite(distributor, vectorEdgeFields_, isWriteProc);
179 redistributeAndWrite(distributor, sphericalTensorEdgeFields_, isWriteProc);
180 redistributeAndWrite(distributor, symmTensorEdgeFields_, isWriteProc);
181 redistributeAndWrite(distributor, tensorEdgeFields_, isWriteProc);
const fileName & caseName() const noexcept
Return case 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()
const Time & time() const
Return the top-level database.
bool processorCase() const noexcept
True if this is a processor case.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
static int cacheLevel() noexcept
Return cache level.
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))
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
fileName objectRelPath() const
The object path relative to the root.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
void read(const Time &baseRunTime, const fileName &proc0CaseName, const bool decompose, const boolList &areaMeshOnProc, refPtr< fileOperation > &readHandler, const fileName &areaMeshInstance, faMesh &mesh)
Read distributed fields.
List< bool > boolList
A List of bools.