35 void Foam::fvPatchMapper::calcAddressing()
const
40 || interpolationAddrPtr_
45 <<
"Addressing already calculated"
50 const label oldPatchStart =
53 const label oldPatchEnd =
75 addr[facei] >= oldPatchStart
76 && addr[facei] < oldPatchEnd
79 addr[facei] -= oldPatchStart;
93 <<
"Unmapped entry in patch mapping for patch "
94 << patch_.
index() <<
" named " << patch_.
name()
102 interpolationAddrPtr_ =
125 min(curAddr) >= oldPatchStart
126 &&
max(curAddr) < oldPatchEnd
132 curAddr[i] -= oldPatchStart;
138 labelList newAddr(curAddr.size(),
false);
146 curAddr[lfI] >= oldPatchStart
147 && curAddr[lfI] < oldPatchEnd
150 newAddr[nActive] = curAddr[lfI] - oldPatchStart;
151 newWeights[nActive] = curW[lfI];
156 newAddr.setSize(nActive);
157 newWeights.setSize(nActive);
162 newWeights /=
sum(newWeights);
175 if (
min(addr[i]) < 0)
178 <<
"Error in patch mapping for patch "
179 << patch_.
index() <<
" named " << patch_.
name()
188 void Foam::fvPatchMapper::clearOut()
206 sizeBeforeMapping_(
faceMap.oldPatchSizes()[patch_.index()]),
207 directAddrPtr_(nullptr),
208 interpolationAddrPtr_(nullptr),
228 <<
"Requested direct addressing for an interpolative mapper."
237 return *directAddrPtr_;
246 <<
"Requested interpolative addressing for a direct mapper."
250 if (!interpolationAddrPtr_)
255 return *interpolationAddrPtr_;
264 <<
"Requested interpolative weights for a direct mapper."
#define forAll(list, i)
Loop across all elements in list.
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.
const labelList & oldPatchStarts() const
Return old patch starts.
const labelList & oldPatchSizes() const
Return old patch sizes.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual const labelUList & directAddressing() const
Return direct addressing.
fvPatchMapper(const fvPatch &patch, const faceMapper &faceMap)
Construct from mappers.
virtual bool direct() const
Is the mapping direct?
virtual ~fvPatchMapper()
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label index() const
Return the index of this patch in the fvBoundaryMesh.
virtual const word & name() const
Return name.
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
List< scalarList > scalarListList
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
List< scalar > scalarList
A List of scalars.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)