cellsToCells Class Referenceabstract

Class to calculate interpolative addressing and weights between the cells of two overlapping meshes. More...

Inheritance diagram for cellsToCells:
Collaboration diagram for cellsToCells:

Public Member Functions

 TypeName ("cellsToCells")
 Run-time type information. More...
 
 declareRunTimeSelectionTable (autoPtr, cellsToCells, word,(),())
 Declare runtime constructor selection table. More...
 
 cellsToCells ()
 Construct null. More...
 
 cellsToCells (const cellsToCells &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~cellsToCells ()
 Destructor. More...
 
label singleProcess () const
 Index of the processor holding all cells of the cellsToCells,. More...
 
bool isSingleProcess () const
 Is this intersection on a single process? More...
 
PackedBoolList srcCoupled () const
 Return a list indicating which source cells are coupled. More...
 
PackedBoolList tgtCoupled () const
 Return a list indicating which target cells are coupled. More...
 
template<class Type >
tmp< Field< Type > > srcToTgt (const Field< Type > &srcFld) const
 Interpolate a source cell field to the target with no left. More...
 
template<class Type >
tmp< Field< Type > > srcToTgt (const Field< Type > &srcFld, const Field< Type > &leftOverTgtFld) const
 Interpolate a source cell field to the target with left over. More...
 
template<class Type >
tmp< Field< Type > > tgtToSrc (const Field< Type > &tgtFld) const
 Interpolate a target cell field to the source with no left. More...
 
template<class Type >
tmp< Field< Type > > tgtToSrc (const Field< Type > &tgtFld, const Field< Type > &leftOverSrcFld) const
 Interpolate a target cell field to the source with left. More...
 
remote srcToTgtPoint (const polyMesh &tgtMesh, const label srcCelli, const point &p) const
 Find the target processor and cell associated with a point in a. More...
 
scalar update (const polyMesh &srcMesh, const polyMesh &tgtMesh)
 Update addressing and weights for the given meshes. Returns the. More...
 
void operator= (const cellsToCells &)=delete
 Disallow default bitwise assignment. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > srcToTgt (const Field< Type > &srcFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > srcToTgt (const Field< Type > &srcFld, const Field< Type > &leftOverTgtFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > tgtToSrc (const Field< Type > &tgtFld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > tgtToSrc (const Field< Type > &tgtFld, const Field< Type > &leftOverSrcFld) const
 

Static Public Member Functions

static autoPtr< cellsToCellsNew (const word &cellsToCellsType)
 Select from name. More...
 

Protected Member Functions

void initialise (const polyMesh &srcMesh, const polyMesh &tgtMesh)
 Initialise the addressing and weights. More...
 
virtual scalar calculate (const polyMesh &srcMesh, const polyMesh &tgtMesh)=0
 Calculate the addressing and weights. More...
 
virtual void normalise (const polyMesh &mesh, labelListList &localOtherCells, scalarListList &weights) const =0
 Normalise the weights for a given mesh. More...
 
labelList maskCells (const polyMesh &srcMesh, const polyMesh &tgtMesh) const
 Return src cell IDs for the overlap region. More...
 
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...
 
labelListList tgtMeshSendCells (const polyMesh &srcMesh, const polyMesh &tgtMesh) const
 Determine which target cells need to be sent to the source. More...
 
void trimLocalTgt ()
 Trim the local target addressing and mesh so that communication. More...
 

Static Protected Member Functions

static List< remotedistributeMesh (const distributionMap &map, const polyMesh &mesh, autoPtr< polyMesh > &localMeshPtr)
 Distribute a mesh given its distribution map. More...
 

Protected Attributes

label singleProcess_
 Index of processor that holds all of both sides, or -1. More...
 
labelListList srcLocalTgtCells_
 For each source cell, the coupled local target cells. More...
 
labelListList tgtLocalSrcCells_
 For each target cell, the coupled local source cells. More...
 
scalarListList srcWeights_
 For each source cell, the coupled target weights. More...
 
scalarListList tgtWeights_
 For each target cell, the coupled source weights. More...
 
autoPtr< distributionMapsrcMapPtr_
 Map from source patch cells to target-local source patch cells. More...
 
autoPtr< distributionMaptgtMapPtr_
 Map from target patch cells to source-local target patch cells. More...
 
autoPtr< List< remote > > localSrcProcCellsPtr_
 When running in parallel, a map from local source cell index to. More...
 
autoPtr< List< remote > > localTgtProcCellsPtr_
 When running in parallel, a map from local target cell index to. More...
 
autoPtr< polyMeshlocalTgtMeshPtr_
 The target mesh, distributed locally to the source. More...
 

Detailed Description

Class to calculate interpolative addressing and weights between the cells of two overlapping meshes.

Source files

Definition at line 55 of file cellsToCells.H.

Constructor & Destructor Documentation

◆ cellsToCells() [1/2]

Construct null.

Definition at line 139 of file cellsToCells.C.

◆ cellsToCells() [2/2]

cellsToCells ( const cellsToCells )
delete

Disallow default bitwise copy construction.

◆ ~cellsToCells()

~cellsToCells ( )
virtual

Destructor.

Definition at line 156 of file cellsToCells.C.

Member Function Documentation

◆ initialise()

void initialise ( const polyMesh srcMesh,
const polyMesh tgtMesh 
)
protected

Initialise the addressing and weights.

Definition at line 46 of file cellsToCells.C.

References List< T >::clear(), forAll, primitiveMesh::nCells(), List< T >::setSize(), cellsToCells::srcLocalTgtCells_, cellsToCells::srcWeights_, cellsToCells::tgtLocalSrcCells_, and cellsToCells::tgtWeights_.

Here is the call graph for this function:

◆ calculate()

virtual scalar calculate ( const polyMesh srcMesh,
const polyMesh tgtMesh 
)
protectedpure virtual

Calculate the addressing and weights.

Implemented in nearest, matching, and intersection.

◆ normalise()

virtual void normalise ( const polyMesh mesh,
labelListList localOtherCells,
scalarListList weights 
) const
protectedpure virtual

Normalise the weights for a given mesh.

Implemented in nearest, matching, and intersection.

◆ maskCells()

Foam::labelList maskCells ( const polyMesh srcMesh,
const polyMesh tgtMesh 
) const
protected

◆ appendNbrCells()

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

Append target cell neighbour cells to cellIDs list.

Definition at line 109 of file cellsToCells.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), primitiveMesh::cellCells(), Foam::findIndex(), and forAll.

Here is the call graph for this function:

◆ tgtMeshSendCells()

Foam::labelListList tgtMeshSendCells ( const polyMesh srcMesh,
const polyMesh tgtMesh 
) const
protected

Determine which target cells need to be sent to the source.

This is done before intersection. Bound boxes are used to estimate what cells will intersect.

Definition at line 55 of file cellsToCellsParallelOps.C.

References List< T >::append(), primitiveMesh::cells(), polyMesh::faces(), forAll, Pstream::gatherList(), UPstream::myProcNo(), primitiveMesh::nCells(), UPstream::nProcs(), polyMesh::points(), Pstream::scatterList(), and List< T >::transfer().

Here is the call graph for this function:

◆ distributeMesh()

◆ trimLocalTgt()

◆ TypeName()

TypeName ( "cellsToCells"  )

Run-time type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
cellsToCells  ,
word  ,
()  ,
()   
)

Declare runtime constructor selection table.

◆ New()

Foam::autoPtr< Foam::cellsToCells > New ( const word cellsToCellsType)
static

Select from name.

Definition at line 162 of file cellsToCells.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInFunction.

Referenced by interRegionModel::interpolation().

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

◆ singleProcess()

Foam::label singleProcess ( ) const
inline

Index of the processor holding all cells of the cellsToCells,.

or -1 if spread across multiple processors

Definition at line 30 of file cellsToCellsI.H.

References cellsToCells::singleProcess_.

◆ isSingleProcess()

bool isSingleProcess ( ) const
inline

Is this intersection on a single process?

Definition at line 36 of file cellsToCellsI.H.

◆ srcCoupled()

Foam::PackedBoolList srcCoupled ( ) const

Return a list indicating which source cells are coupled.

Definition at line 186 of file cellsToCells.C.

References PackedList< nBits >::empty(), and forAll.

Here is the call graph for this function:

◆ tgtCoupled()

Foam::PackedBoolList tgtCoupled ( ) const

Return a list indicating which target cells are coupled.

Definition at line 197 of file cellsToCells.C.

References PackedList< nBits >::empty(), and forAll.

Here is the call graph for this function:

◆ srcToTgt() [1/4]

tmp<Field<Type> > srcToTgt ( const Field< Type > &  srcFld) const

Interpolate a source cell field to the target with no left.

over values specified. If the interpolation weight sum is less than one for a face then they will be normalised. If the interpolation weight sum is zero for a face then that face's value will be NaN.

Referenced by interRegionModel::interpolate().

Here is the caller graph for this function:

◆ srcToTgt() [2/4]

tmp<Field<Type> > srcToTgt ( const Field< Type > &  srcFld,
const Field< Type > &  leftOverTgtFld 
) const

Interpolate a source cell field to the target with left over.

values specified. If the interpolation weight sum is less than one for a face then the average will include the left over value multiplied by one minus the weight sum.

◆ tgtToSrc() [1/4]

tmp<Field<Type> > tgtToSrc ( const Field< Type > &  tgtFld) const

Interpolate a target cell field to the source with no left.

over values specified. As the corresponding srcToTgt.

Referenced by interRegionModel::interpolate().

Here is the caller graph for this function:

◆ tgtToSrc() [2/4]

tmp<Field<Type> > tgtToSrc ( const Field< Type > &  tgtFld,
const Field< Type > &  leftOverSrcFld 
) const

Interpolate a target cell field to the source with left.

over values specified. As the corresponding srcToTgt.

◆ srcToTgtPoint()

Foam::remote srcToTgtPoint ( const polyMesh tgtMesh,
const label  srcCelli,
const point p 
) const

Find the target processor and cell associated with a point in a.

source cell. Note that this will only work with derivations that fill a cell's stencil with everything that overlaps that cell. qt present this is just cellsToCellss::intersection, but we might add a cheaper bound-box based method like patchToPatches::rays in future.

Definition at line 208 of file cellsToCells.C.

References forAll, UPstream::myProcNo(), p, and polyMesh::pointInCell().

Here is the call graph for this function:

◆ update()

◆ operator=()

void operator= ( const cellsToCells )
delete

Disallow default bitwise assignment.

◆ srcToTgt() [3/4]

Foam::tmp<Foam::Field<Type> > srcToTgt ( const Field< Type > &  srcFld) const

Definition at line 33 of file cellsToCellsTemplates.C.

References Foam::patchToPatchTools::interpolate(), cellsToCells::srcMapPtr_, cellsToCells::tgtLocalSrcCells_, and cellsToCells::tgtWeights_.

Here is the call graph for this function:

◆ srcToTgt() [4/4]

Foam::tmp<Foam::Field<Type> > srcToTgt ( const Field< Type > &  srcFld,
const Field< Type > &  leftOverTgtFld 
) const

Definition at line 47 of file cellsToCellsTemplates.C.

References Foam::patchToPatchTools::interpolate().

Here is the call graph for this function:

◆ tgtToSrc() [3/4]

Foam::tmp<Foam::Field<Type> > tgtToSrc ( const Field< Type > &  tgtFld) const

Definition at line 67 of file cellsToCellsTemplates.C.

References Foam::patchToPatchTools::interpolate().

Here is the call graph for this function:

◆ tgtToSrc() [4/4]

Foam::tmp<Foam::Field<Type> > tgtToSrc ( const Field< Type > &  tgtFld,
const Field< Type > &  leftOverSrcFld 
) const

Definition at line 81 of file cellsToCellsTemplates.C.

References Foam::patchToPatchTools::interpolate().

Here is the call graph for this function:

Member Data Documentation

◆ singleProcess_

label singleProcess_
protected

Index of processor that holds all of both sides, or -1.

Definition at line 62 of file cellsToCells.H.

Referenced by cellsToCells::singleProcess().

◆ srcLocalTgtCells_

labelListList srcLocalTgtCells_
protected

For each source cell, the coupled local target cells.

Definition at line 65 of file cellsToCells.H.

Referenced by cellsToCells::initialise().

◆ tgtLocalSrcCells_

labelListList tgtLocalSrcCells_
protected

For each target cell, the coupled local source cells.

Definition at line 68 of file cellsToCells.H.

Referenced by cellsToCells::initialise(), and cellsToCells::srcToTgt().

◆ srcWeights_

scalarListList srcWeights_
protected

For each source cell, the coupled target weights.

Definition at line 71 of file cellsToCells.H.

Referenced by cellsToCells::initialise().

◆ tgtWeights_

scalarListList tgtWeights_
protected

For each target cell, the coupled source weights.

Definition at line 74 of file cellsToCells.H.

Referenced by cellsToCells::initialise(), and cellsToCells::srcToTgt().

◆ srcMapPtr_

autoPtr<distributionMap> srcMapPtr_
protected

Map from source patch cells to target-local source patch cells.

Definition at line 77 of file cellsToCells.H.

Referenced by cellsToCells::srcToTgt().

◆ tgtMapPtr_

autoPtr<distributionMap> tgtMapPtr_
protected

Map from target patch cells to source-local target patch cells.

Definition at line 80 of file cellsToCells.H.

◆ localSrcProcCellsPtr_

autoPtr<List<remote> > localSrcProcCellsPtr_
protected

When running in parallel, a map from local source cell index to.

source processor and cell index

Definition at line 84 of file cellsToCells.H.

◆ localTgtProcCellsPtr_

autoPtr<List<remote> > localTgtProcCellsPtr_
protected

When running in parallel, a map from local target cell index to.

target processor and cell index

Definition at line 88 of file cellsToCells.H.

◆ localTgtMeshPtr_

autoPtr<polyMesh> localTgtMeshPtr_
protected

The target mesh, distributed locally to the source.

Definition at line 91 of file cellsToCells.H.


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