39void Foam::fvPatchMapper::calcAddressing()
const
44 || interpolationAddrPtr_
49 <<
"Addressing already calculated"
54 const label oldPatchStart =
57 const label oldPatchEnd =
81 addr[facei] >= oldPatchStart
82 && addr[facei] < oldPatchEnd
85 addr[facei] -= oldPatchStart;
100 <<
"Unmapped entry in patch mapping for patch "
101 << patch_.
index() <<
" named " << patch_.
name()
109 interpolationAddrPtr_ =
132 min(curAddr) >= oldPatchStart
133 &&
max(curAddr) < oldPatchEnd
139 curAddr[i] -= oldPatchStart;
145 labelList newAddr(curAddr.size(),
false);
153 curAddr[lfI] >= oldPatchStart
154 && curAddr[lfI] < oldPatchEnd
157 newAddr[nActive] = curAddr[lfI] - oldPatchStart;
158 newWeights[nActive] = curW[lfI];
163 newAddr.setSize(nActive);
164 newWeights.setSize(nActive);
169 newWeights /=
sum(newWeights);
186 if (
min(addr[i]) < 0)
189 <<
"Error in patch mapping for patch "
190 << patch_.
index() <<
" named " << patch_.
name()
199void Foam::fvPatchMapper::clearOut()
204 hasUnmapped_ =
false;
218 sizeBeforeMapping_(
faceMap.oldPatchSizes()[patch_.index()]),
220 directAddrPtr_(nullptr),
221 interpolationAddrPtr_(nullptr),
241 <<
"Requested direct addressing for an interpolative mapper."
250 return *directAddrPtr_;
259 <<
"Requested interpolative addressing for a direct mapper."
263 if (!interpolationAddrPtr_)
268 return *interpolationAddrPtr_;
277 <<
"Requested interpolative weights for a direct mapper."
This object provides mapping and fill-in information for face data between the two meshes after the t...
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolaion weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
Mapping class for a fvPatchField.
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 bool direct() const
Is the mapping direct.
virtual ~fvPatchMapper()
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
label index() const
Return the index of this patch in the fvBoundaryMesh.
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
List< scalar > scalarList
A List of scalars.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< labelList > labelListList
A List of labelList.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
List< scalarList > scalarListList
A List of scalarList.
void deleteDemandDrivenData(DataPtr &dataPtr)
#define forAll(list, i)
Loop across all elements in list.