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())
140 insertedPoints[nInsertedPoints] = pointi;
145 insertedPoints.setSize(nInsertedPoints);
150 void Foam::pointMapper::clearOut()
165 insertedPoints_(true),
167 directAddrPtr_(nullptr),
168 interpolationAddrPtr_(nullptr),
169 weightsPtr_(nullptr),
170 insertedPointLabelsPtr_(nullptr)
185 insertedPoints_ =
false;
199 cm[cfc[cfcI].index()] = 0;
204 insertedPoints_ =
true;
231 <<
"Requested direct addressing for an interpolative mapper." 247 return *directAddrPtr_;
257 <<
"Requested interpolative addressing for a direct mapper." 261 if (!interpolationAddrPtr_)
266 return *interpolationAddrPtr_;
275 <<
"Requested interpolative weights for a direct mapper." 290 if (!insertedPointLabelsPtr_)
295 insertedPointLabelsPtr_ =
new labelList(0);
303 return *insertedPointLabelsPtr_;
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
virtual const labelListList & addressing() const
Return interpolated addressing.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual label sizeBeforeMapping() const
Return size before mapping.
const labelList & insertedObjectLabels() const
Return list of inserted points.
virtual ~pointMapper()
Destructor.
pointMapper(const pointMesh &, const mapPolyMesh &mpm)
Construct from mapPolyMesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool insertedObjects() const
Are there any inserted points.
Mesh representing a set of points created from polyMesh.
virtual const scalarListList & weights() const
Return interpolaion weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
List< scalarList > scalarListList
List< scalar > scalarList
A List of scalars.
virtual bool direct() const
Is the mapping direct.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
label size() const
Return number of points.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const labelList & pointMap() const
Old point map.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Template functions to aid in the implementation of demand driven data.
void deleteDemandDrivenData(DataPtr &dataPtr)
label nOldPoints() const
Number of old points.