47 return tgt_.pointInCell
49 src_.cellCentres()[srcCelli],
60 const label startSeedI,
65 const cellList& srcCells = src_.cells();
66 const faceList& srcFaces = src_.faces();
69 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
71 label srcI = srcCellIDs[i];
75 const point srcCtr(srcCells[srcI].centre(srcPts, srcFaces));
76 label tgtI = tgt_.cellTree().findInside(srcCtr);
78 if (tgtI != -1 && intersect(srcI, tgtI))
90 Pout<<
"could not find starting seed" <<
endl;
103 const label srcSeedI,
104 const label tgtSeedI,
121 label srcCelli = srcSeedI;
122 label tgtCelli = tgtSeedI;
127 srcToTgt[srcCelli].
append(tgtCelli);
128 tgtToSrc[tgtCelli].append(srcCelli);
131 mapFlag[srcCelli] =
false;
134 V_ += srcVc[srcCelli];
146 while (srcCelli >= 0);
149 forAll(srcToTgtCellAddr, i)
151 srcToTgtCellWght[i] =
scalarList(srcToTgt[i].size(), srcVc[i]);
152 srcToTgtCellAddr[i].
transfer(srcToTgt[i]);
155 forAll(tgtToSrcCellAddr, i)
157 tgtToSrcCellWght[i] =
scalarList(tgtToSrc[i].size(), tgtVc[i]);
158 tgtToSrcCellAddr[i].
transfer(tgtToSrc[i]);
172 const labelList& srcNbr = src_.cellCells()[srcSeedI];
173 const labelList& tgtNbr = tgt_.cellCells()[tgtSeedI];
177 label srcI = srcNbr[i];
179 if (mapFlag[srcI] && (srcTgtSeed[srcI] == -1))
187 label tgtI = tgtNbr[j];
189 if (intersect(srcI, tgtI))
194 srcTgtSeed[srcI] = tgtI;
204 mapFlag[srcI] =
false;
211 srcSeedI = srcSeeds.
remove();
212 tgtSeedI = srcTgtSeed[srcSeedI];
265 boolList mapFlag(src_.nCells(),
false);
271 label startSeedI = 0;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
directMethod(const polyMesh &src, const polyMesh &tgt)
Construct from source and target meshes.
Macros for easy insertion into run-time selection tables.
virtual bool intersect(const label srcCelli, const label tgtCelli) const
Return the true if cells intersect.
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 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.
void append(const T &)
Append an element at the end of the list.
List< scalar > scalarList
A List of scalars.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual void appendToDirectSeeds(boolList &mapFlag, labelList &srcTgtSeed, DynamicList< label > &srcSeeds, label &srcSeedI, label &tgtSeedI) const
Append to list of src mesh seed indices.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
virtual ~directMethod()
Destructor.
Base class for mesh-to-mesh calculation methods.
T remove()
Remove and return the top element.
prefixOSstream Pout(cout, "Pout")
A List with indirect addressing.
Mesh consisting of general polyhedral cells.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.