pointMVCWeight Class Reference

Container to calculate weights for interpolating directly from vertices of cell using Mean Value Coordinates. More...

Collaboration diagram for pointMVCWeight:
[legend]

Public Member Functions

 pointMVCWeight (const polyMesh &mesh, const vector &position, const label celli, const label facei=-1)
 Construct from components. More...
 
label cell () const noexcept
 Cell index. More...
 
const scalarFieldweights () const noexcept
 Interpolation weights (in order of cellPoints) More...
 
template<class Type >
Type interpolate (const GeometricField< Type, pointPatchField, pointMesh > &psip) const
 Interpolate field. More...
 

Static Public Attributes

static int debug
 Debug switch. More...
 
static scalar tol
 Tolerance used in calculating barycentric coordinates. More...
 

Protected Member Functions

void calcWeights (const Map< label > &toLocal, const face &f, const DynamicList< point > &u, const scalarField &dist, scalarField &weights) const
 Calculate weights from single face's vertices only. More...
 
void calcWeights (const polyMesh &mesh, const labelList &toGlobal, const Map< label > &toLocal, const vector &position, const vectorField &uVec, const scalarField &dist, scalarField &weights) const
 Calculate weights from all cell's vertices. More...
 

Protected Attributes

const label cellIndex_
 Cell index. More...
 
scalarField weights_
 Weights applied to cell vertices. More...
 

Detailed Description

Container to calculate weights for interpolating directly from vertices of cell using Mean Value Coordinates.

Based on (VTK's vtkMeanValueCoordinatesInterpolator's) implementation of "Spherical Barycentric Coordinates" 2006 paper Eurographics Symposium on Geometry Processing by Torsten Langer, Alexander Belyaev and Hans-Peter Seide

Source files

Definition at line 68 of file pointMVCWeight.H.

Constructor & Destructor Documentation

◆ pointMVCWeight()

pointMVCWeight ( const polyMesh mesh,
const vector position,
const label  celli,
const label  facei = -1 
)

Construct from components.

Definition at line 245 of file pointMVCWeight.C.

References pointMVCWeight::calcWeights(), pointMVCWeight::cellIndex_, primitiveMesh::cellPoints(), f(), polyMesh::faces(), forAll, HashTable< T, Key, Hash >::insert(), Foam::mag(), mesh, Foam::pid(), polyMesh::points(), List< T >::setSize(), UList< T >::size(), pointMVCWeight::tol, and pointMVCWeight::weights_.

Here is the call graph for this function:

Member Function Documentation

◆ calcWeights() [1/2]

void calcWeights ( const Map< label > &  toLocal,
const face f,
const DynamicList< point > &  u,
const scalarField dist,
scalarField weights 
) const
protected

Calculate weights from single face's vertices only.

Definition at line 43 of file pointMVCWeight.C.

References Foam::asin(), f(), UList< T >::fcIndex(), forAll, Foam::mag(), Foam::pid(), UList< T >::rcIndex(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), UList< T >::size(), Foam::tan(), pointMVCWeight::tol, and pointMVCWeight::weights().

Referenced by pointMVCWeight::pointMVCWeight().

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

◆ calcWeights() [2/2]

void calcWeights ( const polyMesh mesh,
const labelList toGlobal,
const Map< label > &  toLocal,
const vector position,
const vectorField uVec,
const scalarField dist,
scalarField weights 
) const
protected

Calculate weights from all cell's vertices.

Definition at line 84 of file pointMVCWeight.C.

References alpha, Foam::asin(), primitiveMesh::cells(), f(), polyMesh::faces(), UList< T >::fcIndex(), forAll, Foam::mag(), mesh, Foam::min(), Foam::normalised(), Foam::pid(), UList< T >::rcIndex(), Foam::sin(), Foam::sum(), Foam::tan(), and Foam::Zero.

Here is the call graph for this function:

◆ cell()

label cell ( ) const
inlinenoexcept

Cell index.

Definition at line 130 of file pointMVCWeight.H.

References pointMVCWeight::cellIndex_.

◆ weights()

const scalarField & weights ( ) const
inlinenoexcept

Interpolation weights (in order of cellPoints)

Definition at line 136 of file pointMVCWeight.H.

References pointMVCWeight::weights_.

Referenced by pointMVCWeight::calcWeights().

Here is the caller graph for this function:

◆ interpolate()

Type interpolate ( const GeometricField< Type, pointPatchField, pointMesh > &  psip) const
inline

Interpolate field.

Definition at line 33 of file pointMVCWeightI.H.

References pointMVCWeight::cellIndex_, forAll, DimensionedField< Type, GeoMesh >::mesh(), Foam::vertices(), pointMVCWeight::weights_, and Foam::Zero.

Referenced by interpolationPointMVC< Type >::interpolate(), and surfaceAlignedSBRStressFvMotionSolver::solve().

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

Member Data Documentation

◆ cellIndex_

const label cellIndex_
protected

◆ weights_

scalarField weights_
protected

Weights applied to cell vertices.

Definition at line 78 of file pointMVCWeight.H.

Referenced by pointMVCWeight::interpolate(), pointMVCWeight::pointMVCWeight(), and pointMVCWeight::weights().

◆ debug

int debug
static

Debug switch.

Definition at line 108 of file pointMVCWeight.H.

◆ tol

Foam::scalar tol
static

Tolerance used in calculating barycentric coordinates.

(applied to normalised values)

Definition at line 112 of file pointMVCWeight.H.

Referenced by pointMVCWeight::calcWeights(), and pointMVCWeight::pointMVCWeight().


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