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