36 #include "passivePositionParticleCloud.H" 40 template<
class Container>
43 const IOobjectList& objects,
44 const wordRes& selectedFields
49 selectedFields.empty()
50 ? objects.names<Container>()
51 : objects.names<Container>(selectedFields)
65 const mapDistributeBase& map,
67 const IOobjectList& objects,
68 const wordRes& selectedFields
71 typedef IOField<Type> fieldType;
75 filterObjects<fieldType>
86 for (
const word& objectName : fieldNames)
99 Info<<
" Distributing lagrangian " 100 << fieldType::typeName <<
"s\n" <<
nl;
102 Info<<
" " << objectName <<
nl;
112 srcMesh_.time().timeName(),
122 map.distribute(
field);
125 const IOobject fieldIO
128 tgtMesh_.time().timeName(),
138 IOField<Type>(fieldIO, std::move(
field)).
write();
145 const fileName fldName(fieldIO.objectPath());
150 if (nFields && verbose_)
Info<<
endl;
158 const mapDistributeBase& map,
160 const IOobjectList& objects,
161 const wordRes& selectedFields
164 typedef CompactIOField<Field<Type>, Type> fieldType;
166 DynamicList<word> fieldNames;
170 filterObjects<fieldType>
180 filterObjects<IOField<Field<Type>>>
190 for (
const word& objectName : fieldNames)
203 Info<<
" Distributing lagrangian " 204 << fieldType::typeName <<
"s\n" <<
nl;
206 Info<<
" " << objectName <<
nl;
211 CompactIOField<Field<Type>, Type>
field 216 srcMesh_.time().timeName(),
227 map.distribute(
field);
230 const IOobject fieldIO
233 tgtMesh_.time().timeName(),
243 CompactIOField<Field<Type>, Type>
254 const fileName fldName(fieldIO.objectPath());
259 if (nFields && verbose_)
Info<<
endl;
264 template<
class Container>
267 const passivePositionParticleCloud& cloud,
268 const IOobjectList& objects,
269 const wordRes& selectedFields
272 const word fieldClassName(Container::typeName);
276 filterObjects<Container>
284 for (
const word& objectName : fieldNames)
290 Info<<
" Reading lagrangian " 291 << Container::typeName <<
"s\n" <<
nl;
293 Info<<
" " << objectName <<
nl;
298 Container* fieldPtr =
new Container
303 cloud.time().timeName(),
315 if (nFields && verbose_)
Info<<
endl;
320 template<
class Container>
323 const mapDistributeBase& map,
324 passivePositionParticleCloud& cloud
327 HashTable<Container*>
fields 329 cloud.lookupClass<Container>()
337 Container&
field = *(iter.val());
350 Info<<
" Distributing lagrangian " 351 << Container::typeName <<
"s\n" <<
nl;
357 map.distribute(
field);
359 const IOobject fieldIO
362 tgtMesh_.time().timeName(),
372 Container(fieldIO, std::move(
field)).write();
379 const fileName fldName(fieldIO.objectPath());
384 if (nFields && verbose_)
Info<<
endl;
label distributeFields(const mapDistributeBase &map, const word &cloudName, const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected lagrangian fields.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
const word cloudName(propsDict.get< word >("cloud"))
void sort(UList< T > &list)
Sort the list.
Reading is optional [identical to LAZY_READ].
#define forAllIters(container, iter)
Iterate across all elements in the container object.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
label distributeFieldFields(const mapDistributeBase &map, const word &cloudName, const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected lagrangian fieldFields.
static wordList filterObjects(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Pick up any fields of a given type.
List< word > wordList
List of word.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static label readFields(const passivePositionParticleCloud &cloud, const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read and store all fields of a cloud.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Reading is optional [identical to READ_IF_PRESENT].
Request registration (bool: true)
Do not request registration (bool: false)
label distributeStoredFields(const mapDistributeBase &map, passivePositionParticleCloud &cloud) const
Redistribute and write stored lagrangian fields.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
static const word prefix
The prefix to local: lagrangian.