meshToMeshMethod Class Referenceabstract

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

Inheritance diagram for meshToMeshMethod:
[legend]
Collaboration diagram for meshToMeshMethod:
[legend]

Public Member Functions

 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...
 
virtual ~meshToMeshMethod ()
 Destructor. More...
 
virtual void calculate (labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)=0
 Calculate addressing and weights and optionally offset vectors. 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...
 

Static Public Member Functions

static autoPtr< meshToMeshMethodNew (const word &methodName, const polyMesh &src, const polyMesh &tgt)
 Selector. More...
 

Protected Member Functions

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 Tuple2< scalar, pointinterVolAndCentroid (const label srcCellI, const label tgtCellI)
 Return the intersection volume and centroid 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
 

Protected Attributes

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

Static Protected Attributes

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

Detailed Description

Base class for mesh-to-mesh calculation methods.

Source files

Definition at line 51 of file meshToMeshMethod.H.

Constructor & Destructor Documentation

◆ meshToMeshMethod()

meshToMeshMethod ( const polyMesh src,
const polyMesh tgt 
)

Construct from source and target meshes.

Definition at line 240 of file meshToMeshMethod.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ ~meshToMeshMethod()

~meshToMeshMethod ( )
virtual

Destructor.

Definition at line 263 of file meshToMeshMethod.C.

Member Function Documentation

◆ maskCells()

Foam::labelList maskCells ( ) const
protected

Return src cell IDs for the overlap region.

Definition at line 47 of file meshToMeshMethod.C.

References polyMesh::bounds(), cells, primitiveMesh::cells(), Foam::expressions::patchExpr::debug, Foam::endl(), polyMesh::faces(), forAll, boundBox::inflate(), boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), primitiveMesh::nCells(), boundBox::overlaps(), points, polyMesh::points(), Foam::Pout, meshToMeshMethod::src_, and meshToMeshMethod::tgt_.

Here is the call 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 81 of file meshToMeshMethod.C.

References boundBox::add(), and UList< T >::size().

Here is the call 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 112 of file meshToMeshMethod.C.

References boundBox::add(), tetOverlapVolume::cellCellOverlapVolumeMinDecomp(), and UList< T >::size().

Here is the call 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 143 of file meshToMeshMethod.C.

References boundBox::add(), tetOverlapVolume::cellCellOverlapMomentMinDecomp(), Tuple2< T1, T2 >::first(), Tuple2< T1, T2 >::second(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ appendNbrCells()

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

Append target cell neighbour cells to cellIDs list.

Definition at line 185 of file meshToMeshMethod.C.

References DynamicList< T, SizeMin >::appendUniq(), primitiveMesh::cellCells(), and mesh.

Here is the call graph for this function:

◆ initialise()

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

Definition at line 206 of file meshToMeshMethod.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::Pout, and List< T >::setSize().

Here is the call 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.

◆ New()

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

Selector.

Definition at line 34 of file meshToMeshMethodNew.C.

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

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 mapNearestMethod, directMethod, cellVolumeWeightMethod, correctedCellVolumeWeightMethod, and waveMethod.

◆ src()

const Foam::polyMesh & src ( ) const
inline

Return const access to the source mesh.

Definition at line 28 of file meshToMeshMethodI.H.

References meshToMeshMethod::src_.

◆ tgt()

const Foam::polyMesh & tgt ( ) const
inline

Return const access to the target mesh.

Definition at line 34 of file meshToMeshMethodI.H.

◆ V()

Foam::scalar V ( ) const
inline

Return const access to the overlap volume.

Definition at line 40 of file meshToMeshMethodI.H.

◆ writeConnectivity()

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

Write the connectivity (debugging)

Definition at line 270 of file meshToMeshMethod.C.

References Foam::constant::universal::c, primitiveMesh::cellCentres(), primitiveMesh::cells(), Foam::endl(), polyMesh::faces(), forAll, UPstream::myProcNo(), Foam::name(), IOobject::name(), primitiveMesh::nCells(), Foam::nl, os(), p, UPstream::parRun(), polyMesh::points(), Foam::Pout, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

Member Data Documentation

◆ src_

const polyMesh& src_
protected

Reference to the source mesh.

Definition at line 59 of file meshToMeshMethod.H.

Referenced by meshToMeshMethod::maskCells(), and meshToMeshMethod::src().

◆ tgt_

const polyMesh& tgt_
protected

Reference to the target mesh.

Definition at line 62 of file meshToMeshMethod.H.

Referenced by meshToMeshMethod::maskCells().

◆ V_

scalar V_
protected

Cell total volume in overlap region [m3].

Definition at line 65 of file meshToMeshMethod.H.

◆ tolerance_

Foam::scalar tolerance_ = 1e-6
staticprotected

Tolerance used in volume overlap calculations.

Definition at line 68 of file meshToMeshMethod.H.


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