34void Foam::faAreaMapper::calcAddressing()
const
39 || newFaceLabelsMapPtr_
41 || interpolationAddrPtr_
43 || insertedObjectLabelsPtr_
47 <<
"Addressing already calculated"
64 newFaceLabelsPtr_ =
new labelList(mesh_().nBoundaryFaces(), -1);
67 newFaceLabelsMapPtr_ =
new labelList(mesh_().nBoundaryFaces(), -1);
71 Info<<
"Old face list size: " << oldFaces.size()
80 if (reverseFaceMap[oldFaces[faceI]] > -1)
124 for (label addrI = 0; addrI < nNewFaces; ++addrI)
145 const labelList& mo = ffp[ffpI].masterObjects();
153 if (oldFaceLookup.found(mo[moI]))
155 validMo[nValidMo] = oldFaceLookup[mo[moI]];
169 addr[nNewFaces] = validMo;
170 w[nNewFaces] =
scalarList(validMo.size(), 1.0/validMo.size());
181 const labelList& mo = ffe[ffeI].masterObjects();
189 if (oldFaceLookup.found(mo[moI]))
191 validMo[nValidMo] = oldFaceLookup[mo[moI]];
205 addr[nNewFaces] = validMo;
206 w[nNewFaces] =
scalarList(validMo.size(), 1.0/validMo.size());
217 const labelList& mo = fff[fffI].masterObjects();
225 if (oldFaceLookup.found(mo[moI]))
227 validMo[nValidMo] = oldFaceLookup[mo[moI]];
241 addr[nNewFaces] = validMo;
242 w[nNewFaces] =
scalarList(validMo.size(), 1.0/validMo.size());
251 addr.setSize(nNewFaces);
252 w.setSize(nNewFaces);
253 Info<<
"addr: " << addr <<
nl
254 <<
"w: " << w <<
endl;
259 insertedObjectLabelsPtr_ =
new labelList(0);
263void Foam::faAreaMapper::clearOut()
273 hasUnmapped_ =
false;
290 newFaceLabelsPtr_(nullptr),
291 newFaceLabelsMapPtr_(nullptr),
292 directAddrPtr_(nullptr),
293 interpolationAddrPtr_(nullptr),
294 weightsPtr_(nullptr),
295 insertedObjectLabelsPtr_(nullptr)
328 if (!newFaceLabelsPtr_)
333 return *newFaceLabelsPtr_;
339 if (!newFaceLabelsMapPtr_)
344 return *newFaceLabelsMapPtr_;
353 <<
"Requested direct addressing for an interpolative mapper."
362 return *directAddrPtr_;
371 <<
"Requested interpolative addressing for a direct mapper."
375 if (!interpolationAddrPtr_)
380 return *interpolationAddrPtr_;
389 <<
"Requested interpolative weights for a direct mapper."
404 if (!insertedObjectLabelsPtr_)
409 return *insertedObjectLabelsPtr_;
void setSize(const label n)
Alias for resize()
void size(const label n)
Older name for setAddressableSize.
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 & newFaceLabelsMap() const
Return new face labels map.
virtual ~faAreaMapper()
Destructor.
const labelList & newFaceLabels() const
Return new face labels.
virtual bool direct() const
Is the mapping direct.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const List< objectMap > & facesFromFacesMap() const
Faces originating from faces.
label nOldInternalFaces() const
Number of old internal faces.
const List< objectMap > & facesFromPointsMap() const
Faces inflated from points.
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
const labelList & reverseFaceMap() const
Reverse face map.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< scalar > scalarList
A List of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< labelList > labelListList
A List of labelList.
errorManip< error > abort(error &err)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< scalarList > scalarListList
A List of scalarList.
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.