Go to the documentation of this file.
39 const label nEstimate = 8*this->
size();
45 for (
const label celli : this->
cellIds())
47 for (
const label facei :
mesh.cells()[celli])
49 for (
const label pointi :
mesh.faces()[facei])
51 pointMap.insert(pointi, 0);
58 for (
const label pointi : pointMap.sortedToc())
67 Foam::label Foam::ensightCells::meshPointMapppings
77 const bool rewritePointMap =
notNull(pointToGlobalRequest);
79 if (
notNull(pointToGlobalRequest))
81 pointToGlobal.
transfer(pointToGlobalRequest);
85 const ensightCells& part = *
this;
92 bool allCells = (part.size() ==
mesh.
nCells());
102 autoPtr<globalIndex> globalPointsPtr =
106 uniqueMeshPointLabels
109 nPoints = globalPointsPtr().size();
115 Map<label> meshPointMap(part.meshPointMap(
mesh));
117 labelList meshPoints(meshPointMap.sortedToc());
119 autoPtr<globalIndex> globalPointsPtr =
125 uniqueMeshPointLabels
128 nPoints = globalPointsPtr().size();
130 meshPointMap.clear();
143 const label orig = meshPoints[i];
144 const label glob = pointToGlobal[i];
146 oldToNew[orig] = glob;
178 for (
const label celli : this->cellIds())
180 for (
const label facei :
mesh.
cells()[celli])
182 for (
const label pointi :
mesh.
faces()[facei])
184 if (pointToGlobal[pointi] == -1)
186 pointToGlobal[pointi] =
nPoints++;
198 forAll(pointToGlobal, pointi)
200 if (pointToGlobal[pointi] != -1)
202 pointToGlobal[pointi] =
nPoints;
204 uniqueMeshPointLabels[
nPoints] = pointi;
212 if (
notNull(pointToGlobalRequest))
214 pointToGlobalRequest.
transfer(pointToGlobal);
228 return meshPointMapppings
232 uniqueMeshPointLabels,
List< label > labelList
A List of labels.
static const List< label > & null()
Return a null List.
label size() const
Processor-local size of all elements.
static bool & parRun()
Test if this a parallel run, or allow modify access.
const cellList & cells() const
A HashTable to objects of type <T> with a label key.
label uniqueMeshPoints(const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
Globally unique mesh points. Required when writing point fields.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label nCells() const
Number of mesh cells.
Map< label > meshPointMap(const polyMesh &mesh) const
Mesh point map.
void transfer(List< T > &list)
const labelList & cellIds() const
Processor-local cell ids of all elements.
void resize(const label newSize)
Adjust allocated size of list.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
virtual const faceList & faces() const
Return raw faces.
void identity(labelUList &map, label start=0)
Set identity map with (map[i] == i)
label nPoints() const
Number of mesh points.
Various functions to operate on Lists.
const globalMeshData & globalData() const
Return parallel info.