Go to the documentation of this file.
33 template<
template<
typename>
class FieldContainer,
class Type>
37 const FieldContainer<Type>&
fld,
45 parallel = parallel && Pstream::parRun();
47 bool hasField = !
fld.empty();
55 if (!hasField)
return false;
61 if (Pstream::master())
68 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
79 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
85 for (
int slave=1; slave<Pstream::nProcs(); ++slave)
87 IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
98 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
104 Pstream::commsTypes::scheduled,
109 <<
fld.component(cmpt);
129 parallel = parallel && Pstream::parRun();
131 bool hasGeom = (parallel ? part.
total() : part.
size());
132 bool hasField = !
fld.empty();
141 if (!hasGeom || !hasField)
return false;
147 if (Pstream::master())
152 for (
int typei=0; typei < ensightFaces::nTypes; ++typei)
158 ensightFaces::key(what),
181 parallel = parallel && Pstream::parRun();
183 bool hasGeom = (parallel ? part.
total() : part.
size());
184 bool hasField = !
fld.empty();
193 if (!hasGeom || !hasField)
return false;
199 if (Pstream::master())
206 for (
int typei=0; typei < ensightFaces::nTypes; ++typei)
214 ensightFaces::key(what),
238 bool parallel =
false && Pstream::parRun();
240 bool hasGeom = (parallel ? part.
total() : part.
size());
241 bool hasField = !
fld.empty();
250 if (!hasGeom || !hasField)
return false;
256 if (Pstream::master())
285 parallel = parallel && Pstream::parRun();
287 bool hasGeom = (parallel ? part.
total() : part.
size());
288 bool hasField = !
fld.empty();
297 if (!hasGeom || !hasField)
return false;
303 if (Pstream::master())
308 for (
int typei=0; typei < ensightCells::nTypes; ++typei)
314 ensightCells::key(what),
Output inter-processor communications stream.
label index() const
The index in a list.
bool writeFieldComponents(const char *key, const FieldContainer< Type > &fld, ensightFile &os, bool parallel)
Write field content (component-wise) for the given ensight element type.
Sorting/classification of faces (2D) into corresponding ensight types.
const labelUList cellIds(const enum elemType) const
Return the (local) cell ids of the specified element type.
bool writeCellField(const Field< Type > &fld, const ensightCells &part, ensightFile &os, bool parallel)
virtual Ostream & writeKeyword(const keyType &key)
Write element keyword with trailing newline, optionally with undef.
label total() const
The global number of all element types.
SubField is a Field obtained as a section of another Field.
Conversion of OpenFOAM pTraits into the Ensight equivalent.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool writePointField(const Field< Type > &fld, const ensightFaces &part, ensightFile &os)
Write a field of point (node) values (already compacted?)
Sorting/classification of cells (3D) into corresponding ensight element types.
const labelUList faceIds(const enum elemType) const
Return the (local) face ids of the specified element type.
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))
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
label size() const
The processor local size of all elements.
elemType
Addressable ensight element types.
elemType
Addressable ensight element types.
label index() const
The index in a list.
label ListType::const_reference const label start
void beginPart(const label index)
Begin a part (0-based index internally).
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
bool writeFaceField(const Field< Type > &fld, const ensightFaces &part, ensightFile &os, bool parallel)
Input inter-processor communications stream.
void writeList(const UList< label > &field)
Write a list of integers as float values.
label size() const
The processor local size of all elements.
label total(const enum elemType) const
The global number of the specified element type.
bool writeFaceSubField(const Field< Type > &fld, const ensightFaces &part, ensightFile &os, bool parallel)