Loading...
Searching...
No Matches
meshToMeshMethod Class Referenceabstract

Base class for mesh-to-mesh calculation methods. More...

#include <meshToMeshMethod.H>

Inheritance diagram for meshToMeshMethod:
Collaboration diagram for meshToMeshMethod:

Public Member Functions

 TypeName ("meshToMeshMethod")
 Run-time type information.
 declareRunTimeSelectionTable (autoPtr, meshToMeshMethod, components,(const polyMesh &src, const polyMesh &tgt),(src, tgt))
 Declare runtime constructor selection table.
 meshToMeshMethod (const polyMesh &src, const polyMesh &tgt)
 Construct from source and target meshes.
virtual ~meshToMeshMethod ()
 Destructor.
virtual void calculate (labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)=0
 Calculate addressing and weights and optionally offset vectors.
const polyMeshsrc () const
 Return const access to the source mesh.
const polyMeshtgt () const
 Return const access to the target mesh.
scalar V () const
 Return const access to the overlap volume.
void writeConnectivity (const polyMesh &mesh1, const polyMesh &mesh2, const labelListList &mesh1ToMesh2Addr) const
 Write the connectivity (debugging).

Static Public Member Functions

static autoPtr< meshToMeshMethod > New (const word &methodName, const polyMesh &src, const polyMesh &tgt)
 Selector.

Protected Member Functions

labelList maskCells () const
 Return src cell IDs for the overlap region.
virtual bool intersect (const label srcCelli, const label tgtCelli) const
 Return the true if cells intersect.
virtual scalar interVol (const label srcCelli, const label tgtCelli) const
 Return the intersection volume between two cells.
virtual Tuple2< scalar, pointinterVolAndCentroid (const label srcCellI, const label tgtCellI)
 Return the intersection volume and centroid between two cells.
virtual void appendNbrCells (const label tgtCelli, const polyMesh &mesh, const labelUList &visitedTgtCells, DynamicList< label > &nbrTgtCellIDs) const
 Append target cell neighbour cells to cellIDs list.
virtual bool initialise (labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght) const

Protected Attributes

const polyMeshsrc_
 Reference to the source mesh.
const polyMeshtgt_
 Reference to the target mesh.
scalar V_
 Cell total volume in overlap region [m3].

Static Protected Attributes

static scalar tolerance_ = 1e-6
 Tolerance used in volume overlap calculations.

Detailed Description

Base class for mesh-to-mesh calculation methods.

Source files

Definition at line 47 of file meshToMeshMethod.H.

Constructor & Destructor Documentation

◆ meshToMeshMethod()

meshToMeshMethod ( const polyMesh & src,
const polyMesh & tgt )

Construct from source and target meshes.

Definition at line 204 of file meshToMeshMethod.C.

References src(), src_, tgt(), tgt_, and V_.

Here is the call graph for this function:

◆ ~meshToMeshMethod()

~meshToMeshMethod ( )
virtual

Destructor.

Definition at line 228 of file meshToMeshMethod.C.

Member Function Documentation

◆ maskCells()

Foam::labelList maskCells ( ) const
protected

Return src cell IDs for the overlap region.

Definition at line 40 of file meshToMeshMethod.C.

References cells, Foam::endl(), boundBox::inflate(), boundBox::overlaps(), Foam::Pout, src_, and tgt_.

Referenced by cellVolumeWeightMethod::calculate(), correctedCellVolumeWeightMethod::calculate(), directMethod::calculate(), and mapNearestMethod::calculate().

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

◆ intersect()

bool intersect ( const label srcCelli,
const label tgtCelli ) const
protectedvirtual

Return the true if cells intersect.

Reimplemented in directMethod.

Definition at line 66 of file meshToMeshMethod.C.

References src_, tgt_, and tolerance_.

Referenced by cellVolumeWeightMethod::findInitialSeeds(), and cellVolumeWeightMethod::setNextCells().

Here is the caller graph for this function:

◆ interVol()

Foam::scalar interVol ( const label srcCelli,
const label tgtCelli ) const
protectedvirtual

Return the intersection volume between two cells.

Definition at line 90 of file meshToMeshMethod.C.

References tetOverlapVolume::cellCellOverlapVolumeMinDecomp(), src_, and tgt_.

Referenced by cellVolumeWeightMethod::calculateAddressing().

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

◆ interVolAndCentroid()

Foam::Tuple2< Foam::scalar, Foam::point > interVolAndCentroid ( const label srcCellI,
const label tgtCellI )
protectedvirtual

Return the intersection volume and centroid between two cells.

Definition at line 114 of file meshToMeshMethod.C.

References tetOverlapVolume::cellCellOverlapMomentMinDecomp(), Tuple2< T1, T2 >::first(), Tuple2< T1, T2 >::second(), src_, tgt_, and Foam::Zero.

Referenced by correctedCellVolumeWeightMethod::calculateAddressing().

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

◆ appendNbrCells()

void appendNbrCells ( const label tgtCelli,
const polyMesh & mesh,
const labelUList & visitedTgtCells,
DynamicList< label > & nbrTgtCellIDs ) const
protectedvirtual

Append target cell neighbour cells to cellIDs list.

Definition at line 149 of file meshToMeshMethod.C.

References UList< T >::contains(), mesh, and DynamicList< T, SizeMin >::push_uniq().

Referenced by cellVolumeWeightMethod::calculateAddressing(), correctedCellVolumeWeightMethod::calculateAddressing(), and mapNearestMethod::findNearestCell().

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

◆ initialise()

bool initialise ( labelListList & srcToTgtAddr,
scalarListList & srcToTgtWght,
labelListList & tgtToTgtAddr,
scalarListList & tgtToTgtWght ) const
protectedvirtual

Definition at line 170 of file meshToMeshMethod.C.

References Foam::endl(), Foam::Pout, List< T >::setSize(), src_, and tgt_.

Referenced by cellVolumeWeightMethod::calculate(), correctedCellVolumeWeightMethod::calculate(), directMethod::calculate(), and mapNearestMethod::calculate().

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

◆ TypeName()

TypeName ( "meshToMeshMethod" )

Run-time type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
meshToMeshMethod ,
components ,
(const polyMesh &src, const polyMesh &tgt) ,
(src, tgt)  )

Declare runtime constructor selection table.

References src(), and tgt().

Here is the call graph for this function:

◆ New()

Foam::autoPtr< Foam::meshToMeshMethod > New ( const word & methodName,
const polyMesh & src,
const polyMesh & tgt )
static

Selector.

Definition at line 26 of file meshToMeshMethodNew.C.

References DebugInfo, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInLookup, src(), and tgt().

Here is the call graph for this function:

◆ calculate()

virtual void calculate ( labelListList & srcToTgtAddr,
scalarListList & srcToTgtWght,
pointListList & srcToTgtVec,
labelListList & tgtToSrcAddr,
scalarListList & tgtToSrcWght,
pointListList & tgtToSrcVec )
pure virtual

Calculate addressing and weights and optionally offset vectors.

Implemented in cellVolumeWeightMethod, correctedCellVolumeWeightMethod, directMethod, mapNearestMethod, and waveMethod.

◆ src()

◆ tgt()

◆ V()

Foam::scalar V ( ) const
inline

Return const access to the overlap volume.

Definition at line 33 of file meshToMeshMethodI.H.

References V_.

◆ writeConnectivity()

void writeConnectivity ( const polyMesh & mesh1,
const polyMesh & mesh2,
const labelListList & mesh1ToMesh2Addr ) const

Member Data Documentation

◆ src_

◆ tgt_

◆ V_

◆ tolerance_

Foam::scalar tolerance_ = 1e-6
staticprotected

Tolerance used in volume overlap calculations.

Definition at line 72 of file meshToMeshMethod.H.

Referenced by cellVolumeWeightMethod::calculateAddressing(), correctedCellVolumeWeightMethod::calculateAddressing(), and intersect().


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