64 auto outIter = list.
begin();
66 for (
const face&
f : faces)
83 auto outIter = list.
begin();
85 for (
const face&
f : faces)
106 auto outIter = list.
begin();
109 for (
const label
cellId : addr)
132 for (
const label
cellId : addr)
139 auto outIter = list.begin();
142 for (
const label
cellId : addr)
144 for (
const label facei : meshCells[
cellId])
146 *outIter = meshFaces[facei].
size();
160 const label pointOffset
163 const label off = (pointOffset + 1);
165 const label nLists = (offsets.
size() - 1);
167 for (label i = 0; i < nLists; ++i)
171 values.slice(offsets[i], (offsets[i+i] - offsets[i]))
173 for (
const label pointi : list)
175 os.write(pointi + off);
185 const UList<face>& faces,
186 const label pointOffset
197 const label pointOffset
208 const label pointOffset
219 const label pointOffset
245 for (
const label
cellId : addr)
256 CompactListList<label> compact(nFaces,
nPoints);
263 for (
const label
cellId : addr)
267 const face&
f = meshFaces[
faceId];
277 for (label pti =
f.size()-1; pti > 0; --pti)
279 verts[
nPoints++] = pointMap[
f[pti]];
284 for (
const label pointi :
f)
286 verts[
nPoints++] = pointMap[pointi];
305 const polyMesh&
mesh,
315 const label off = (1);
317 for (
const label
cellId : addr)
321 const face&
f = meshFaces[
faceId];
328 os.write(pointMap[
f[0]] + off);
329 for (label pti =
f.size()-1; pti > 0; --pti)
331 os.write(pointMap[
f[pti]] + off);
336 for (
const label pointi :
f)
338 os.write(pointMap[pointi] + off);
357 const label off = (1);
359 for (
const label
cellId : addr)
363 const face&
f = meshFaces[
faceId];
370 os.write(
f[0] + off);
371 for (label pti =
f.size()-1; pti > 0; --pti)
373 os.write(
f[pti] + off);
378 for (
const label pointi :
f)
380 os.write(pointi + off);
393 const ensightFaces::elemType etype,
404 parallel = parallel && Pstream::parRun();
406 const IntRange<int> senders =
409 ? Pstream::subProcs()
413 if (Pstream::master())
420 if (etype == ensightFaces::elemType::NSIDED)
426 if (Pstream::master())
429 os.writeLabels(send);
432 for (
const int proci : senders)
434 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
437 os.writeLabels(recv);
444 Pstream::commsTypes::scheduled,
454 if (Pstream::master())
460 for (
const int proci : senders)
462 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
463 List<face> recv(fromOther);
472 Pstream::commsTypes::scheduled,
484 const ensightFaces::elemType etype,
486 const UIndirectList<face>& faces,
495 parallel = parallel && Pstream::parRun();
497 const IntRange<int> senders =
500 ? Pstream::subProcs()
505 if (Pstream::master())
512 if (etype == ensightFaces::elemType::NSIDED)
518 if (Pstream::master())
521 os.writeLabels(send);
524 for (
const int proci : senders)
526 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
529 os.writeLabels(recv);
536 Pstream::commsTypes::scheduled,
547 if (Pstream::master())
553 for (
const int proci : senders)
555 IPstream fromOther(Pstream::commsTypes::scheduled, proci);
556 List<face> recv(fromOther);
565 Pstream::commsTypes::scheduled,
577 const ensightFaces& part,
582 for (label typei=0; typei < ensightFaces::nTypes; ++typei)
584 const auto etype = ensightFaces::elemType(typei);
591 UIndirectList<face>(faces, part.faceIds(etype)),
601 const ensightFaces& part,
606 for (label typei=0; typei < ensightFaces::nTypes; ++typei)
608 const auto etype = ensightFaces::elemType(typei);
615 SubList<face>(faces, part.range(etype)),
void size(const label n)
Older name for setAddressableSize.
registerDebugSwitchWithName(Foam::ensightOutput, ensightOutput, "ensight")
List< cell > cellList
List of cell.
A face is a list of labels corresponding to mesh vertices.
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.
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information...
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.
void writeFaceConnectivityPresorted(ensightGeoFile &os, const ensightFaces &part, const faceUList &faces, bool parallel)
Write the presorted face connectivity for the part.
labelList getPolysNPointsPerFace(const polyMesh &mesh, const labelUList &addr)
The number of points for each face of the poly elements.
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.
List< face > faceList
List of faces.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
UList< cell > cellUList
UList of cell.
UList< face > faceUList
UList of faces.
registerOptSwitch("ensight.maxChunk", int, Foam::ensightOutput::maxChunk_)
label size() const noexcept
The number of elements in the list.
A collection of functions for writing ensight file content.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
A packed storage of objects of type <T> using an offset table for access.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
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)
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
Macro definitions for debug switches.
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. ...
Mesh consisting of general polyhedral cells.
int maxChunk_
Upper limit on number of items for bundled off-processor field transfers. The component-wise transfer...
List< label > labelList
A List of labels.
defineDebugSwitchWithName(Foam::ensightOutput, "ensight", 0)
void writeCellShapes(ensightGeoFile &os, const UList< cellShape > &shapes, const label pointOffset=0)
Write cell connectivity via cell shapes.