diff --git a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.C b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.C index 9f3674700cd958090647ac3be3c7cfe7847304c0..2a43bb7ba2f2a54d8cd9f4df5e64934c60bd310a 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.C +++ b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.C @@ -38,6 +38,16 @@ namespace Foam // * * * * * * * * * * * * 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 ( const labelList& srcCellIDs, diff --git a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.H b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.H index 1c9f489a83c3fc8f19fb6db0757bb0c00d361c31..2effe6d2b0baf7faa420fc2bbf913e82d89285fa 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.H +++ b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/direct/directMethod.H @@ -56,9 +56,16 @@ protected: // 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 // true if found a matching pair - bool findInitialSeeds + virtual bool findInitialSeeds ( const labelList& srcCellIDs, const boolList& mapFlag, @@ -68,7 +75,7 @@ protected: ) const; //- Calculate the mesh-to-mesh addressing and weights - void calculateAddressing + virtual void calculateAddressing ( labelListList& srcToTgtCellAddr, scalarListList& srcToTgtCellWght, @@ -82,7 +89,7 @@ protected: ); //- Append to list of src mesh seed indices - void appendToDirectSeeds + virtual void appendToDirectSeeds ( boolList& mapFlag, labelList& srcTgtSeed, diff --git a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/mapNearest/mapNearestMethod.H b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/mapNearest/mapNearestMethod.H index 813c46683ff5671e27ac3fd0bd3f6e44914e70a1..5ba76a30703e4557b5fc134394ed0b5d6e031442 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/mapNearest/mapNearestMethod.H +++ b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/mapNearest/mapNearestMethod.H @@ -58,7 +58,7 @@ protected: //- Find indices of overlapping cells in src and tgt meshes - returns // true if found a matching pair - bool findInitialSeeds + virtual bool findInitialSeeds ( const labelList& srcCellIDs, const boolList& mapFlag, @@ -68,7 +68,7 @@ protected: ) const; //- Calculate the mesh-to-mesh addressing and weights - void calculateAddressing + virtual void calculateAddressing ( labelListList& srcToTgtCellAddr, scalarListList& srcToTgtCellWght, @@ -82,7 +82,7 @@ protected: ); //- Find the nearest cell on mesh2 for cell1 on mesh1 - void findNearestCell + virtual void findNearestCell ( const polyMesh& mesh1, const polyMesh& mesh2, @@ -91,7 +91,7 @@ protected: ) const; //- Set the next cells for the marching front algorithm - void setNextNearestCells + virtual void setNextNearestCells ( label& startSeedI, label& srcCellI, @@ -101,7 +101,7 @@ protected: ) const; //- Find a source cell mapped to target cell tgtCellI - label findMappedSrcCell + virtual label findMappedSrcCell ( const label tgtCellI, const List<DynamicList<label> >& tgtToSrc diff --git a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/meshToMeshMethod/meshToMeshMethod.H b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/meshToMeshMethod/meshToMeshMethod.H index 3338fa5349569629ec72684a0304702c7323661e..cf3e693f8bdad435548948db64e2128097d893b8 100644 --- a/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/meshToMeshMethod/meshToMeshMethod.H +++ b/src/sampling/meshToMeshInterpolation/meshToMeshNew/calcMethod/meshToMeshMethod/meshToMeshMethod.H @@ -72,13 +72,21 @@ protected: labelList maskCells() const; //- 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 - 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 - void appendNbrCells + virtual void appendNbrCells ( const label tgtCellI, const polyMesh& mesh, @@ -86,7 +94,7 @@ protected: DynamicList<label>& nbrTgtCellIDs ) const; - bool initialise + virtual bool initialise ( labelListList& srcToTgtAddr, scalarListList& srcToTgtWght,