35 void Foam::faceMapper::calcAddressing()
const 40 || interpolationAddrPtr_
42 || insertedFaceLabelsPtr_
46 <<
"Addressing already calculated." 61 labelList& insertedFaces = *insertedFaceLabelsPtr_;
63 label nInsertedFaces = 0;
67 if (directAddr[facei] < 0)
70 directAddr[facei] = 0;
71 insertedFaces[nInsertedFaces] = facei;
76 insertedFaces.setSize(nInsertedFaces);
93 const labelList& mo = ffp[ffpI].masterObjects();
95 label facei = ffp[ffpI].index();
97 if (addr[facei].
size())
100 <<
"Master face " << facei
101 <<
" mapped from point faces " << mo
107 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
115 const labelList& mo = ffe[ffeI].masterObjects();
117 label facei = ffe[ffeI].index();
119 if (addr[facei].
size())
122 <<
"Master face " << facei
123 <<
" mapped from edge faces " << mo
129 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
137 const labelList& mo = fff[fffI].masterObjects();
139 label facei = fff[fffI].index();
141 if (addr[facei].
size())
144 <<
"Master face " << facei
145 <<
" mapped from face faces " << mo
151 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
161 if (fm[facei] > -1 && addr[facei].empty())
173 labelList& insertedFaces = *insertedFaceLabelsPtr_;
175 label nInsertedFaces = 0;
179 if (addr[facei].empty())
185 insertedFaces[nInsertedFaces] = facei;
190 insertedFaces.setSize(nInsertedFaces);
195 void Foam::faceMapper::clearOut()
206 Foam::faceMapper::faceMapper(
const mapPolyMesh& mpm)
210 insertedFaces_(true),
212 directAddrPtr_(nullptr),
213 interpolationAddrPtr_(nullptr),
214 weightsPtr_(nullptr),
215 insertedFaceLabelsPtr_(nullptr)
235 insertedFaces_ =
false;
250 fm[ffp[ffpI].index()] = 0;
257 fm[ffe[ffeI].index()] = 0;
264 fm[fff[fffI].index()] = 0;
269 insertedFaces_ =
true;
287 return mesh_.nFaces();
293 return mpm_.nOldFaces();
299 return mpm_.nOldInternalFaces();
308 <<
"Requested direct addressing for an interpolative mapper." 312 if (!insertedObjects())
315 return mpm_.faceMap();
324 return *directAddrPtr_;
334 <<
"Requested interpolative addressing for a direct mapper." 338 if (!interpolationAddrPtr_)
343 return *interpolationAddrPtr_;
352 <<
"Requested interpolative weights for a direct mapper." 367 if (!insertedFaceLabelsPtr_)
369 if (!insertedObjects())
372 insertedFaceLabelsPtr_ =
new labelList(0);
380 return *insertedFaceLabelsPtr_;
386 return mpm_.flipFaceFlux();
392 return mpm_.nOldInternalFaces();
398 return mpm_.oldPatchStarts();
404 return mpm_.oldPatchSizes();
List< scalar > scalarList
List of scalar.
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
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.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
label nFaces() const noexcept
Number of mesh faces.
List< labelList > labelListList
List of labelList.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label n)
Alias for resize()
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
List< scalarList > scalarListList
List of scalarList.
virtual const scalarListList & weights() const
Return interpolaion weights.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
virtual bool direct() const
Is the mapping direct.
const labelList & faceMap() const
Old face map.
virtual ~faceMapper()
Destructor.
Template functions to aid in the implementation of demand driven data.
virtual label size() const
Return size.
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.
List< label > labelList
A List of labels.
const List< objectMap > & facesFromPointsMap() const
Faces inflated from points.
void deleteDemandDrivenData(DataPtr &dataPtr)
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
static constexpr const zero Zero
Global zero (0)