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."
List< labelList > labelListList
A List of labelList.
static int debug
Debug switch.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#define forAll(list, i)
Loop across all elements in list.
virtual const labelListList & addressing() const
Return interpolated addressing.
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 interpolaion weights.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
const List< T >::subList patchSlice(const List< T > &l) const
Slice List to patch, using the virtual patch size.
Template functions to aid in the implementation of demand driven data.
virtual const scalarListList & weights() const
Return interpolation weights.
List< scalarList > scalarListList
A List of scalarList.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
const std::string patch
OpenFOAM patch number as a std::string.
virtual const word & name() const
Return name.
List< label > labelList
A List of labels.
void deleteDemandDrivenData(DataPtr &dataPtr)
label index() const noexcept
Return the index of this patch in the fvBoundaryMesh.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.