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;
301 <<
"Requested direct addressing for an interpolative mapper." 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_)
365 insertedFaceLabelsPtr_ =
new labelList(0);
373 return *insertedFaceLabelsPtr_;
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)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
faceMapper(const mapPolyMesh &mpm)
Construct from mapPolyMesh.
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelHashSet & flipFaceFlux() const
Map of flipped face flux faces.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
label nOldInternalFaces() const
Number of old internal faces.
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
virtual bool insertedObjects() const
Are there any inserted faces.
virtual const labelListList & addressing() const
Return interpolated addressing.
Include the header files for all the primitive types that Fields are instantiated for...
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
List< scalarList > scalarListList
List< scalar > scalarList
A List of scalars.
virtual const scalarListList & weights() const
Return interpolation weights.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual bool direct() const
Is the mapping direct.
const labelList & faceMap() const
Old face map.
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
virtual ~faceMapper()
Destructor.
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
const List< objectMap > & facesFromFacesMap() const
Faces originating from faces.
virtual label nOldInternalFaces() const
Return number of old internalFaces.
const List< objectMap > & facesFromPointsMap() const
Faces inflated from points.
void deleteDemandDrivenData(DataPtr &dataPtr)
label nOldFaces() const
Number of old faces.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.