35 void Foam::fvPatchMapper::calcAddressing()
const 40 || interpolationAddrPtr_
45 <<
"Addressing already calculated" 50 const label oldPatchStart =
53 const label oldPatchEnd =
77 addr[facei] >= oldPatchStart
78 && addr[facei] < oldPatchEnd
81 addr[facei] -= oldPatchStart;
96 <<
"Unmapped entry in patch mapping for patch " 97 << patch_.
index() <<
" named " << patch_.
name()
105 interpolationAddrPtr_ =
128 min(curAddr) >= oldPatchStart
129 &&
max(curAddr) < oldPatchEnd
135 curAddr[i] -= oldPatchStart;
141 labelList newAddr(curAddr.size(),
false);
149 curAddr[lfI] >= oldPatchStart
150 && curAddr[lfI] < oldPatchEnd
153 newAddr[nActive] = curAddr[lfI] - oldPatchStart;
154 newWeights[nActive] = curW[lfI];
159 newAddr.setSize(nActive);
160 newWeights.setSize(nActive);
165 newWeights /=
sum(newWeights);
182 if (
min(addr[i]) < 0)
185 <<
"Error in patch mapping for patch " 186 << patch_.
index() <<
" named " << patch_.
name()
195 void Foam::fvPatchMapper::clearOut()
200 hasUnmapped_ =
false;
216 directAddrPtr_(
nullptr),
217 interpolationAddrPtr_(
nullptr),
237 <<
"Requested direct addressing for an interpolative mapper." 246 return *directAddrPtr_;
255 <<
"Requested interpolative addressing for a direct mapper." 259 if (!interpolationAddrPtr_)
264 return *interpolationAddrPtr_;
273 <<
"Requested interpolative weights for a direct mapper."
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label index() const
Return the index of this patch in the fvBoundaryMesh.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
This object provides mapping and fill-in information for face data between the two meshes after the t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual ~fvPatchMapper()
Destructor.
virtual bool direct() const
Is the mapping direct.
virtual const labelUList & directAddressing() const
Return direct addressing.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual const labelListList & addressing() const
Return interpolated addressing.
List< scalarList > scalarListList
virtual const labelListList & addressing() const
Return interpolated addressing.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< scalar > scalarList
A List of scalars.
virtual const scalarListList & weights() const
Return interpolation weights.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
fvPatchMapper(const fvPatch &patch, const faceMapper &faceMap)
Construct from mappers.
virtual const scalarListList & weights() const
Return interpolation weights.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
virtual const word & name() const
Return name.
void deleteDemandDrivenData(DataPtr &dataPtr)
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.