36 void Foam::pointMapper::calcAddressing()
const 41 || interpolationAddrPtr_
43 || insertedPointLabelsPtr_
47 <<
"Addressing already calculated." 62 labelList& insertedPoints = *insertedPointLabelsPtr_;
64 label nInsertedPoints = 0;
68 if (directAddr[pointI] < 0)
71 directAddr[pointI] = 0;
72 insertedPoints[nInsertedPoints] = pointI;
77 insertedPoints.setSize(nInsertedPoints);
95 const labelList& mo = cfc[cfcI].masterObjects();
97 label pointI = cfc[cfcI].index();
99 if (addr[pointI].
size())
101 FatalErrorIn(
"void pointMapper::calcAddressing() const")
102 <<
"Master point " << pointI
103 <<
" mapped from points " << mo
109 w[pointI] =
scalarList(mo.size(), 1.0/mo.size());
120 if (cm[pointI] > -1 && addr[pointI].empty())
131 labelList& insertedPoints = *insertedPointLabelsPtr_;
133 label nInsertedPoints = 0;
137 if (addr[pointI].empty())
143 insertedPoints[nInsertedPoints] = pointI;
148 insertedPoints.setSize(nInsertedPoints);
153 void Foam::pointMapper::clearOut()
169 insertedPoints_(true),
171 directAddrPtr_(NULL),
172 interpolationAddrPtr_(NULL),
174 insertedPointLabelsPtr_(NULL)
189 insertedPoints_ =
false;
203 cm[cfc[cfcI].index()] = 0;
208 insertedPoints_ =
true;
242 "const labelUList& pointMapper::directAddressing() const" 243 ) <<
"Requested direct addressing for an interpolative mapper." 259 return *directAddrPtr_;
270 "const labelListList& pointMapper::addressing() const" 271 ) <<
"Requested interpolative addressing for a direct mapper." 275 if (!interpolationAddrPtr_)
280 return *interpolationAddrPtr_;
290 "const scalarListList& pointMapper::weights() const" 291 ) <<
"Requested interpolative weights for a direct mapper." 306 if (!insertedPointLabelsPtr_)
311 insertedPointLabelsPtr_ =
new labelList(0);
319 return *insertedPointLabelsPtr_;
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
virtual const scalarListList & weights() const
Return interpolaion weights.
List< scalarList > scalarListList
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
label size() const
Return number of points.
bool insertedObjects() const
Are there any inserted points.
void deleteDemandDrivenData(DataPtr &dataPtr)
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 size(const label)
Override size to be inconsistent with allocated storage.
virtual ~pointMapper()
Destructor.
Mesh representing a set of points created from polyMesh.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const labelUList & directAddressing() const
Return direct addressing.
Template functions to aid in the implementation of demand driven data.
virtual label sizeBeforeMapping() const
Return size before mapping.
List< scalar > scalarList
A List of scalars.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
virtual label size() const
Return size.
List< label > labelList
A List of labels.
const labelList & insertedObjectLabels() const
Return list of inserted 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 > &)
virtual bool direct() const
Is the mapping direct.
List< labelList > labelListList
A List of labelList.
label nOldPoints() const
Number of old points.