Go to the documentation of this file.
39 void 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()
199 void Foam::fvPatchMapper::clearOut()
204 hasUnmapped_ =
false;
210 Foam::fvPatchMapper::fvPatchMapper
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."
static int debug
Debug switch.
List< label > labelList
A List of labels.
List< scalarList > scalarListList
A List of scalarList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< scalar > scalarList
A List of scalars.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual const labelUList & directAddressing() const
Return direct addressing.
Template functions to aid in the implementation of demand driven data.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const word & name() const
Return name.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
virtual const labelListList & addressing() const
Return interpolated addressing.
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
#define forAll(list, i)
Loop across all elements in list.
void deleteDemandDrivenData(DataPtr &dataPtr)
virtual const scalarListList & weights() const
Return interpolation weights.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual ~fvPatchMapper()
Destructor.
virtual const scalarListList & weights() const
Return interpolaion weights.
This object provides mapping and fill-in information for face data between the two meshes after the t...
label index() const
Return the index of this patch in the fvBoundaryMesh.
virtual bool direct() const
Is the mapping direct.
errorManip< error > abort(error &err)
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual const labelListList & addressing() const
Return interpolated addressing.
#define WarningInFunction
Report a warning using Foam::Warning.