Go to the documentation of this file.
33 template<
template<
typename>
class FieldContainer,
class Type>
37 const FieldContainer<Type>&
input,
41 res.resize(
input.size());
43 auto iter = res.begin();
45 for (
const Type& val :
input)
53 template<
template<
typename>
class FieldContainer>
60 const FieldContainer<Foam::point>&
fld,
64 parallel = parallel && Pstream::parRun();
79 if (Pstream::master())
84 for (
direction cmpt=0; cmpt < point::nComponents; ++cmpt)
91 for (
const int proci : senders)
93 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
104 for (
direction cmpt=0; cmpt < point::nComponents; ++cmpt)
110 Pstream::commsTypes::scheduled,
122 template<
template<
typename>
class FieldContainer,
class Type>
127 const FieldContainer<Type>&
fld,
131 parallel = parallel && Pstream::parRun();
136 ? Pstream::subProcs()
143 bool hasField = !
fld.empty();
151 if (!hasField)
return false;
160 if (Pstream::master())
164 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
173 for (
const int proci : senders)
175 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
186 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
194 Pstream::commsTypes::scheduled,
215 parallel = parallel && Pstream::parRun();
220 if (parallel ? !part.
total() : !part.
size())
return false;
222 bool hasField = !
fld.empty();
230 if (!hasField)
return false;
234 if (Pstream::master())
241 for (
int typei=0; typei < ensightFaces::nTypes; ++typei)
248 ensightFaces::key(etype),
267 parallel = parallel && Pstream::parRun();
272 if (parallel ? !part.
total() : !part.
size())
return false;
274 bool hasField = !
fld.empty();
282 if (!hasField)
return false;
285 if (Pstream::master())
290 for (
int typei=0; typei < ensightCells::nTypes; ++typei)
297 ensightCells::key(etype),
316 parallel = parallel && Pstream::parRun();
321 if (parallel ? !part.
total() : !part.
size())
return false;
323 bool hasField = !
fld.empty();
331 if (!hasField)
return false;
335 if (Pstream::master())
340 for (
int typei=0; typei < ensightFaces::nTypes; ++typei)
347 ensightFaces::key(etype),
label index() const
The index in a list (0-based)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
void beginPart(const label index, const string &description)
Begin a "part" (0-based index), with a description.
An interval of (signed) integers defined by a start and a size.
Output inter-processor communications stream.
bool writeFieldComponents(ensightFile &os, const char *key, const FieldContainer< Type > &fld, bool parallel)
Write field content (component-wise) for the given ensight element type.
void beginCoordinates(const label npoints)
Begin a "coordinates" block.
Sorting/classification of faces (2D) into corresponding ensight types.
labelRange range(const elemType etype) const
Processor-local offset/size of element type.
virtual Ostream & writeKeyword(const keyType &key)
label total() const
The global size of all element types.
SubField is a Field obtained as a section of another Field.
Conversion of OpenFOAM pTraits into the Ensight equivalent.
Specialized Ensight output with extra geometry file header.
label total() const
The global size of all element types.
const labelList & cellIds() const
Processor-local cell ids of all elements.
Sorting/classification of cells (3D) into corresponding ensight element types.
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))
bool writeFaceSubField(ensightFile &os, const Field< Type > &fld, const ensightFaces &part, bool parallel)
reduce(hasMovingMesh, orOp< bool >())
const labelList & faceIds() const
Processor-local face ids of all elements.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
label size(const elemType etype) const
Processor-local size of the specified element type.
elemType
Supported ensight 'Cell' element types.
elemType
Supported ensight 'Face' element types.
void copyComponent(scalarField &res, const FieldContainer< Type > &input, const direction cmpt)
Copy specified field component into a scalarField.
bool writeField(ensightFile &os, const Field< Type > &fld, const ensightCells &part, bool parallel)
static Istream & input(Istream &is, IntRange< T > &range)
void beginPart(const label index)
Begin a part (0-based index internally).
A List with indirect addressing.
Input inter-processor communications stream.
void writeList(const UList< label > &field)
Write a list of integers as float values.
bool writeCoordinates(ensightGeoFile &os, const label partId, const word &partName, const label nPoints, const FieldContainer< Foam::point > &fld, bool parallel)
Write coordinates (component-wise) for the given part.
label size(const elemType etype) const
Processor-local size of the specified element type.