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()
169 insertedPoints_(
true),
171 directAddrPtr_(
nullptr),
172 interpolationAddrPtr_(
nullptr),
173 weightsPtr_(
nullptr),
174 insertedPointLabelsPtr_(
nullptr)
189 insertedPoints_ =
false;
203 cm[cfc[cfcI].index()] = 0;
208 insertedPoints_ =
true;
235 <<
"Requested direct addressing for an interpolative mapper." 251 return *directAddrPtr_;
261 <<
"Requested interpolative addressing for a direct mapper." 265 if (!interpolationAddrPtr_)
270 return *interpolationAddrPtr_;
279 <<
"Requested interpolative weights for a direct mapper." 294 if (!insertedPointLabelsPtr_)
299 insertedPointLabelsPtr_ =
new labelList(0);
307 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)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
const labelList & pointMap() const
Old point map.
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
label nOldPoints() const
Number of old points.
bool insertedObjects() const
Are there any inserted points.
Mesh representing a set of points created from polyMesh.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
List< scalarList > scalarListList
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
List< scalar > scalarList
A List of scalars.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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...
Template functions to aid in the implementation of demand driven data.
pointMapper(const pointMesh &, const polyTopoChangeMap &map)
Construct from polyTopoChangeMap.
void deleteDemandDrivenData(DataPtr &dataPtr)