65 auto outIter = list.
begin();
67 for (
const face&
f : faces)
84 auto outIter = list.
begin();
86 for (
const face&
f : faces)
107 auto outIter = list.
begin();
110 for (
const label
cellId : addr)
133 for (
const label
cellId : addr)
140 auto outIter = list.begin();
143 for (
const label
cellId : addr)
145 for (
const label facei : meshCells[
cellId])
147 *outIter = meshFaces[facei].
size();
161 const label pointOffset
164 const label off = (pointOffset + 1);
166 const label nLists = (offsets.
size() - 1);
168 for (label i = 0; i < nLists; ++i)
172 values.slice(offsets[i], (offsets[i+i] - offsets[i]))
174 for (
const label pointi : list)
176 os.
write(pointi + off);
186 const UList<face>& faces,
187 const label pointOffset
198 const label pointOffset
209 const label pointOffset
220 const label pointOffset
238 const auto& owner =
mesh.faceOwner();
246 for (
const label
cellId : addr)
257 CompactListList<label> compact(nFaces,
nPoints);
264 for (
const label
cellId : addr)
268 const face&
f = meshFaces[
faceId];
278 for (label pti =
f.size()-1; pti > 0; --pti)
280 verts[
nPoints++] = pointMap[
f[pti]];
285 for (
const label pointi :
f)
287 verts[
nPoints++] = pointMap[pointi];
306 const polyMesh&
mesh,
314 const auto& owner =
mesh.faceOwner();
316 const label off = (1);
318 for (
const label
cellId : addr)
322 const face&
f = meshFaces[
faceId];
329 os.write(pointMap[
f[0]] + off);
330 for (label pti =
f.size()-1; pti > 0; --pti)
332 os.write(pointMap[
f[pti]] + off);
337 for (
const label pointi :
f)
339 os.write(pointMap[pointi] + off);
358 const label off = (1);
360 for (
const label
cellId : addr)
364 const face&
f = meshFaces[
faceId];
371 os.write(
f[0] + off);
372 for (label pti =
f.size()-1; pti > 0; --pti)
374 os.write(
f[pti] + off);
379 for (
const label pointi :
f)
381 os.write(pointi + off);
394 const ensightFaces::elemType etype,
405 const IntRange<int> senders =
407 (parallel && UPstream::parRun())
408 ? UPstream::subProcs()
412 if (UPstream::master())
419 if (etype == ensightFaces::elemType::NSIDED)
425 if (UPstream::master())
428 os.writeLabels(sizes);
431 for (
int proci : senders)
434 IPstream::recv(
values, proci);
441 OPstream::send(sizes, UPstream::masterNo());
447 if (UPstream::master())
453 for (
int proci : senders)
456 IPstream::recv(
values, proci);
463 OPstream::send(faces, UPstream::masterNo());
471 const ensightFaces::elemType etype,
473 const UIndirectList<face>& faces,
482 const IntRange<int> senders =
484 (parallel && UPstream::parRun())
485 ? UPstream::subProcs()
489 if (UPstream::master())
496 if (etype == ensightFaces::elemType::NSIDED)
502 if (UPstream::master())
505 os.writeLabels(send);
508 for (
int proci : senders)
511 IPstream::recv(
values, proci);
518 OPstream::send(send, UPstream::masterNo());
525 if (UPstream::master())
531 for (
int proci : senders)
534 IPstream::recv(
values, proci);
541 OPstream::send(faces, UPstream::masterNo());
549 const ensightFaces& part,
554 for (
int typei = 0; typei < ensightFaces::nTypes; ++typei)
556 const auto etype = ensightFaces::elemType(typei);
563 UIndirectList<face>(faces, part.faceIds(etype)),
573 const ensightFaces& part,
578 for (
int typei = 0; typei < ensightFaces::nTypes; ++typei)
580 const auto etype = ensightFaces::elemType(typei);
587 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.
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.
CompactListList< label > getPolysFacePoints(const polyMesh &mesh, const labelUList &addr, const labelUList &pointMap)
Generate 0-based point ids for each poly element face.
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.
constexpr auto key(const Type &t) noexcept
Helper function to return the enum value.
virtual bool write(const token &) override
Writing token does not make sense.
void newline()
Add carriage return to ascii stream.
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.
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.