38#ifndef Foam_ensightOutput_H
39#define Foam_ensightOutput_H
67template<
class T,
class Addr,
class AccessOp>
75 auto out = output.
begin();
77 for (
const T& sub : lists)
79 *out = aop(sub).size();
89template<
class IntListType>
96 for (
auto& sub : lists)
98 for (
auto& item : sub)
102 item = oldToNew[item];
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,
362 const label pointOffset
367template<
class LabelListListType>
371 const LabelListListType& listOfLists,
372 const label pointOffset
378template<
template<
typename>
class FieldContainer,
class Type>
382 const FieldContainer<Type>& input,
395template<
template<
typename>
class FieldContainer>
405 const word& partName,
411 const FieldContainer<Foam::point>&
fld,
419template<
template<
typename>
class FieldContainer,
class Type>
432 const FieldContainer<Type>&
fld,
439template<
template<
typename>
class FieldContainer,
class Type>
449 const FieldContainer<Type>&
fld,
560 #include "ensightOutput.txx"
Various functions to operate on Lists.
Forwards for various types of cell lists.
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A packed storage of objects of type <T> using an offset table for access.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
label size() const noexcept
The number of elements in the list.
A List with indirect addressing. Like IndirectList but does not store addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
An analytical geometric cellShape.
Sorting/classification of cells (3D) into corresponding ensight element types.
Sorting/classification of faces (2D) into corresponding ensight types.
elemType
Supported ensight 'Face' element types.
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Forwards for various types of face lists.
Implementation details for various OpenFOAM classes.
Various utility functions to work on Lists of Lists (usually resulting from 'gather'ing and combining...
labelList subSizes(const IndirectListBase< T, Addr > &lists, AccessOp aop)
Return the sizes of the sub-lists.
void inplaceRenumber(const labelUList &oldToNew, IntListType &lists)
Inplace renumber the values (not the indices) of a list of lists.
Implementation details and output backends that would not normally be called directly by a user.
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 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.
labelList getFaceSizes(const UList< face > &faces)
Return sizes of faces in the list.
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.
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.
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....
labelList getPolysNFaces(const polyMesh &mesh, const labelUList &addr)
The number of faces per poly element.
CompactListList< label > getPolysFacePoints(const polyMesh &mesh, const labelUList &addr, const labelList &pointMap)
Generate 0-based point ids for each poly element face.
void writeLabelListList(ensightGeoFile &os, const labelUList &offsets, const labelUList &values, const label pointOffset)
Write CompactListList<label> by components.
A collection of functions for writing ensight file content.
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.
void writePolysPoints(ensightGeoFile &os, const cellUList &meshCells, const labelUList &addr, const faceUList &meshFaces, const labelUList &faceOwner)
Write the point ids per poly element.
void writeFaceConnectivityPresorted(ensightGeoFile &os, const ensightFaces &part, const faceUList &faces, bool parallel)
Write the presorted face connectivity for the part.
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.
void writeCellShapes(ensightGeoFile &os, const UList< cellShape > &shapes, const label pointOffset=0)
Write cell connectivity via cell shapes.
void writeFaceList(ensightGeoFile &os, const UList< face > &faces, const label pointOffset=0)
Write list of faces.
DynamicList< float > floatBufferType
The list type used for component-wise buffering.
UList< cell > cellUList
UList of cell.
List< label > labelList
A List of labels.
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
UList< face > faceUList
UList of faces.