Go to the documentation of this file.
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()
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();
const List< objectMap > & facesFromPointsMap() const
Faces inflated from points.
List< label > labelList
A List of labels.
List< scalarList > scalarListList
A List of scalarList.
List< scalar > scalarList
A List of scalars.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
static constexpr const zero Zero
Global zero.
virtual label size() const
Return size.
Template functions to aid in the implementation of demand driven data.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
label nFaces() const
Number of mesh faces.
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
const List< objectMap > & facesFromFacesMap() const
Faces originating from faces.
virtual const scalarListList & weights() const
Return interpolaion weights.
virtual bool direct() const
Is the mapping direct.
errorManip< error > abort(error &err)
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
virtual ~faceMapper()
Destructor.
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
const labelList & faceMap() const
Old face map.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void setSize(const label newSize)
Alias for resize(const label)
virtual label nOldInternalFaces() const
Return number of old internalFaces.
virtual const labelListList & addressing() const
Return interpolated addressing.