38 #ifndef Foam_ensightOutput_H 39 #define Foam_ensightOutput_H 67 template<
class T,
class Addr,
class AccessOp>
77 for (
const T& sub : lists)
79 *out = aop(sub).size();
89 template<
class IntListType>
96 for (
auto& sub : lists)
98 for (
auto& item : sub)
102 item = oldToNew[item];
121 namespace ensightOutput
132 const UList<face>& faces,
133 const label pointOffset = 0
140 const UIndirectList<face>& faces,
141 const label pointOffset = 0
148 const CompactListList<label>& faces,
149 const label pointOffset = 0
156 const UList<cellShape>& shapes,
157 const label pointOffset = 0
176 const polyMesh&
mesh,
189 const UIndirectList<face>& faces,
211 const ensightFaces& part,
224 const ensightFaces& part,
247 const Field<Type>&
fld,
250 const ensightCells& part,
268 const Field<Type>&
fld,
271 const ensightFaces& part,
287 const Field<Type>&
fld,
290 const ensightCells& part,
310 const Field<Type>&
fld,
362 const label pointOffset
367 template<
class LabelListListType>
371 const LabelListListType& listOfLists,
372 const label pointOffset
378 template<
template<
typename>
class FieldContainer,
class Type>
382 const FieldContainer<Type>&
input,
395 template<
template<
typename>
class FieldContainer>
405 const word& partName,
411 const FieldContainer<Foam::point>&
fld,
419 template<
template<
typename>
class FieldContainer,
class Type>
432 const FieldContainer<Type>&
fld,
439 template<
template<
typename>
class FieldContainer,
class Type>
449 const FieldContainer<Type>&
fld,
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
void writeFaceConnectivity(ensightGeoFile &os, const ensightFaces::elemType etype, const label nTotal, const UIndirectList< face > &faces, bool parallel)
Write the regular face connectivity for specified type and and specified faces.
Specialized Ensight output with extra geometry file header.
Sorting/classification of faces (2D) into corresponding ensight types.
bool writeFaceSubField(ensightOutput::floatBufferType &scratch, ensightFile &os, const Field< Type > &fld, const ensightFaces &part, bool parallel)
Write a sub-field of faces values as an indirect list, using the sub-list sizing information from ens...
void writeFaceConnectivityPresorted(ensightGeoFile &os, const ensightFaces &part, const faceUList &faces, bool parallel)
Write the presorted face connectivity for the part.
bool writeFaceLocalField(ensightOutput::floatBufferType &scratch, ensightFile &os, const Field< Type > &fld, const ensightFaces &part, bool parallel)
Write a field of faces values as an indirect list, using the face order from ensightFaces.
labelList getPolysNPointsPerFace(const polyMesh &mesh, const labelUList &addr)
The number of points for each face of the poly elements.
bool writeField(ensightOutput::floatBufferType &scratch, ensightFile &os, const Field< Type > &fld, const ensightCells &part, bool parallel)
Write a field of cell values as an indirect list, using the cell ids from ensightCells.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
void writeFaceList(ensightGeoFile &os, const UList< face > &faces, const label pointOffset=0)
Write list of faces.
UList< label > labelUList
A UList of labels.
Various functions to operate on Lists.
CompactListList< label > getPolysFacePoints(const polyMesh &mesh, const labelUList &addr, const labelList &pointMap)
Generate 0-based point ids for each poly element face.
void inplaceRenumber(const labelUList &oldToNew, IntListType &lists)
Inplace renumber the values (not the indices) of a list of lists.
Forwards for various types of cell lists.
void copyComponent(const FieldContainer< Type > &input, const direction cmpt, UList< float > &cmptBuffer)
Copy specified field component into a scalar buffer. Works for various lists types. Must be adequately sized before calling.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
labelList subSizes(const IndirectListBase< T, Addr > &lists, AccessOp aop)
Return the sizes of the sub-lists.
UList< cell > cellUList
UList of cell.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void writeFieldComponents(ensightOutput::floatBufferType &scratch, ensightFile &os, const char *key, const FieldContainer< Type > &fld, bool parallel)
Write field content (component-wise) for the given ensight element type.
UList< face > faceUList
UList of faces.
Generic templated field type.
A class for handling words, derived from Foam::string.
static Istream & input(Istream &is, IntRange< T > &range)
label size() const noexcept
The number of elements in the list.
DynamicList< float > floatBufferType
The list type used for component-wise buffering.
A packed storage unstructured matrix of objects of type <T> using an offset table for access...
void writePolysPoints(ensightGeoFile &os, const cellUList &meshCells, const labelUList &addr, const faceUList &meshFaces, const labelUList &faceOwner)
Write the point ids per poly element.
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
elemType
Supported ensight 'Face' 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))
Forwards for various types of face lists.
labelList getPolysNFaces(const polyMesh &mesh, const labelUList &addr)
The number of faces per poly element.
void writeLabelListList(ensightGeoFile &os, const labelUList &offsets, const labelUList &values, const label pointOffset)
Write CompactListList<label> by components.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
labelList getFaceSizes(const UList< face > &faces)
Return sizes of faces in the list.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
static Ostream & output(Ostream &os, const IntRange< T > &range)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
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.
void writeCellShapes(ensightGeoFile &os, const UList< cellShape > &shapes, const label pointOffset=0)
Write cell connectivity via cell shapes.