34 void Foam::faAreaMapper::calcAddressing()
const 39 || newFaceLabelsMapPtr_
41 || interpolationAddrPtr_
43 || insertedObjectLabelsPtr_
47 <<
"Addressing already calculated" 64 newFaceLabelsPtr_ =
new labelList(mesh_.
mesh().nBoundaryFaces(), -1);
67 newFaceLabelsMapPtr_ =
new labelList(mesh_.
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);
263 void Foam::faAreaMapper::clearOut()
273 hasUnmapped_ =
false;
279 Foam::faAreaMapper::faAreaMapper
289 sizeBeforeMapping_(
mesh.nFaces()),
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_;
List< scalar > scalarList
List of scalar.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
void size(const label n)
Older name for setAddressableSize.
virtual ~faAreaMapper()
Destructor.
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.
const labelList & newFaceLabels() const
Return new face labels.
constexpr char nl
The newline '\n' character (0x0a)
const List< objectMap > & facesFromEdgesMap() const
Faces inflated from edges.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & newFaceLabelsMap() const
Return new face labels map.
List< labelList > labelListList
List of labelList.
static const faMesh & mesh(const polyMesh &pMesh)
The single-region finite-area region on the polyMesh. Uses lookupObject semantics - Fatal if non-exis...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
label nOldInternalFaces() const
Number of old internal faces.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
void setSize(const label n)
Alias for resize()
const labelList & faceLabels() const noexcept
Return the underlying polyMesh face labels.
List< scalarList > scalarListList
List of scalarList.
errorManip< error > abort(error &err)
Template functions to aid in the implementation of demand driven data.
virtual bool direct() const
Is the mapping direct.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual const scalarListList & weights() const
Return interpolation weights.
const List< objectMap > & facesFromFacesMap() const
Faces originating from faces.
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.
const labelList & reverseFaceMap() const
Reverse face map.
virtual const labelListList & addressing() const
Return interpolated addressing.