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;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
T remove()
Remove and return the last element. Fatal on an empty list.
void append(const T &val)
Copy append an element to the end of this list.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Return first.
const T2 & second() const noexcept
Return second.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
Cell-volume-weighted mesh-to-mesh interpolation class.
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.
Cell-volume-weighted mesh-to-mesh interpolation class.
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.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)
Calculate addressing and weights and optionally offset vectors.
virtual ~correctedCellVolumeWeightMethod()
Destructor.
Base class for mesh-to-mesh calculation methods.
const polyMesh & tgt_
Reference to the target mesh.
const polyMesh & src_
Reference to the source mesh.
static scalar tolerance_
Tolerance used in volume overlap calculations.
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.
scalar V_
Cell total volume in overlap region [m3].
virtual Tuple2< scalar, point > interVolAndCentroid(const label srcCellI, const label tgtCellI)
Return the intersection volume and centroid between two cells.
Mesh consisting of general polyhedral cells.
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
label nCells() const noexcept
Number of mesh cells.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
UIndirectList< bool > boolUIndList
UIndirectList of bools.
#define forAll(list, i)
Loop across all elements in list.