34 void Foam::faceMapper::calcAddressing()
const
39 || interpolationAddrPtr_
41 || insertedFaceLabelsPtr_
45 <<
"Addressing already calculated."
60 labelList& insertedFaces = *insertedFaceLabelsPtr_;
62 label nInsertedFaces = 0;
66 if (directAddr[facei] < 0)
69 directAddr[facei] = 0;
70 insertedFaces[nInsertedFaces] = facei;
75 insertedFaces.setSize(nInsertedFaces);
92 const labelList& mo = ffp[ffpI].masterObjects();
94 label facei = ffp[ffpI].index();
96 if (addr[facei].size())
99 <<
"Master face " << facei
100 <<
" mapped from point faces " << mo
106 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
114 const labelList& mo = ffe[ffeI].masterObjects();
116 label facei = ffe[ffeI].index();
118 if (addr[facei].size())
121 <<
"Master face " << facei
122 <<
" mapped from edge faces " << mo
128 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
136 const labelList& mo = fff[fffI].masterObjects();
138 label facei = fff[fffI].index();
140 if (addr[facei].size())
143 <<
"Master face " << facei
144 <<
" mapped from face faces " << mo
150 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
160 if (fm[facei] > -1 && addr[facei].empty())
172 labelList& insertedFaces = *insertedFaceLabelsPtr_;
174 label nInsertedFaces = 0;
178 if (addr[facei].empty())
184 insertedFaces[nInsertedFaces] = facei;
189 insertedFaces.setSize(nInsertedFaces);
194 void Foam::faceMapper::clearOut()
209 insertedFaces_(true),
211 directAddrPtr_(nullptr),
212 interpolationAddrPtr_(nullptr),
213 weightsPtr_(nullptr),
214 insertedFaceLabelsPtr_(nullptr)
234 insertedFaces_ =
false;
249 fm[ffp[ffpI].index()] = 0;
256 fm[ffe[ffeI].index()] = 0;
263 fm[fff[fffI].index()] = 0;
268 insertedFaces_ =
true;
286 return mpm_.nOldFaces();
292 return mpm_.nOldInternalFaces();
301 <<
"Requested direct addressing for an interpolative mapper."
305 if (!insertedObjects())
308 return mpm_.faceMap();
317 return *directAddrPtr_;
327 <<
"Requested interpolative addressing for a direct mapper."
331 if (!interpolationAddrPtr_)
336 return *interpolationAddrPtr_;
345 <<
"Requested interpolative weights for a direct mapper."
360 if (!insertedFaceLabelsPtr_)
362 if (!insertedObjects())
365 insertedFaceLabelsPtr_ =
new labelList(0);
373 return *insertedFaceLabelsPtr_;
379 return mpm_.flipFaceFlux();
385 return mpm_.nOldInternalFaces();
391 return mpm_.oldPatchStarts();
397 return mpm_.oldPatchSizes();
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label)
Reset size of List.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
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 const labelList & insertedObjectLabels() const
Return list of inserted faces.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual label nOldInternalFaces() const
Return number of old internalFaces.
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
virtual ~faceMapper()
Destructor.
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
faceMapper(const polyTopoChangeMap &mpm)
Construct from polyTopoChangeMap.
virtual bool direct() const
Is the mapping direct.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const List< objectMap > & facesFromFacesMap() const
Faces originating from faces.
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
const List< objectMap > & facesFromPointsMap() const
Faces inflated from points.
const labelList & faceMap() const
Old face map.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Include the header files for all the primitive types that Fields are instantiated for.
List< scalarList > scalarListList
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
List< scalar > scalarList
A List of scalars.
void deleteDemandDrivenData(DataPtr &dataPtr)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.