All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mapNearestMethod Class Reference

Map nearest mesh-to-mesh interpolation class. More...

Inheritance diagram for mapNearestMethod:
Collaboration diagram for mapNearestMethod:

Public Member Functions

 TypeName ("mapNearest")
 Run-time type information. More...
 
 mapNearestMethod (const polyMesh &src, const polyMesh &tgt)
 Construct from source and target meshes. More...
 
 mapNearestMethod (const mapNearestMethod &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~mapNearestMethod ()
 Destructor. More...
 
virtual void calculate (labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
 Calculate addressing and weights. More...
 
void operator= (const mapNearestMethod &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from meshToMeshMethod
 TypeName ("meshToMeshMethod")
 Run-time type information. More...
 
 declareRunTimeSelectionTable (autoPtr, meshToMeshMethod, components,(const polyMesh &src, const polyMesh &tgt),(src, tgt))
 Declare runtime constructor selection table. More...
 
 meshToMeshMethod (const polyMesh &src, const polyMesh &tgt)
 Construct from source and target meshes. More...
 
 meshToMeshMethod (const meshToMeshMethod &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~meshToMeshMethod ()
 Destructor. More...
 
const polyMeshsrc () const
 Return const access to the source mesh. More...
 
const polyMeshtgt () const
 Return const access to the target mesh. More...
 
scalar V () const
 Return const access to the overlap volume. More...
 
void writeConnectivity (const polyMesh &mesh1, const polyMesh &mesh2, const labelListList &mesh1ToMesh2Addr) const
 Write the connectivity (debugging) More...
 
void operator= (const meshToMeshMethod &)=delete
 Disallow default bitwise assignment. More...
 

Protected Member Functions

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. More...
 
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. More...
 
virtual void findNearestCell (const polyMesh &mesh1, const polyMesh &mesh2, const label cell1, label &cell2) const
 Find the nearest cell on mesh2 for cell1 on mesh1. More...
 
virtual void setNextNearestCells (label &startSeedI, label &srcCelli, label &tgtCelli, boolList &mapFlag, const labelList &srcCellIDs) const
 Set the next cells for the marching front algorithm. More...
 
virtual label findMappedSrcCell (const label tgtCelli, const List< DynamicList< label >> &tgtToSrc) const
 Find a source cell mapped to target cell tgtCelli. More...
 
- Protected Member Functions inherited from meshToMeshMethod
labelList maskCells () const
 Return src cell IDs for the overlap region. More...
 
virtual bool intersect (const label srcCelli, const label tgtCelli) const
 Return the true if cells intersect. More...
 
virtual scalar interVol (const label srcCelli, const label tgtCelli) const
 Return the intersection volume between two cells. More...
 
virtual void appendNbrCells (const label tgtCelli, const polyMesh &mesh, const DynamicList< label > &visitedTgtCells, DynamicList< label > &nbrTgtCellIDs) const
 Append target cell neighbour cells to cellIDs list. More...
 
virtual bool initialise (labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght) const
 

Additional Inherited Members

- Static Public Member Functions inherited from meshToMeshMethod
static autoPtr< meshToMeshMethodNew (const word &methodName, const polyMesh &src, const polyMesh &tgt)
 Selector. More...
 
- Protected Attributes inherited from meshToMeshMethod
const polyMeshsrc_
 Reference to the source mesh. More...
 
const polyMeshtgt_
 Reference to the target mesh. More...
 
scalar V_
 Cell total volume in overlap region [m^3]. More...
 
- Static Protected Attributes inherited from meshToMeshMethod
static scalar tolerance_ = 1e-6
 Tolerance used in volume overlap calculations. More...
 

Detailed Description

Map nearest mesh-to-mesh interpolation class.

Not volume conservative.

  • cells outside other meshes bounding box do not get mapped (initial filtering)
  • all remaining cells will be mapped (with weight 1!)
  • so take care when mapping meshes with different bounding boxes!
Source files

Definition at line 54 of file mapNearestMethod.H.

Constructor & Destructor Documentation

◆ mapNearestMethod() [1/2]

mapNearestMethod ( const polyMesh src,
const polyMesh tgt 
)

Construct from source and target meshes.

Definition at line 331 of file mapNearestMethod.C.

Referenced by mapNearestMethod::findMappedSrcCell().

Here is the caller graph for this function:

◆ mapNearestMethod() [2/2]

mapNearestMethod ( const mapNearestMethod )
delete

Disallow default bitwise copy construction.

◆ ~mapNearestMethod()

~mapNearestMethod ( )
virtual

Destructor.

Definition at line 342 of file mapNearestMethod.C.

References mapNearestMethod::calculate().

Here is the call graph for this function:

Member Function Documentation

◆ findInitialSeeds()

bool findInitialSeeds ( const labelList srcCellIDs,
const boolList mapFlag,
const label  startSeedI,
label srcSeedI,
label tgtSeedI 
) const
protectedvirtual

Find indices of overlapping cells in src and tgt meshes - returns.

true if found a matching pair

Definition at line 43 of file mapNearestMethod.C.

References Foam::abort(), mapNearestMethod::calculateAddressing(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::Pout, and List< T >::size().

Here is the call graph for this function:

◆ calculateAddressing()

void calculateAddressing ( labelListList srcToTgtCellAddr,
scalarListList srcToTgtCellWght,
labelListList tgtToSrcCellAddr,
scalarListList tgtToSrcCellWght,
const label  srcSeedI,
const label  tgtSeedI,
const labelList srcCellIDs,
boolList mapFlag,
label startSeedI 
)
protectedvirtual

Calculate the mesh-to-mesh addressing and weights.

Definition at line 93 of file mapNearestMethod.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), mapNearestMethod::findNearestCell(), forAll, Foam::magSqr(), List< T >::size(), and List< T >::transfer().

Referenced by mapNearestMethod::findInitialSeeds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findNearestCell()

void findNearestCell ( const polyMesh mesh1,
const polyMesh mesh2,
const label  cell1,
label cell2 
) const
protectedvirtual

Find the nearest cell on mesh2 for cell1 on mesh1.

Definition at line 205 of file mapNearestMethod.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::constant::physicoChemical::c2, primitiveMesh::cellCentres(), Foam::magSqr(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::remove(), mapNearestMethod::setNextNearestCells(), and List< T >::size().

Referenced by mapNearestMethod::calculateAddressing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNextNearestCells()

void setNextNearestCells ( label startSeedI,
label srcCelli,
label tgtCelli,
boolList mapFlag,
const labelList srcCellIDs 
) const
protectedvirtual

Set the next cells for the marching front algorithm.

Definition at line 242 of file mapNearestMethod.C.

References mapNearestMethod::findMappedSrcCell(), forAll, and List< T >::size().

Referenced by mapNearestMethod::findNearestCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMappedSrcCell()

Foam::label findMappedSrcCell ( const label  tgtCelli,
const List< DynamicList< label >> &  tgtToSrc 
) const
protectedvirtual

Find a source cell mapped to target cell tgtCelli.

Definition at line 285 of file mapNearestMethod.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::findIndex(), forAll, mapNearestMethod::mapNearestMethod(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::remove(), and List< T >::size().

Referenced by mapNearestMethod::setNextNearestCells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "mapNearest"  )

Run-time type information.

◆ calculate()

void calculate ( labelListList srcToTgtAddr,
scalarListList srcToTgtWght,
labelListList tgtToTgtAddr,
scalarListList tgtToTgtWght 
)
virtual

Calculate addressing and weights.

Implements meshToMeshMethod.

Definition at line 349 of file mapNearestMethod.C.

Referenced by mapNearestMethod::~mapNearestMethod().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const mapNearestMethod )
delete

Disallow default bitwise assignment.


The documentation for this class was generated from the following files: