40 correctedCellVolumeWeightMethod,
62 label srcCellI = srcSeedI;
63 label tgtCellI = tgtSeedI;
81 seedCells[srcCellI] = tgtCellI;
90 visitedTgtCells.clear();
93 nbrTgtCells.append(tgtCellI);
98 tgtCellI = nbrTgtCells.remove();
99 visitedTgtCells.append(tgtCellI);
111 srcToTgtAddr[srcCellI].
append(tgtCellI);
113 srcToTgtVec[srcCellI].
append(vol.
second()-tgtCc[tgtCellI]);
115 tgtToSrcAddr[tgtCellI].
append(srcCellI);
117 tgtToSrcVec[tgtCellI].
append(vol.
second()-srcCc[srcCellI]);
125 while (!nbrTgtCells.empty());
127 mapFlag[srcCellI] =
false;
141 while (srcCellI != -1);
144 forAll(srcToTgtCellAddr, i)
146 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
147 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
148 srcToTgtCellVec[i].
transfer(srcToTgtVec[i]);
151 forAll(tgtToSrcCellAddr, i)
153 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
154 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
155 tgtToSrcCellVec[i].
transfer(tgtToSrcVec[i]);
163 forAll(srcToTgtCellAddr, cellI)
166 scalar tgtVol =
sum(srcToTgtCellWght[cellI]);
168 if (
mag(srcVol) > ROOTVSMALL &&
mag((tgtVol-srcVol)/srcVol) > 1
e-6)
171 <<
"At cell " << cellI <<
" cc:" 174 <<
" total overlap volume:" << tgtVol
179 forAll(tgtToSrcCellAddr, cellI)
182 scalar srcVol =
sum(tgtToSrcCellWght[cellI]);
184 if (
mag(tgtVol) > ROOTVSMALL &&
mag((srcVol-tgtVol)/tgtVol) > 1
e-6)
187 <<
"At cell " << cellI <<
" cc:" 190 <<
" total overlap volume:" << srcVol
250 boolList mapFlag(src_.nCells(),
false);
256 label startSeedI = 0;
void size(const label n)
Older name for setAddressableSize.
void calculateAddressing(labelListList &srcToTgtCellAddr, scalarListList &srcToTgtCellWght, pointListList &srcToTgtCellVec, labelListList &tgtToSrcCellAddr, scalarListList &tgtToSrcCellWght, pointListList &tgtToSrcCellVec, const label srcSeedI, const label tgtSeedI, const labelList &srcCellIDs, boolList &mapFlag, label &startSeedI)
Calculate the mesh-to-mesh addressing and weights.
const polyMesh & src_
Reference to the source mesh.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Cell-volume-weighted mesh-to-mesh interpolation class.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)
Calculate addressing and weights and optionally offset vectors.
Macros for easy insertion into run-time selection tables.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
static scalar tolerance_
Tolerance used in volume overlap calculations.
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
correctedCellVolumeWeightMethod(const correctedCellVolumeWeightMethod &)=delete
No copy construct.
void clear()
Clear the list, i.e. set size to zero.
const vectorField & cellCentres() const
const polyMesh & tgt_
Reference to the target mesh.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
virtual void appendNbrCells(const label tgtCelli, const polyMesh &mesh, const DynamicList< label > &visitedTgtCells, DynamicList< label > &nbrTgtCellIDs) const
Append target cell neighbour cells to cellIDs list.
void setNextCells(label &startSeedI, label &srcCelli, label &tgtCelli, const labelList &srcCellIDs, const boolList &mapFlag, const DynamicList< label > &visitedCells, labelList &seedCells) const
Set the next cells in the advancing front algorithm.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
virtual Tuple2< scalar, point > interVolAndCentroid(const label srcCellI, const label tgtCellI)
Return the intersection volume and centroid between two cells.
#define WarningInFunction
Report a warning using Foam::Warning.
label nCells() const noexcept
Number of mesh cells.
const T2 & second() const noexcept
Access the second element.
virtual ~correctedCellVolumeWeightMethod()
Destructor.
scalar V_
Cell total volume in overlap region [m3].
List< label > labelList
A List of labels.
const T1 & first() const noexcept
Access the first element.
List< bool > boolList
A List of bools.
UIndirectList< bool > boolUIndList
UIndirectList of bools.
const scalarField & cellVolumes() const