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;
149 scalar sumWeight = 0;
155 curAddr[lfI] >= oldPatchStart
156 && curAddr[lfI] < oldPatchEnd
159 newAddr[nActive] = curAddr[lfI] - oldPatchStart;
160 newWeights[nActive] = curW[lfI];
162 sumWeight += curW[lfI];
167 newAddr.resize(nActive);
168 newWeights.resize(nActive);
173 newWeights /= sumWeight;
190 if (
min(addr[i]) < 0)
193 <<
"Error in patch mapping for patch " 194 << patch_.
index() <<
" named " << patch_.
name()
203 void Foam::fvPatchMapper::clearOut()
208 hasUnmapped_ =
false;
214 Foam::fvPatchMapper::fvPatchMapper
222 sizeBeforeMapping_(
faceMap.oldPatchSizes()[patch_.index()]),
224 directAddrPtr_(nullptr),
225 interpolationAddrPtr_(nullptr),
245 <<
"Requested direct addressing for an interpolative mapper." 254 return *directAddrPtr_;
263 <<
"Requested interpolative addressing for a direct mapper." 267 if (!interpolationAddrPtr_)
272 return *interpolationAddrPtr_;
281 <<
"Requested interpolative weights for a direct mapper."
List< scalar > scalarList
List of scalar.
const List< T >::subList patchSlice(const List< T > &values) const
This patch slice from the complete list, which has size mesh::nFaces(), using the virtual patch size...
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.
List< labelList > labelListList
List of labelList.
virtual const labelUList & directAddressing() const
Return direct addressing.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
virtual const labelListList & addressing() const
Return interpolated addressing.
List< scalarList > scalarListList
List of scalarList.
virtual const labelListList & addressing() const
Return interpolated addressing.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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)
Template functions to aid in the implementation of demand driven data.
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.
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
The index of this patch in the boundary mesh.
virtual const labelUList & directAddressing() const
Return direct addressing.
static int debug
Debug switch.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.