33 void Foam::faceMapper::calcAddressing()
const 38 || interpolationAddrPtr_
40 || insertedFaceLabelsPtr_
44 <<
"Addressing already calculated." 59 labelList& insertedFaces = *insertedFaceLabelsPtr_;
61 label nInsertedFaces = 0;
65 if (directAddr[facei] < 0)
68 directAddr[facei] = 0;
69 insertedFaces[nInsertedFaces] = facei;
74 insertedFaces.setSize(nInsertedFaces);
91 const labelList& mo = ffp[ffpI].masterObjects();
93 label facei = ffp[ffpI].index();
95 if (addr[facei].size())
98 <<
"Master face " << facei
99 <<
" mapped from point faces " << mo
105 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
113 const labelList& mo = ffe[ffeI].masterObjects();
115 label facei = ffe[ffeI].index();
117 if (addr[facei].size())
120 <<
"Master face " << facei
121 <<
" mapped from edge faces " << mo
127 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
135 const labelList& mo = fff[fffI].masterObjects();
137 label facei = fff[fffI].index();
139 if (addr[facei].size())
142 <<
"Master face " << facei
143 <<
" mapped from face faces " << mo
149 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
159 if (fm[facei] > -1 && addr[facei].empty())
171 labelList& insertedFaces = *insertedFaceLabelsPtr_;
173 label nInsertedFaces = 0;
177 if (addr[facei].empty())
183 insertedFaces[nInsertedFaces] = facei;
188 insertedFaces.setSize(nInsertedFaces);
193 void Foam::faceMapper::clearOut()
208 insertedFaces_(true),
210 directAddrPtr_(nullptr),
211 interpolationAddrPtr_(nullptr),
212 weightsPtr_(nullptr),
213 insertedFaceLabelsPtr_(nullptr)
233 insertedFaces_ =
false;
248 fm[ffp[ffpI].index()] = 0;
255 fm[ffe[ffeI].index()] = 0;
262 fm[fff[fffI].index()] = 0;
267 insertedFaces_ =
true;
300 <<
"Requested direct addressing for an interpolative mapper." 316 return *directAddrPtr_;
326 <<
"Requested interpolative addressing for a direct mapper." 330 if (!interpolationAddrPtr_)
335 return *interpolationAddrPtr_;
344 <<
"Requested interpolative weights for a direct mapper." 359 if (!insertedFaceLabelsPtr_)
364 insertedFaceLabelsPtr_ =
new labelList(0);
372 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.
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.