49 bool parallel = Pstream::parRun();
59 for (
const label zoneId : cellZoneParts.
sortedToc())
72 if (patchId < 0 || patchId >= bmesh.
size())
101 if (faceZoneParts.
empty())
118 if (isA<processorFvPatch>(bm[patchi]))
128 ) = (0.5 * (bf.patchInternalField() + bf));
130 else if (!isA<emptyFvPatch>(bm[patchi]))
148 const auto& sfld = tsfld();
156 maxLen =
max(maxLen, iter.val().size());
165 for (
const label zoneId : faceZoneParts.
sortedToc())
177 auto valIter =
values.begin();
212 bool parallel = Pstream::parRun();
223 for (
const label zoneId : cellZoneParts.
sortedToc())
230 if (Pstream::master())
240 : uniquePointLabels.
empty()
262 const ensightFaces& part = boundaryParts[
patchId];
265 part.uniqueMeshPoints(
mesh, uniquePointLabels, parallel);
267 if (Pstream::master())
269 os.beginPart(part.index());
277 : uniquePointLabels.empty()
286 const auto* vpp = isA<Field<Type>>(bfld);
296 for (label& pointi : uniquePointLabels)
298 pointi =
pp.meshPointMap()[pointi];
306 UIndirectList<Type>(*vpp, uniquePointLabels),
326 for (
const label zoneId : faceZoneParts.
sortedToc())
328 const ensightFaces& part = faceZoneParts[zoneId];
331 part.uniqueMeshPoints(
mesh, uniquePointLabels, parallel);
333 if (Pstream::master())
335 os.beginPart(part.index());
343 : uniquePointLabels.empty()
375 const bool nodeValues
384 pfld.
ref().checkOut();
385 pfld.ref().rename(vf.
name());
387 return ensightOutput::writePointField<Type>(scratch,
os, pfld, ensMesh);
390 return ensightOutput::writeVolField<Type>(scratch,
os, vf, ensMesh);
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
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.
label start() const noexcept
The start label of boundary faces in the polyMesh face list.
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.
label size() const noexcept
The number of entries in the list.
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. ...
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.