49 bool parallel = Pstream::parRun();
59 for (
const label zoneId : cellZoneParts.
sortedToc())
72 if (patchId < 0 || patchId >=
pbm.size())
101 if (faceZoneParts.
empty())
122 if (isA<processorPolyPatch>(
pp))
127 slice = (0.5 * (pfld.patchInternalField() + pfld));
129 else if (!isA<emptyPolyPatch>(
pp))
142 const auto& sfld = tsfld();
150 maxLen =
max(maxLen, iter.val().size());
159 for (
const label zoneId : faceZoneParts.
sortedToc())
171 auto valIter =
values.begin();
206 bool parallel = Pstream::parRun();
217 for (
const label zoneId : cellZoneParts.
sortedToc())
224 if (Pstream::master())
234 : uniquePointLabels.
empty()
256 const ensightFaces& part = boundaryParts[
patchId];
259 part.uniqueMeshPoints(
mesh, uniquePointLabels, parallel);
261 if (Pstream::master())
263 os.beginPart(part.index());
271 : uniquePointLabels.empty()
280 const auto* vpp = isA<Field<Type>>(bfld);
290 for (label& pointi : uniquePointLabels)
292 pointi =
pp.meshPointMap()[pointi];
300 UIndirectList<Type>(*vpp, uniquePointLabels),
320 for (
const label zoneId : faceZoneParts.
sortedToc())
322 const ensightFaces& part = faceZoneParts[zoneId];
325 part.uniqueMeshPoints(
mesh, uniquePointLabels, parallel);
327 if (Pstream::master())
329 os.beginPart(part.index());
337 : uniquePointLabels.empty()
369 const bool nodeValues
378 pfld.
ref().checkOut();
379 pfld.ref().rename(vf.
name());
381 return ensightOutput::writePointField<Type>(scratch,
os, pfld, ensMesh);
384 return ensightOutput::writeVolField<Type>(scratch,
os, vf, ensMesh);
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
const polyBoundaryMesh & pbm
label uniqueMeshPoints(const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
Globally unique mesh points. Required when writing point fields.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > linearInterpolate(const GeometricField< Type, fvPatchField, volMesh > &vf)
const word & name() const noexcept
Return the object name.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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...
Generic GeometricField class.
A collection of functions for writing volField content in ensight format.
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.
const polyMesh & mesh() const noexcept
Reference to the underlying polyMesh.
#define forAll(list, i)
Loop across all elements in list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
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.
Generic templated field type.
label size(const elemType etype) const
Processor-local size of the specified element type.
Sorting/classification of cells (3D) into corresponding ensight element types.
const Map< ensightFaces > & boundaryParts() const noexcept
Face elements per selected patch, lookup by patch index.
const Map< ensightFaces > & faceZoneParts() const noexcept
Face elements per faceZone, lookup by zone index.
const Map< ensightCells > & cellZoneParts() const noexcept
Face elements per selected patch, lookup by patch index.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const labelList & faceIds() const noexcept
Processor-local face ids of all elements.
const Mesh & mesh() const noexcept
Return mesh.
bool empty() const noexcept
True if the hash table is empty.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones, facesZone, patches.
OBJstream os(runTime.globalPath()/outputName)
void decrFaceIds(const label off)
Decrease face ids by specified offset value.
label index() const noexcept
The index in a list (0-based)
PtrList< coordinateSystem > coordinates(solidRegions.size())
Mesh data needed to do the Finite Volume discretisation.
List< label > sortedToc() const
The table of contents (the keys) in sorted order.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
bool writePointField(ensightOutput::floatBufferType &scratch, ensightFile &os, const GeometricField< Type, pointPatchField, pointMesh > &pf, const ensightMesh &ensMesh)
Write point field component-wise.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
forAllConstIters(mixture.phases(), phase)
A HashTable to objects of type <T> with a label key.
static constexpr const zero Zero
Global zero (0)
bool writeVolField(ensightOutput::floatBufferType &scratch, ensightFile &os, const GeometricField< Type, fvPatchField, volMesh > &vf, const ensightMesh &ensMesh)
Write volume field component-wise.