40 correctedCellVolumeWeightMethod,
62 label srcCellI = srcSeedI;
63 label tgtCellI = tgtSeedI;
81 seedCells[srcCellI] = tgtCellI;
93 queuedCells.push_back(tgtCellI);
96 while (!queuedCells.empty())
99 tgtCellI = queuedCells.back();
100 queuedCells.pop_back();
101 visitedCells.push_back(tgtCellI);
113 srcToTgtAddr[srcCellI].
append(tgtCellI);
115 srcToTgtVec[srcCellI].
append(vol.
second()-tgtCc[tgtCellI]);
117 tgtToSrcAddr[tgtCellI].
append(srcCellI);
119 tgtToSrcVec[tgtCellI].
append(vol.
second()-srcCc[srcCellI]);
128 mapFlag[srcCellI] =
false;
142 while (srcCellI != -1);
145 forAll(srcToTgtCellAddr, i)
147 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
148 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
149 srcToTgtCellVec[i].
transfer(srcToTgtVec[i]);
152 forAll(tgtToSrcCellAddr, i)
154 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
155 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
156 tgtToSrcCellVec[i].
transfer(tgtToSrcVec[i]);
164 forAll(srcToTgtCellAddr, cellI)
167 scalar tgtVol =
sum(srcToTgtCellWght[cellI]);
169 if (
mag(srcVol) > ROOTVSMALL &&
mag((tgtVol-srcVol)/srcVol) > 1
e-6)
172 <<
"At cell " << cellI <<
" cc:" 175 <<
" total overlap volume:" << tgtVol
180 forAll(tgtToSrcCellAddr, cellI)
183 scalar srcVol =
sum(tgtToSrcCellWght[cellI]);
185 if (
mag(tgtVol) > ROOTVSMALL &&
mag((srcVol-tgtVol)/tgtVol) > 1
e-6)
188 <<
"At cell " << cellI <<
" cc:" 191 <<
" total overlap volume:" << srcVol
251 boolList mapFlag(src_.nCells(),
false);
257 label startSeedI = 0;
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
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.
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.
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.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
const scalarField & cellVolumes() const