ENH: Updated mesh-to-mesh interpolation using direct method

This commit is contained in:
andy
2013-05-07 12:18:59 +01:00
parent 926357f55c
commit b07d3f1c65
4 changed files with 37 additions and 12 deletions

View File

@ -38,6 +38,16 @@ namespace Foam
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::directMethod::intersect
(
const label srcCellI,
const label tgtCellI
) const
{
return tgt_.pointInCell(src_.cellCentres()[srcCellI], tgtCellI);
}
bool Foam::directMethod::findInitialSeeds bool Foam::directMethod::findInitialSeeds
( (
const labelList& srcCellIDs, const labelList& srcCellIDs,

View File

@ -56,9 +56,16 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Return the true if cells intersect
virtual bool intersect
(
const label srcCellI,
const label tgtCellI
) const;
//- Find indices of overlapping cells in src and tgt meshes - returns //- Find indices of overlapping cells in src and tgt meshes - returns
// true if found a matching pair // true if found a matching pair
bool findInitialSeeds virtual bool findInitialSeeds
( (
const labelList& srcCellIDs, const labelList& srcCellIDs,
const boolList& mapFlag, const boolList& mapFlag,
@ -68,7 +75,7 @@ protected:
) const; ) const;
//- Calculate the mesh-to-mesh addressing and weights //- Calculate the mesh-to-mesh addressing and weights
void calculateAddressing virtual void calculateAddressing
( (
labelListList& srcToTgtCellAddr, labelListList& srcToTgtCellAddr,
scalarListList& srcToTgtCellWght, scalarListList& srcToTgtCellWght,
@ -82,7 +89,7 @@ protected:
); );
//- Append to list of src mesh seed indices //- Append to list of src mesh seed indices
void appendToDirectSeeds virtual void appendToDirectSeeds
( (
boolList& mapFlag, boolList& mapFlag,
labelList& srcTgtSeed, labelList& srcTgtSeed,

View File

@ -58,7 +58,7 @@ protected:
//- Find indices of overlapping cells in src and tgt meshes - returns //- Find indices of overlapping cells in src and tgt meshes - returns
// true if found a matching pair // true if found a matching pair
bool findInitialSeeds virtual bool findInitialSeeds
( (
const labelList& srcCellIDs, const labelList& srcCellIDs,
const boolList& mapFlag, const boolList& mapFlag,
@ -68,7 +68,7 @@ protected:
) const; ) const;
//- Calculate the mesh-to-mesh addressing and weights //- Calculate the mesh-to-mesh addressing and weights
void calculateAddressing virtual void calculateAddressing
( (
labelListList& srcToTgtCellAddr, labelListList& srcToTgtCellAddr,
scalarListList& srcToTgtCellWght, scalarListList& srcToTgtCellWght,
@ -82,7 +82,7 @@ protected:
); );
//- Find the nearest cell on mesh2 for cell1 on mesh1 //- Find the nearest cell on mesh2 for cell1 on mesh1
void findNearestCell virtual void findNearestCell
( (
const polyMesh& mesh1, const polyMesh& mesh1,
const polyMesh& mesh2, const polyMesh& mesh2,
@ -91,7 +91,7 @@ protected:
) const; ) const;
//- Set the next cells for the marching front algorithm //- Set the next cells for the marching front algorithm
void setNextNearestCells virtual void setNextNearestCells
( (
label& startSeedI, label& startSeedI,
label& srcCellI, label& srcCellI,
@ -101,7 +101,7 @@ protected:
) const; ) const;
//- Find a source cell mapped to target cell tgtCellI //- Find a source cell mapped to target cell tgtCellI
label findMappedSrcCell virtual label findMappedSrcCell
( (
const label tgtCellI, const label tgtCellI,
const List<DynamicList<label> >& tgtToSrc const List<DynamicList<label> >& tgtToSrc

View File

@ -72,13 +72,21 @@ protected:
labelList maskCells() const; labelList maskCells() const;
//- Return the true if cells intersect //- Return the true if cells intersect
bool intersect(const label srcCellI, const label tgtCellI) const; virtual bool intersect
(
const label srcCellI,
const label tgtCellI
) const;
//- Return the intersection volume between two cells //- Return the intersection volume between two cells
scalar interVol(const label srcCellI, const label tgtCellI) const; virtual scalar interVol
(
const label srcCellI,
const label tgtCellI
) const;
//- Append target cell neihgbour cells to cellIDs list //- Append target cell neihgbour cells to cellIDs list
void appendNbrCells virtual void appendNbrCells
( (
const label tgtCellI, const label tgtCellI,
const polyMesh& mesh, const polyMesh& mesh,
@ -86,7 +94,7 @@ protected:
DynamicList<label>& nbrTgtCellIDs DynamicList<label>& nbrTgtCellIDs
) const; ) const;
bool initialise virtual bool initialise
( (
labelListList& srcToTgtAddr, labelListList& srcToTgtAddr,
scalarListList& srcToTgtWght, scalarListList& srcToTgtWght,