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())
70 Foam::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);
229 const polyMesh&
mesh,
234 return meshPointMapppings
238 uniqueMeshPointLabels,
label uniqueMeshPoints(const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
Globally unique mesh points. Required when writing point fields.
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
label nPoints() const noexcept
Number of mesh points.
static const manifoldCellsMeshObject & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject. Registered with typeName.
Map< label > meshPointMap(const polyMesh &mesh) const
Mesh point map.
label size() const noexcept
Processor-local size of all elements.
static bool & parRun() noexcept
Test if this a parallel run.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
static const List< label > & null()
Return a null List.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
static void reduceAnd(bool &value, const label communicator=worldComm)
Logical (and) reduction (MPI_AllReduce)
const globalMeshData & globalData() const
Return parallel info.
virtual const faceList & faces() const
Return raw faces.
label nCells() const noexcept
Number of mesh cells.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
void identity(labelUList &map, label start=0)
Set identity map with (map[i] == i)
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
const cellList & cells() const
Return the (optionally compacted) cell list Triggers demand-driven filtering if required.
A HashTable to objects of type <T> with a label key.
const labelList & cellIds() const
Processor-local cell ids of all elements.