62 const label startSeedI,
67 const cellList& srcCells = src_.cells();
68 const faceList& srcFaces = src_.faces();
71 for (label i = startSeedI; i < srcCellIDs.
size(); i++)
73 label srcI = srcCellIDs[i];
77 const point srcCtr(srcCells[srcI].centre(srcPts, srcFaces));
78 label tgtI = tgt_.cellTree().findInside(srcCtr);
80 if (tgtI != -1 && intersect(srcI, tgtI))
92 Pout<<
"could not find starting seed" <<
endl;
105 const label srcSeedI,
106 const label tgtSeedI,
123 label srcCelli = srcSeedI;
124 label tgtCelli = tgtSeedI;
129 srcToTgt[srcCelli].
append(tgtCelli);
130 tgtToSrc[tgtCelli].
append(srcCelli);
133 mapFlag[srcCelli] =
false;
136 V_ += srcVc[srcCelli];
148 while (srcCelli >= 0);
151 forAll(srcToTgtCellAddr, i)
153 srcToTgtCellWght[i] =
scalarList(srcToTgt[i].size(), srcVc[i]);
154 srcToTgtCellAddr[i].
transfer(srcToTgt[i]);
157 forAll(tgtToSrcCellAddr, i)
159 tgtToSrcCellWght[i] =
scalarList(tgtToSrc[i].size(), tgtVc[i]);
160 tgtToSrcCellAddr[i].
transfer(tgtToSrc[i]);
174 const labelList& srcNbr = src_.cellCells()[srcSeedI];
175 const labelList& tgtNbr = tgt_.cellCells()[tgtSeedI];
179 label srcI = srcNbr[i];
181 if (mapFlag[srcI] && (srcTgtSeed[srcI] == -1))
189 label tgtI = tgtNbr[j];
191 if (intersect(srcI, tgtI))
196 srcTgtSeed[srcI] = tgtI;
206 mapFlag[srcI] =
false;
213 srcSeedI = srcSeeds.
remove();
214 tgtSeedI = srcTgtSeed[srcSeedI];
270 boolList mapFlag(src_.nCells(),
false);
276 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.
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 append(const T &val)
Append an element at the end of the list.
void size(const label n)
Older name for setAddressableSize.
Direct (one-to-one cell correspondence) mesh-to-mesh interpolation class.
virtual bool findInitialSeeds(const labelList &srcCellIDs, const boolList &mapFlag, const label startSeedI, label &srcSeedI, label &tgtSeedI) const
Find indices of overlapping cells in src and tgt meshes - returns.
virtual ~directMethod()
Destructor.
virtual void calculateAddressing(labelListList &srcToTgtCellAddr, scalarListList &srcToTgtCellWght, labelListList &tgtToSrcCellAddr, scalarListList &tgtToSrcCellWght, 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 void appendToDirectSeeds(boolList &mapFlag, labelList &srcTgtSeed, DynamicList< label > &srcSeeds, label &srcSeedI, label &tgtSeedI) const
Append to list of src mesh seed indices.
virtual bool intersect(const label srcCelli, const label tgtCelli) const
Return the true if cells intersect.
Base class for mesh-to-mesh calculation methods.
const polyMesh & tgt_
Reference to the target mesh.
const polyMesh & src_
Reference to the source mesh.
Mesh consisting of general polyhedral cells.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
const vectorField & cellCentres() const
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
List< scalar > scalarList
A List of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UIndirectList< bool > boolUIndList
UIndirectList of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.