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)
137 labelList list(nTotFaces);
139 auto outIter = list.begin();
142 for (
const label
cellId : addr)
144 for (
const label facei : meshCells[
cellId])
146 *outIter = meshFaces[facei].
size();
158 const labelUList& offsets,
159 const labelUList& values,
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)
169 const labelUList list
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);
257 labelList& offsets = compact.offsets();
258 labelList& verts = compact.values();
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,
306 const labelUList& addr,
307 const labelList& pointMap
311 const cellList& meshCells = manifoldCellsMeshObject::New(
mesh).cells();
312 const faceList& meshFaces =
mesh.faces();
313 const labelList& owner =
mesh.faceOwner();
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);
351 const cellUList& meshCells,
352 const labelUList& addr,
353 const faceUList& meshFaces,
354 const labelUList& owner
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,
395 const faceUList& faces,
404 parallel = parallel && Pstream::parRun();
406 const IntRange<int> senders =
409 ? Pstream::subProcs()
413 if (Pstream::master())
415 os.writeKeyword(ensightFaces::key(etype));
420 if (etype == ensightFaces::elemType::NSIDED)
424 labelList send(ensightOutput::Detail::getFaceSizes(faces));
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())
507 os.writeKeyword(ensightFaces::key(etype));
512 if (etype == ensightFaces::elemType::NSIDED)
516 labelList send(ensightOutput::Detail::getFaceSizes(faces));
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,
578 const faceUList& faces,
582 for (label typei=0; typei < ensightFaces::nTypes; ++typei)
584 const auto etype = ensightFaces::elemType(typei);
586 writeFaceConnectivity
601 const ensightFaces& part,
602 const faceUList& faces,
606 for (label typei=0; typei < ensightFaces::nTypes; ++typei)
608 const auto etype = ensightFaces::elemType(typei);
610 writeFaceConnectivity
615 SubList<face>(faces, part.range(etype)),
Various functions to operate on Lists.
A packed storage of objects of type <T> using an offset table for access.
const labelList & offsets() const noexcept
Return the offset table (= size()+1).
const List< T > & values() const noexcept
Return the packed values.
Input inter-processor communications stream.
label size() const noexcept
The number of elements in the list.
An interval of (signed) integers defined by a start and a size.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static FOAM_NO_DANGLING_REFERENCE const manifoldCellsMeshObject & New(const polyMesh &mesh, Args &&... args)
Output inter-processor communications stream.
A non-owning sub-view of a List (allocated or unallocated storage).
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.
void size(const label n)
Older name for setAddressableSize.
@ scheduled
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
static constexpr int masterNo() noexcept
Relative rank for the master process - is always 0.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
Sorting/classification of faces (2D) into corresponding ensight types.
labelRange range(const elemType etype) const
Processor-local offset/size of element type.
static const char * key(const elemType etype) noexcept
The ensight element name for the specified 'Face' type.
const labelList & faceIds() const noexcept
Processor-local face ids of all elements.
label total() const noexcept
Same as totalSize.
static constexpr int nTypes
Number of 'Face' element types (3).
elemType
Supported ensight 'Face' element types.
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information.
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
Macro definitions for debug switches.
#define registerDebugSwitchWithName(Type, Tag, Name)
Define the debug information, lookup as Name.
#define defineDebugSwitchWithName(Type, Name, Value)
Define the debug information, lookup as Name.
OBJstream os(runTime.globalPath()/outputName)
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
labelList getFaceSizes(const UList< face > &faces)
Return sizes of faces in the list.
labelList getPolysNPointsPerFace(const polyMesh &mesh, const labelUList &addr)
The number of points for each face of the poly elements.
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.
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.
int maxChunk_
Upper limit on number of items for bundled off-processor field transfers. The component-wise transfer...
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.
UList< cell > cellUList
UList of cell.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
List< cell > cellList
List of cell.
UList< label > labelUList
A UList of labels.
UList< face > faceUList
UList of faces.
#define registerOptSwitch(Name, Type, SwitchVar)