38 void Foam::fvPatchMapper::calcAddressing()
const 48 <<
"Addressing already calculated" 53 const label oldPatchStart =
56 const label oldPatchEnd =
65 directAddrPtr_ = std::make_unique<labelList>
72 auto& addr = *directAddrPtr_;
80 addr[facei] >= oldPatchStart
81 && addr[facei] < oldPatchEnd
84 addr[facei] -= oldPatchStart;
99 <<
"Unmapped entry in patch mapping for patch " 100 << patch_.
index() <<
" named " << patch_.
name()
108 interpAddrPtr_ = std::make_unique<labelListList>
112 auto& addr = *interpAddrPtr_;
114 weightsPtr_ = std::make_unique<scalarListList>
118 auto& wght = *weightsPtr_;
125 auto& curAddr = addr[facei];
126 auto& curWght = wght[facei];
130 min(curAddr) >= oldPatchStart
131 &&
max(curAddr) < oldPatchEnd
137 curAddr[i] -= oldPatchStart;
145 scalar sumWeight = 0;
151 curAddr[i] >= oldPatchStart
152 && curAddr[i] < oldPatchEnd
155 curAddr[nActive] = curAddr[i] - oldPatchStart;
156 curWght[nActive] = curWght[i];
158 sumWeight += curWght[i];
164 curAddr.resize(nActive);
165 curWght.resize(nActive);
170 for (
auto& w : curWght)
186 if (
min(addr[i]) < 0)
189 <<
"Error in patch mapping for patch " 190 << patch_.
index() <<
" named " << patch_.
name()
210 Foam::fvPatchMapper::fvPatchMapper
218 sizeBeforeMapping_(
faceMap.oldPatchSizes()[patch_.index()]),
236 <<
"Requested direct addressing for an interpolative mapper." 245 return *directAddrPtr_;
254 <<
"Requested interpolative addressing for a direct mapper." 263 return *interpAddrPtr_;
272 <<
"Requested interpolative weights for a direct mapper."
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.
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.
virtual const labelListList & addressing() const
Return interpolated addressing.
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)
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.
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.