38void Foam::fvPatchMapper::calcAddressing()
const
48 <<
"Addressing already calculated"
53 const label oldPatchStart =
54 faceMap_.oldPatchStarts()[patch_.index()];
56 const label oldPatchEnd =
57 oldPatchStart + faceMap_.oldPatchSizes()[patch_.index()];
65 directAddrPtr_ = std::make_unique<labelList>
67 patch_.patchSlice(faceMap_.directAddressing())
69 auto& addr = *directAddrPtr_;
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 interpAddrPtr_ = std::make_unique<labelListList>
107 patch_.patchSlice(faceMap_.addressing())
109 auto& addr = *interpAddrPtr_;
111 weightsPtr_ = std::make_unique<scalarListList>
113 patch_.patchSlice(faceMap_.weights())
115 auto& wght = *weightsPtr_;
122 auto& curAddr = addr[facei];
123 auto& curWght = wght[facei];
127 min(curAddr) >= oldPatchStart
128 &&
max(curAddr) < oldPatchEnd
134 curAddr[i] -= oldPatchStart;
142 scalar sumWeight = 0;
148 curAddr[i] >= oldPatchStart
149 && curAddr[i] < oldPatchEnd
152 curAddr[nActive] = curAddr[i] - oldPatchStart;
153 curWght[nActive] = curWght[i];
155 sumWeight += curWght[i];
161 curAddr.resize(nActive);
162 curWght.resize(nActive);
167 for (
auto& w : curWght)
183 if (
min(addr[i]) < 0)
186 <<
"Error in patch mapping for patch "
187 << patch_.index() <<
" named " << patch_.name()
207Foam::fvPatchMapper::fvPatchMapper
215 sizeBeforeMapping_(
faceMap.oldPatchSizes()[patch_.index()]),
233 <<
"Requested direct addressing for an interpolative mapper."
242 return *directAddrPtr_;
251 <<
"Requested interpolative addressing for a direct mapper."
260 return *interpAddrPtr_;
269 <<
"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 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.
static int debug
Debug switch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
List< scalarList > scalarListList
List of scalarList.
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< labelList > labelListList
List of labelList.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.