35void 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);
152void 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_;
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const List< objectMap > & pointsFromPointsMap() const
Points originating from points.
const labelList & pointMap() const
Old point map.
This object provides mapping and fill-in information for point data between the two meshes after the ...
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual label size() const
Return size.
const labelList & insertedObjectLabels() const
Return list of inserted points.
virtual ~pointMapper()
Destructor.
virtual label sizeBeforeMapping() const
Return size before mapping.
virtual bool direct() const
Is the mapping direct.
Mesh representing a set of points created from polyMesh.
static label size(const Mesh &mesh)
Return size. Number of points.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
List< scalar > scalarList
A List of scalars.
List< labelList > labelListList
A List of labelList.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
List< scalarList > scalarListList
A List of scalarList.
void deleteDemandDrivenData(DataPtr &dataPtr)
#define forAll(list, i)
Loop across all elements in list.