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 = fff[fffI].masterObjects();
94 label facei = fff[fffI].index();
96 if (addr[facei].size())
99 <<
"Master face " << facei
100 <<
" mapped from face faces " << mo
106 w[facei] =
scalarList(mo.size(), 1.0/mo.size());
116 if (fm[facei] > -1 && addr[facei].empty())
128 labelList& insertedFaces = *insertedFaceLabelsPtr_;
130 label nInsertedFaces = 0;
134 if (addr[facei].empty())
137 <<
"No interpolative addressing provided for face " << facei
142 insertedFaces.setSize(nInsertedFaces);
147 void Foam::faceMapper::clearOut()
162 insertedFaces_(true),
164 directAddrPtr_(nullptr),
165 interpolationAddrPtr_(nullptr),
166 weightsPtr_(nullptr),
167 insertedFaceLabelsPtr_(nullptr)
182 insertedFaces_ =
false;
197 fm[fff[fffI].index()] = 0;
202 insertedFaces_ =
true;
223 <<
"Requested direct addressing for an interpolative mapper."
227 if (!insertedObjects())
230 return mpm_.faceMap();
239 return *directAddrPtr_;
249 <<
"Requested interpolative addressing for a direct mapper."
253 if (!interpolationAddrPtr_)
258 return *interpolationAddrPtr_;
267 <<
"Requested interpolative weights for a direct mapper."
282 return mpm_.nOldFaces();
288 return mpm_.nOldInternalFaces();
294 if (!insertedFaceLabelsPtr_)
296 if (!insertedObjects())
299 insertedFaceLabelsPtr_ =
new labelList(0);
307 return *insertedFaceLabelsPtr_;
313 return mpm_.flipFaceFlux();
319 return mpm_.nOldInternalFaces();
325 return mpm_.oldPatchStarts();
331 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.
const labelList & oldPatchStarts() const
Return old patch starts.
const labelList & oldPatchSizes() const
Return old patch sizes.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
label nOldInternalFaces() const
Return number of old internalFaces.
label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
virtual ~faceMapper()
Destructor.
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 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.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
List< scalar > scalarList
A List of scalars.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.