48 return tgt_.pointInCell
50 src_.cellCentres()[srcCelli],
61 const label startSeedI,
66 const cellList& srcCells = src_.cells();
67 const faceList& srcFaces = src_.faces();
70 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
72 label srcI = srcCellIDs[i];
76 const point srcCtr(srcCells[srcI].centre(srcPts, srcFaces));
77 label tgtI = tgt_.cellTree().findInside(srcCtr);
79 if (tgtI != -1 && intersect(srcI, tgtI))
91 Pout<<
"could not find starting seed" <<
endl;
104 const label srcSeedI,
105 const label tgtSeedI,
122 label srcCelli = srcSeedI;
123 label tgtCelli = tgtSeedI;
128 srcToTgt[srcCelli].append(tgtCelli);
129 tgtToSrc[tgtCelli].append(srcCelli);
132 mapFlag[srcCelli] =
false;
135 V_ += srcVc[srcCelli];
147 while (srcCelli >= 0);
150 forAll(srcToTgtCellAddr, i)
152 srcToTgtCellWght[i] =
scalarList(srcToTgt[i].size(), srcVc[i]);
153 srcToTgtCellAddr[i].
transfer(srcToTgt[i]);
156 forAll(tgtToSrcCellAddr, i)
158 tgtToSrcCellWght[i] =
scalarList(tgtToSrc[i].size(), tgtVc[i]);
159 tgtToSrcCellAddr[i].
transfer(tgtToSrc[i]);
173 const labelList& srcNbr = src_.cellCells()[srcSeedI];
174 const labelList& tgtNbr = tgt_.cellCells()[tgtSeedI];
178 label srcI = srcNbr[i];
180 if (mapFlag[srcI] && (srcTgtSeed[srcI] == -1))
188 label tgtI = tgtNbr[j];
190 if (intersect(srcI, tgtI))
195 srcTgtSeed[srcI] = tgtI;
205 mapFlag[srcI] =
false;
212 srcSeedI = srcSeeds.
remove();
213 tgtSeedI = srcTgtSeed[srcSeedI];
243 return directAMI::typeName;
272 boolList mapFlag(src_.nCells(),
false);
278 label startSeedI = 0;
#define forAll(list, i)
Loop across all elements in list.
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
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.
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.
virtual const word & AMImethod() const
Return the corresponding AMI method for patch interpolation.
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.