Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Dual< Type > Class Template Reference

Dual-mesh lagrangian averaging procedure. More...

Inheritance diagram for Dual< Type >:
Inheritance graph
[legend]
Collaboration diagram for Dual< Type >:
Collaboration graph
[legend]

Public Types

typedef AveragingMethod< Type >::TypeGrad TypeGrad
 Public typedefs. More...
 

Public Member Functions

 TypeName ("dual")
 Runtime type information. More...
 
 Dual (const IOobject &io, const dictionary &dict, const fvMesh &mesh)
 Constructors. More...
 
 Dual (const Dual< Type > &am)
 Construct a copy. More...
 
virtual autoPtr< AveragingMethod< Type > > clone () const
 Construct and return a clone. More...
 
virtual ~Dual ()
 Destructor. More...
 
void add (const point position, const tetIndices &tetIs, const Type &value)
 Member Functions. More...
 
Type interpolate (const point position, const tetIndices &tetIs) const
 Interpolate. More...
 
TypeGrad interpolateGrad (const point position, const tetIndices &tetIs) const
 Interpolate gradient. More...
 
void average ()
 Calculate the average. More...
 
void average (const AveragingMethod< scalar > &weight)
 
tmp< Field< Type > > internalField () const
 Return an internal field of the average. More...
 
tmp< Field< TypeGrad > > internalFieldGrad () const
 Return an internal field of the gradient. More...
 
- Public Member Functions inherited from AveragingMethod< Type >
 TypeName ("averagingMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, AveragingMethod, dictionary,(const IOobject &io, const dictionary &dict, const fvMesh &mesh),(io, dict, mesh))
 Declare runtime constructor selection table. More...
 
 AveragingMethod (const IOobject &io, const dictionary &dict, const fvMesh &mesh, const labelList &size)
 Constructors. More...
 
 AveragingMethod (const AveragingMethod< Type > &am)
 Construct a copy. More...
 
virtual autoPtr< AveragingMethod< Type > > clone () const=0
 Construct and return a clone. More...
 
virtual ~AveragingMethod ()
 Destructor. More...
 
virtual bool writeData (Ostream &) const
 Dummy write. More...
 
virtual bool write () const
 Write using setting from DB. More...
 
virtual tmp< Field< Type > > internalField () const=0
 Return an internal field of the average. More...
 
void operator= (const AveragingMethod< Type > &x)
 Assign to another average. More...
 
void operator= (const Type &x)
 Assign to value. More...
 
void operator= (tmp< FieldField< Field, Type > > x)
 Assign to tmp. More...
 
void operator+= (tmp< FieldField< Field, Type > > x)
 Add-equal tmp. More...
 
void operator*= (tmp< FieldField< Field, Type > > x)
 Multiply-equal tmp. More...
 
void operator/= (tmp< FieldField< Field, scalar > > x)
 Divide-equal tmp. More...
 

Private Member Functions

void tetGeometry (const point position, const tetIndices &tetIs) const
 Private member functions. More...
 
void syncDualData ()
 Sync point data over processor boundaries. More...
 

Static Private Member Functions

static autoPtr< labelListsize (const fvMesh &mesh)
 Private static member functions. More...
 

Private Attributes

const Field< scalar > & volumeCell_
 Private data. More...
 
Field< scalar > volumeDual_
 Volume of the point-centered regions. More...
 
Field< Type > & dataCell_
 Data on the cells. More...
 
Field< Type > & dataDual_
 Data on the points. More...
 
List< labeltetVertices_
 Tet vertex labels. More...
 
List< scalar > tetCoordinates_
 Tet barycentric coordinates. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from AveragingMethod< Type >
static autoPtr< AveragingMethod< Type > > New (const IOobject &io, const dictionary &dict, const fvMesh &mesh)
 Selector. More...
 
- Protected Types inherited from AveragingMethod< Type >
typedef outerProduct< vector, Type >::type TypeGrad
 Protected typedefs. More...
 
- Protected Member Functions inherited from AveragingMethod< Type >
virtual void updateGrad ()
 Protected member functions. More...
 
- Protected Attributes inherited from AveragingMethod< Type >
const dictionarydict_
 Protected data. More...
 
const fvMeshmesh_
 The mesh on which the averaging is to be done. More...
 

Detailed Description

template<class Type>
class Foam::AveragingMethods::Dual< Type >

Dual-mesh lagrangian averaging procedure.

Point values are summed using the tetrahedral decomposition of the computational cells. Summation is done in the cells, and also in the terahedrons surrounding each point. The latter forms a type of dual mesh. The interpolation is weighted by proximity to the cell centre or point, as calculated by the barycentric coordinate within the tethrahedron.

Values are interpolated linearly across the tethrahedron. Gradients are calculated directly from the point values using a first order finite element basis. The computed gradient is assumed constant over the tethrahedron.

Source files

Definition at line 64 of file Dual.H.

Member Typedef Documentation

◆ TypeGrad

Public typedefs.

Gradient type

Definition at line 73 of file Dual.H.

Constructor & Destructor Documentation

◆ Dual() [1/2]

Dual ( const IOobject io,
const dictionary dict,
const fvMesh mesh 
)

Constructors.

Construct from components

Definition at line 48 of file Dual.C.

References f(), tetIndices::face(), tetIndices::faceBasePt(), tetIndices::facePtA(), tetIndices::facePtB(), forAll, tetrahedron::mag(), mesh, and tetIndices::tet().

Here is the call graph for this function:

◆ Dual() [2/2]

Dual ( const Dual< Type > &  am)

Construct a copy.

Definition at line 88 of file Dual.C.

◆ ~Dual()

~Dual
virtual

Destructor.

Definition at line 105 of file Dual.C.

Member Function Documentation

◆ size()

Foam::autoPtr< Foam::labelList > size ( const fvMesh mesh)
staticprivate

Private static member functions.

Return the size of the FieldField parts

Definition at line 33 of file Dual.C.

References mesh, and s().

Here is the call graph for this function:

◆ tetGeometry()

void tetGeometry ( const point  position,
const tetIndices tetIs 
) const
private

Private member functions.

Calculate indices and barycentric coordinates within a tetrahedron

Definition at line 113 of file Dual.C.

References tetrahedron::barycentric(), f(), tetIndices::face(), tetIndices::faceBasePt(), tetIndices::facePtA(), tetIndices::facePtB(), Foam::max(), and tetIndices::tet().

Here is the call graph for this function:

◆ syncDualData()

void syncDualData
private

Sync point data over processor boundaries.

Definition at line 131 of file Dual.C.

◆ TypeName()

TypeName ( "dual"  )

Runtime type information.

◆ clone()

virtual autoPtr<AveragingMethod<Type> > clone ( ) const
inlinevirtual

Construct and return a clone.

Definition at line 138 of file Dual.H.

◆ add()

void add ( const point  position,
const tetIndices tetIs,
const Type &  value 
)
virtual

Member Functions.

Add point value to interpolation

Implements AveragingMethod< Type >.

Definition at line 146 of file Dual.C.

References tetIndices::cell().

Here is the call graph for this function:

◆ interpolate()

Type interpolate ( const point  position,
const tetIndices tetIs 
) const
virtual

Interpolate.

Implements AveragingMethod< Type >.

Definition at line 169 of file Dual.C.

References tetIndices::cell().

Here is the call graph for this function:

◆ interpolateGrad()

Foam::AveragingMethods::Dual< Type >::TypeGrad interpolateGrad ( const point  position,
const tetIndices tetIs 
) const
virtual

Interpolate gradient.

Implements AveragingMethod< Type >.

Definition at line 187 of file Dual.C.

References tetIndices::cell(), Foam::inv(), s(), and T.

Here is the call graph for this function:

◆ average() [1/2]

void average
virtual

Calculate the average.

Reimplemented from AveragingMethod< Type >.

Definition at line 225 of file Dual.C.

References Foam::fvc::average().

Here is the call graph for this function:

◆ average() [2/2]

void average ( const AveragingMethod< scalar > &  weight)
virtual

Reimplemented from AveragingMethod< Type >.

Definition at line 235 of file Dual.C.

References Foam::fvc::average().

Here is the call graph for this function:

◆ internalField()

Foam::tmp< Foam::Field< Type > > internalField

Return an internal field of the average.

Definition at line 247 of file Dual.C.

◆ internalFieldGrad()

tmp<Field<TypeGrad> > internalFieldGrad ( ) const

Return an internal field of the gradient.

Field Documentation

◆ volumeCell_

const Field<scalar>& volumeCell_
private

Private data.

Volume of the cell-centered regions

Definition at line 81 of file Dual.H.

◆ volumeDual_

Field<scalar> volumeDual_
private

Volume of the point-centered regions.

Definition at line 84 of file Dual.H.

◆ dataCell_

Field<Type>& dataCell_
private

Data on the cells.

Definition at line 87 of file Dual.H.

◆ dataDual_

Field<Type>& dataDual_
private

Data on the points.

Definition at line 90 of file Dual.H.

◆ tetVertices_

List<label> tetVertices_
mutableprivate

Tet vertex labels.

Definition at line 93 of file Dual.H.

◆ tetCoordinates_

List<scalar> tetCoordinates_
mutableprivate

Tet barycentric coordinates.

Definition at line 96 of file Dual.H.


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