33 void Foam::pointMapper::calcAddressing()
const
38 || interpolationAddrPtr_
40 || insertedPointLabelsPtr_
44 <<
"Addressing already calculated."
59 labelList& insertedPoints = *insertedPointLabelsPtr_;
61 label nInsertedPoints = 0;
65 if (directAddr[pointi] < 0)
68 directAddr[pointi] = 0;
69 insertedPoints[nInsertedPoints] = pointi;
74 insertedPoints.setSize(nInsertedPoints);
92 const labelList& mo = cfc[cfcI].masterObjects();
94 label pointi = cfc[cfcI].index();
96 if (addr[pointi].size())
99 <<
"Master point " << pointi
100 <<
" mapped from points " << mo
106 w[pointi] =
scalarList(mo.size(), 1.0/mo.size());
117 if (cm[pointi] > -1 && addr[pointi].empty())
128 labelList& insertedPoints = *insertedPointLabelsPtr_;
130 label nInsertedPoints = 0;
134 if (addr[pointi].empty())
137 <<
"No interpolative addressing provided for point "
145 insertedPoints[nInsertedPoints] = pointi;
150 insertedPoints.setSize(nInsertedPoints);
155 void Foam::pointMapper::clearOut()
174 insertedPoints_(true),
176 directAddrPtr_(nullptr),
177 interpolationAddrPtr_(nullptr),
178 weightsPtr_(nullptr),
179 insertedPointLabelsPtr_(nullptr)
194 insertedPoints_ =
false;
208 cm[cfc[cfcI].index()] = 0;
213 insertedPoints_ =
true;
234 <<
"Requested direct addressing for an interpolative mapper."
238 if (!insertedObjects())
241 return map_.pointMap();
250 return *directAddrPtr_;
260 <<
"Requested interpolative addressing for a direct mapper."
264 if (!interpolationAddrPtr_)
269 return *interpolationAddrPtr_;
278 <<
"Requested interpolative weights for a direct mapper."
293 return map_.nOldPoints();
299 if (!insertedPointLabelsPtr_)
301 if (!insertedObjects())
304 insertedPointLabelsPtr_ =
new labelList(0);
312 return *insertedPointLabelsPtr_;
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
pointMapper(const pointMesh &, const polyTopoChangeMap &map)
Construct from polyTopoChangeMap.
virtual const labelList & insertedObjectLabels() const
Return list of inserted points.
virtual ~pointMapper()
Destructor.
virtual label sizeBeforeMapping() const
Return size before mapping.
virtual bool direct() const
Is the mapping direct.
Mesh representing a set of points created from polyMesh.
label size() const
Return number of points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & pointMap() const
Old point map.
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< scalarList > scalarListList
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
List< scalar > scalarList
A List of scalars.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.