ug4
|
Interface class for upwind methods. More...
#include <conv_shape_interface.h>
Public Types | |
typedef IConvectionShapes< dim > | this_type |
Abbreviation for own type. More... | |
typedef bool(this_type::* | UpdateFunc) (const FVGeometryBase *geo, const MathVector< dim > *Velocity, const MathMatrix< dim, dim > *Diffusion, bool computeDeriv) |
type of update function More... | |
Public Member Functions | |
const MathMatrix< dim, dim > & | D_diffusion (size_t scvf, size_t sh) const |
upwind shapes for ip vel More... | |
const MathVector< dim > & | D_vel (size_t scvf, size_t sh) const |
upwind shape for corner vel More... | |
IConvectionShapes () | |
constructor More... | |
bool | non_zero_deriv_diffusion () const |
returns if upwind shape w.r.t. ip vel is non-zero More... | |
size_t | num_scvf () const |
returns number of sub control volume faces More... | |
size_t | num_sh () const |
returns number of shapes More... | |
number | operator() (size_t scvf, size_t sh) const |
shape value More... | |
template<typename TFVGeom , typename TAssFunc > | |
void | register_update_func (TAssFunc func) |
register a update function for a Geometry More... | |
template<typename TFVGeom > | |
bool | set_geometry_type (const TFVGeom &geo) |
set the Geometry type to use for next updates More... | |
bool | update (const FVGeometryBase *geo, const MathVector< dim > *Velocity, const MathMatrix< dim, dim > *DiffDisp, bool computeDeriv) |
virtual | ~IConvectionShapes () |
destructor More... | |
Protected Member Functions | |
number & | conv_shape (size_t scvf, size_t sh) |
non-const access to ip velocity (i.e. interpolated velocity at ip) More... | |
MathMatrix< dim, dim > & | conv_shape_diffusion (size_t scvf, size_t sh) |
non-const access to upwind shapes for ip vel More... | |
MathVector< dim > & | D_vel (size_t scvf, size_t sh) |
non-const access to upwind shapes for corner vel More... | |
void | set_non_zero_deriv_diffusion_flag (bool flag) |
sets the shape ip flag More... | |
void | set_sizes (size_t numScvf, size_t numSh) |
resize the data arrays More... | |
Protected Attributes | |
bool | m_bNonZeroDerivDiffusion |
flag if ip shapes are non-zero More... | |
int | m_id |
id of current geometry type More... | |
size_t | m_numScvf |
number of current scvf More... | |
size_t | m_numSh |
number of current shape functions (usually in corners) More... | |
std::vector< std::vector< number > > | m_vConvShape |
upwind shapes for corners shape functions More... | |
std::vector< std::vector< MathMatrix< dim, dim > > > | m_vConvShapeDiffusion |
upwind shapes for corners shape functions More... | |
std::vector< std::vector< MathVector< dim > > > | m_vConvShapeVel |
upwind shapes for corners shape functions More... | |
std::vector< UpdateFunc > | m_vUpdateFunc |
Vector holding all update functions. More... | |
Interface class for upwind methods.
Upwind is a way of stabilization of discretizations of convection(-diffusion) PDEs. For a detailed description of the idea, cf.
Convection shapes is one of possible implementations of upwind methods, in which the upwind is considered as a special kind of interpolation of degrees of freedom of the unknown function (for ex., concentration at the corners of the element) into integration points inside the grid element. E.g. the so-called 'full upwind' method for the vertex-centered FV discretizations sets the concentration in the whole grid element be equal to the concentration at a certain specially selected 'upwind corner' chosen according to the direction of the convection velocity. Like every interpolation, this one can be introduced by a set of shape functions associated with the degrees of freedom of the grid function. These shape functions for an upwind method are said to be its convection shapes.
But in terms of this interface, the convection shapes are the values of the convection shape functions at the integration points premultiplied by the norm of the projection of the velocity to the normal to the corresponding subcontrol volume faces and by the area of these faces. Thus, for a convective term of the form
\nabla \cdot (\mathbf{v} c)
(with \mathbf{v} being the convective velocity) the convective flux through a subcontrol volume face with the integration point ip is
\sum_{s=1}^{n_s} \phi_s (ip) \, c_s,
where \phi_s (ip) are the values of the n_s `‘convection shapes’' at ip, whereas c_s are the degrees of freedom of c corresponding to the shapes.
Although the convection shapes for every upwind method are based on the same idea, they depend on the geometry of the secondary grid (i.e., on the finite volume geometry). For this, for every FV geometry, an own object of the convection shapes class is registered.
Note furthermore that the convection shapes may depend not only on the velocity but also on the diffusion. Such methods raise up the asymptotic convergence of the discretization of convection-diffusion problems. As the diffusion tensor may also depend on the unknowns (via its dispersion part), the derivatives of the shapes w.r.t. the components of the diffusion tensor are taken into account.
dim | the world dimension (in which the velocity is given) |
typedef IConvectionShapes<dim> ug::IConvectionShapes< dim >::this_type |
Abbreviation for own type.
typedef bool(this_type::* ug::IConvectionShapes< dim >::UpdateFunc) (const FVGeometryBase *geo, const MathVector< dim > *Velocity, const MathMatrix< dim, dim > *Diffusion, bool computeDeriv) |
type of update function
|
inline |
|
inlinevirtual |
destructor
|
inlineprotected |
non-const access to ip velocity (i.e. interpolated velocity at ip)
References ug::IConvectionShapes< dim >::m_vConvShape, and UG_ASSERT.
|
inlineprotected |
non-const access to upwind shapes for ip vel
References ug::IConvectionShapes< dim >::m_vConvShapeDiffusion, and UG_ASSERT.
|
inline |
upwind shapes for ip vel
References ug::IConvectionShapes< dim >::m_vConvShapeDiffusion, and UG_ASSERT.
|
inlineprotected |
non-const access to upwind shapes for corner vel
References ug::IConvectionShapes< dim >::m_vConvShapeVel, and UG_ASSERT.
|
inline |
upwind shape for corner vel
References ug::IConvectionShapes< dim >::m_vConvShapeVel, and UG_ASSERT.
|
inline |
returns if upwind shape w.r.t. ip vel is non-zero
References ug::IConvectionShapes< dim >::m_bNonZeroDerivDiffusion.
|
inline |
returns number of sub control volume faces
References ug::IConvectionShapes< dim >::m_numScvf.
|
inline |
returns number of shapes
References ug::IConvectionShapes< dim >::m_numSh.
|
inline |
shape value
References ug::IConvectionShapes< dim >::m_vConvShape, and UG_ASSERT.
void ug::IConvectionShapes< dim >::register_update_func | ( | TAssFunc | func | ) |
bool ug::IConvectionShapes< dim >::set_geometry_type | ( | const TFVGeom & | geo | ) |
|
inlineprotected |
sets the shape ip flag
References ug::IConvectionShapes< dim >::m_bNonZeroDerivDiffusion.
|
protected |
resize the data arrays
|
inline |
|
protected |
flag if ip shapes are non-zero
Referenced by ug::IConvectionShapes< dim >::non_zero_deriv_diffusion(), and ug::IConvectionShapes< dim >::set_non_zero_deriv_diffusion_flag().
|
protected |
id of current geometry type
Referenced by ug::IConvectionShapes< dim >::update().
|
protected |
number of current scvf
Referenced by ug::IConvectionShapes< dim >::num_scvf().
|
protected |
number of current shape functions (usually in corners)
Referenced by ug::IConvectionShapes< dim >::num_sh().
|
protected |
upwind shapes for corners shape functions
Referenced by ug::IConvectionShapes< dim >::conv_shape(), ug::IConvectionShapes< dim >::IConvectionShapes(), and ug::IConvectionShapes< dim >::operator()().
|
protected |
upwind shapes for corners shape functions
Referenced by ug::IConvectionShapes< dim >::conv_shape_diffusion(), ug::IConvectionShapes< dim >::D_diffusion(), and ug::IConvectionShapes< dim >::IConvectionShapes().
|
protected |
upwind shapes for corners shape functions
Referenced by ug::IConvectionShapes< dim >::D_vel(), and ug::IConvectionShapes< dim >::IConvectionShapes().
|
protected |
Vector holding all update functions.
Referenced by ug::IConvectionShapes< dim >::IConvectionShapes(), and ug::IConvectionShapes< dim >::update().