35 void Foam::pointMapper::calcAddressing()
const 40 || interpolationAddrPtr_
42 || insertedPointLabelsPtr_
46 <<
"Addressing already calculated." 61 labelList& insertedPoints = *insertedPointLabelsPtr_;
63 label nInsertedPoints = 0;
67 if (directAddr[pointi] < 0)
70 directAddr[pointi] = 0;
71 insertedPoints[nInsertedPoints] = pointi;
76 insertedPoints.setSize(nInsertedPoints);
94 const labelList& mo = cfc[cfcI].masterObjects();
96 label pointi = cfc[cfcI].index();
98 if (addr[pointi].
size())
101 <<
"Master point " << pointi
102 <<
" mapped from points " << mo
108 w[pointi] =
scalarList(mo.size(), 1.0/mo.size());
119 if (cm[pointi] > -1 && addr[pointi].empty())
130 labelList& insertedPoints = *insertedPointLabelsPtr_;
132 label nInsertedPoints = 0;
136 if (addr[pointi].empty())
142 insertedPoints[nInsertedPoints] = pointi;
147 insertedPoints.setSize(nInsertedPoints);
152 void Foam::pointMapper::clearOut()
167 insertedPoints_(true),
169 directAddrPtr_(nullptr),
170 interpolationAddrPtr_(nullptr),
171 weightsPtr_(nullptr),
172 insertedPointLabelsPtr_(nullptr)
187 insertedPoints_ =
false;
201 cm[cfc[cfcI].index()] = 0;
206 insertedPoints_ =
true;
224 return mpm_.pointMap().size();
230 return mpm_.nOldPoints();
239 <<
"Requested direct addressing for an interpolative mapper." 243 if (!insertedObjects())
246 return mpm_.pointMap();
255 return *directAddrPtr_;
265 <<
"Requested interpolative addressing for a direct mapper." 269 if (!interpolationAddrPtr_)
274 return *interpolationAddrPtr_;
283 <<
"Requested interpolative weights for a direct mapper." 298 if (!insertedPointLabelsPtr_)
300 if (!insertedObjects())
303 insertedPointLabelsPtr_ =
new labelList(0);
311 return *insertedPointLabelsPtr_;
List< labelList > labelListList
A List of labelList.
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
virtual const labelListList & addressing() const
Return interpolated addressing.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#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.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
static label size(const Mesh &mesh)
Return size. Number of points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Mesh representing a set of points created from polyMesh.
#define forAll(list, i)
Loop across all elements in list.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual label size() const
Return size.
List< scalar > scalarList
A List of scalars.
virtual bool direct() const
Is the mapping direct.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
const labelList & pointMap() const
Old point map.
Template functions to aid in the implementation of demand driven data.
List< scalarList > scalarListList
A List of scalarList.
List< label > labelList
A List of labels.
void deleteDemandDrivenData(DataPtr &dataPtr)
static constexpr const zero Zero
Global zero (0)