48 for (
const label celli : this->
cellIds())
50 for (
const label facei : meshCells[celli])
52 for (
const label pointi : meshFaces[facei])
54 pointMap.
insert(pointi, 0);
61 for (
const label pointi : pointMap.
sortedToc())
70Foam::label Foam::ensightCells::meshPointMapppings
83 const bool rewritePointMap =
notNull(pointToGlobalRequest);
85 if (
notNull(pointToGlobalRequest))
87 pointToGlobal.
transfer(pointToGlobalRequest);
91 const ensightCells& part = *
this;
98 bool allCells = (part.size() ==
mesh.
nCells());
108 autoPtr<globalIndex> globalPointsPtr =
112 uniqueMeshPointLabels
115 nPoints = globalPointsPtr().totalSize();
121 Map<label> meshPointMap(part.meshPointMap(
mesh));
123 labelList meshPoints(meshPointMap.sortedToc());
125 autoPtr<globalIndex> globalPointsPtr =
131 uniqueMeshPointLabels
134 nPoints = globalPointsPtr().totalSize();
136 meshPointMap.clear();
149 const label orig = meshPoints[i];
150 const label glob = pointToGlobal[i];
152 oldToNew[orig] = glob;
184 for (
const label celli : this->cellIds())
186 for (
const label facei : meshCells[celli])
188 for (
const label pointi :
mesh.
faces()[facei])
190 if (pointToGlobal[pointi] == -1)
192 pointToGlobal[pointi] =
nPoints++;
204 forAll(pointToGlobal, pointi)
206 if (pointToGlobal[pointi] != -1)
208 pointToGlobal[pointi] =
nPoints;
210 uniqueMeshPointLabels[
nPoints] = pointi;
218 if (
notNull(pointToGlobalRequest))
220 pointToGlobalRequest.
transfer(pointToGlobal);
234 return meshPointMapppings
238 uniqueMeshPointLabels,
Various functions to operate on Lists.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
void transfer(List< T > &list)
void resize(const label len)
Adjust allocated size of list.
A HashTable to objects of type <T> with a label key.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static bool & parRun() noexcept
Test if this a parallel run.
label uniqueMeshPoints(const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
Globally unique mesh points. Required when writing point fields.
label size() const noexcept
Processor-local size of all elements.
const labelList & cellIds() const
Processor-local cell ids of all elements.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
const Map< label > & meshPointMap() const
Per point that is to be duplicated the local index.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
const globalMeshData & globalData() const
Return parallel info.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
void identity(labelUList &map, label start=0)
Set identity map with (map[i] == i)
List< label > labelList
A List of labels.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
#define forAll(list, i)
Loop across all elements in list.