ug4
ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed > Class Template Reference

Geometry and shape functions for 1st order Vertex-Centered Finite Volume. More...

#include <fv1_geom.h>

+ Inheritance diagram for ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >:

Classes

class  BF
 boundary face More...
 
class  SCV
 sub control volume structure More...
 
class  SCVF
 Sub-Control Volume Face structure. More...
 

Public Types

typedef TElem elem_type
 type of element More...
 
typedef LagrangeP1< ref_elem_typelocal_shape_fct_set_type
 type of Shape function used More...
 
typedef reference_element_traits< TElem >::reference_element_type ref_elem_type
 type of reference element More...
 
typedef traits::scv_type scv_type
 type of SubControlVolume More...
 
typedef fv1_traits< ref_elem_type, TWorldDim > traits
 used traits More...
 

Public Member Functions

void add_boundary_subset (int subsetIndex)
 add subset that is interpreted as boundary subset. More...
 
const std::vector< BF > & bf (int si) const
 returns reference to vector of boundary faces for subsetIndex More...
 
const BFbf (int si, size_t i) const
 returns the boundary face i for subsetIndex More...
 
void clear_boundary_subsets ()
 reset all boundary subsets More...
 
const MathVector< worldDim > * coe_global () const
 returns the global coordinates of the center of mass of the element More...
 
const MathVector< dim > * coe_local () const
 returns the local coordinates of the center of mass of the element More...
 
const MathVector< worldDim > * corners () const
 get vector of the global coordinates of corners for current element More...
 
TElem * elem () const
 get the element More...
 
 FV1Geometry_gen ()
 construct object and initialize local values and sizes More...
 
const MathVector< worldDim > & global_node_position (size_t nodeID) const
 return global coords for node ID More...
 
const MathVector< dim > & local_node_position (size_t nodeID) const
 return local coords for node ID More...
 
size_t num_bf () const
 number of all boundary faces More...
 
size_t num_bf (int si) const
 number of boundary faces on subset 'subsetIndex' More...
 
size_t num_boundary_subsets ()
 number of registered boundary subsets More...
 
size_t num_scv () const
 number of SubControlVolumes More...
 
size_t num_scv_ips () const
 returns number of all scv ips More...
 
size_t num_scvf () const
 number of SubControlVolumeFaces More...
 
size_t num_scvf_ips () const
 returns number of all scvf ips More...
 
size_t num_sh () const
 number of shape functions More...
 
void remove_boundary_subset (int subsetIndex)
 removes subset that is interpreted as boundary subset. More...
 
void reset_curr_elem ()
 
ReferenceObjectID roid () const
 returns reference object id More...
 
const SCVscv (size_t i) const
 const access to SubControlVolume number i More...
 
const MathVector< worldDim > * scv_global_ips () const
 returns all ips of scv as they appear in scv loop More...
 
const MathVector< dim > * scv_local_ips () const
 returns all ips of scv as they appear in scv loop More...
 
const SCVFscvf (size_t i) const
 const access to SubControlVolumeFace number i More...
 
const MathVector< worldDim > * scvf_global_ips () const
 returns all ips of scvf as they appear in scv loop More...
 
const MathVector< dim > * scvf_local_ips () const
 returns all ips of scvf as they appear in scv loop More...
 
void update (GridObject *elem, const MathVector< worldDim > *vCornerCoords, const ISubsetHandler *ish=NULL)
 update data for given element More...
 
void update_boundary_faces (GridObject *elem, const MathVector< worldDim > *vCornerCoords, const ISubsetHandler *ish=NULL)
 update boundary data for given element More...
 
void update_local_data ()
 update local data More...
 

Static Public Attributes

static const bool condensed_scvf_ips = TCondensed
 whether the scheme shifts the scvf ip's to midpoints of the edges More...
 
static const int dim = ref_elem_type::dim
 dimension of reference element More...
 
static const size_t nip = 1
 number of integration points More...
 
static const size_t nsh = local_shape_fct_set_type::nsh
 number of shape functions More...
 
static const size_t numSCV = traits::numSCV
 number of SubControlVolumes More...
 
static const size_t numSCVF = traits::numSCVF
 number of SubControlVolumeFaces More...
 
static const int order = 1
 order More...
 
static const bool staticLocalData = true
 flag indicating if local data may change More...
 
static const bool usesHangingNodes = false
 Hanging node flag: this Geometry does not support hanging nodes. More...
 
static const int worldDim = TWorldDim
 dimension of world More...
 

Protected Attributes

std::map< int, std::vector< BF > > m_mapVectorBF
 
std::vector< BFm_vEmptyVectorBF
 
MathVector< worldDimm_vGlobSCV_IP [numSCV]
 
MathVector< worldDimm_vGlobSCVF_IP [numSCVF]
 
MathVector< dimm_vLocSCV_IP [numSCV]
 
MathVector< dimm_vLocSCVF_IP [numSCVF]
 

Private Attributes

ReferenceMapping< ref_elem_type, worldDimm_mapping
 Reference Mapping. More...
 
TElem * m_pElem
 pointer to current element More...
 
const ref_elem_typem_rRefElem
 Reference Element. More...
 
const local_shape_fct_set_typem_rTrialSpace
 Shape function set. More...
 
SCV m_vSCV [numSCV]
 SubControlVolumes. More...
 
SCVF m_vSCVF [numSCVF]
 SubControlVolumeFaces. More...
 
MathVector< worldDimm_vvGloMid [dim+1][maxMid]
 
MathVector< dimm_vvLocMid [dim+1][maxMid]
 local and global geom object midpoints for each dimension More...
 

Static Private Attributes

static const int maxMid = numSCVF + 1
 max number of geom objects in all dimensions More...
 

Detailed Description

template<typename TElem, int TWorldDim, bool TCondensed>
class ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >

Geometry and shape functions for 1st order Vertex-Centered Finite Volume.

The class provides the geometry and shape functions for 1st order Vertex-Centered Finite Element Finite Volume method based on the Donald Diagrams.

The class provides an option (TCondensed) to shift the subcontrol volume face integration points to the edges. This allows to reduce the matrix pattern and to avoid positive off-diagonal entries in some cases. (For ex., the discretization of the Laplacian on a grid of rectangles retains results in the 5-point stencil.) However note that, in many cases, this leads to the discretization order reduction.

Template Parameters
TElemElement type
TWorldDim(physical) world dimension
TCondensedif to shift the scvf ip's to midpoints of the edges

Member Typedef Documentation

◆ elem_type

template<typename TElem , int TWorldDim, bool TCondensed>
typedef TElem ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::elem_type

type of element

◆ local_shape_fct_set_type

template<typename TElem , int TWorldDim, bool TCondensed>
typedef LagrangeP1<ref_elem_type> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::local_shape_fct_set_type

type of Shape function used

◆ ref_elem_type

template<typename TElem , int TWorldDim, bool TCondensed>
typedef reference_element_traits<TElem>::reference_element_type ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::ref_elem_type

type of reference element

◆ scv_type

template<typename TElem , int TWorldDim, bool TCondensed>
typedef traits::scv_type ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scv_type

type of SubControlVolume

◆ traits

template<typename TElem , int TWorldDim, bool TCondensed>
typedef fv1_traits<ref_elem_type, TWorldDim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::traits

used traits

Constructor & Destructor Documentation

◆ FV1Geometry_gen()

template<typename TElem , int TWorldDim, bool TCondensed>
ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::FV1Geometry_gen

construct object and initialize local values and sizes

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::update_local_data().

Member Function Documentation

◆ add_boundary_subset()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::add_boundary_subset ( int  subsetIndex)
inline

add subset that is interpreted as boundary subset.

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_mapVectorBF.

◆ bf() [1/2]

template<typename TElem , int TWorldDim, bool TCondensed>
const std::vector<BF>& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::bf ( int  si) const
inline

◆ bf() [2/2]

template<typename TElem , int TWorldDim, bool TCondensed>
const BF& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::bf ( int  si,
size_t  i 
) const
inline

◆ clear_boundary_subsets()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::clear_boundary_subsets ( )
inline

◆ coe_global()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<worldDim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::coe_global ( ) const
inline

returns the global coordinates of the center of mass of the element

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::dim, and ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvGloMid.

◆ coe_local()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<dim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::coe_local ( ) const
inline

returns the local coordinates of the center of mass of the element

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::dim, and ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvLocMid.

◆ corners()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<worldDim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::corners ( ) const
inline

get vector of the global coordinates of corners for current element

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvGloMid.

◆ elem()

template<typename TElem , int TWorldDim, bool TCondensed>
TElem* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::elem ( ) const
inline

◆ global_node_position()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<worldDim>& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::global_node_position ( size_t  nodeID) const
inline

return global coords for node ID

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvGloMid, and UG_ASSERT.

◆ local_node_position()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<dim>& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::local_node_position ( size_t  nodeID) const
inline

return local coords for node ID

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvLocMid, and UG_ASSERT.

◆ num_bf() [1/2]

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_bf ( ) const
inline

◆ num_bf() [2/2]

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_bf ( int  si) const
inline

number of boundary faces on subset 'subsetIndex'

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_mapVectorBF.

◆ num_boundary_subsets()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_boundary_subsets ( )
inline

number of registered boundary subsets

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_mapVectorBF.

◆ num_scv()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_scv ( ) const
inline

◆ num_scv_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_scv_ips ( ) const
inline

returns number of all scv ips

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::numSCV.

◆ num_scvf()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_scvf ( ) const
inline

◆ num_scvf_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_scvf_ips ( ) const
inline

returns number of all scvf ips

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::numSCVF.

◆ num_sh()

template<typename TElem , int TWorldDim, bool TCondensed>
size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::num_sh ( ) const
inline

number of shape functions

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::nsh.

◆ remove_boundary_subset()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::remove_boundary_subset ( int  subsetIndex)
inline

removes subset that is interpreted as boundary subset.

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_mapVectorBF.

◆ reset_curr_elem()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::reset_curr_elem ( )
inline

◆ roid()

template<typename TElem , int TWorldDim, bool TCondensed>
ReferenceObjectID ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::roid ( ) const
inline

returns reference object id

◆ scv()

template<typename TElem , int TWorldDim, bool TCondensed>
const SCV& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scv ( size_t  i) const
inline

◆ scv_global_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<worldDim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scv_global_ips ( ) const
inline

◆ scv_local_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<dim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scv_local_ips ( ) const
inline

◆ scvf()

template<typename TElem , int TWorldDim, bool TCondensed>
const SCVF& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scvf ( size_t  i) const
inline

◆ scvf_global_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<worldDim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scvf_global_ips ( ) const
inline

returns all ips of scvf as they appear in scv loop

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vGlobSCVF_IP.

◆ scvf_local_ips()

template<typename TElem , int TWorldDim, bool TCondensed>
const MathVector<dim>* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scvf_local_ips ( ) const
inline

returns all ips of scvf as they appear in scv loop

References ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vLocSCVF_IP.

◆ update()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::update ( GridObject elem,
const MathVector< worldDim > *  vCornerCoords,
const ISubsetHandler ish = NULL 
)

◆ update_boundary_faces()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::update_boundary_faces ( GridObject elem,
const MathVector< worldDim > *  vCornerCoords,
const ISubsetHandler ish = NULL 
)

update boundary data for given element

◆ update_local_data()

template<typename TElem , int TWorldDim, bool TCondensed>
void ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::update_local_data

Member Data Documentation

◆ condensed_scvf_ips

template<typename TElem , int TWorldDim, bool TCondensed>
const bool ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::condensed_scvf_ips = TCondensed
static

whether the scheme shifts the scvf ip's to midpoints of the edges

◆ dim

template<typename TElem , int TWorldDim, bool TCondensed>
const int ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::dim = ref_elem_type::dim
static

◆ m_mapping

template<typename TElem , int TWorldDim, bool TCondensed>
ReferenceMapping<ref_elem_type, worldDim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_mapping
private

Reference Mapping.

◆ m_mapVectorBF

◆ m_pElem

template<typename TElem , int TWorldDim, bool TCondensed>
TElem* ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_pElem
private

◆ m_rRefElem

template<typename TElem , int TWorldDim, bool TCondensed>
const ref_elem_type& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_rRefElem
private

Reference Element.

◆ m_rTrialSpace

template<typename TElem , int TWorldDim, bool TCondensed>
const local_shape_fct_set_type& ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_rTrialSpace
private

Shape function set.

◆ m_vEmptyVectorBF

template<typename TElem , int TWorldDim, bool TCondensed>
std::vector<BF> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vEmptyVectorBF
protected

◆ m_vGlobSCV_IP

template<typename TElem , int TWorldDim, bool TCondensed>
MathVector<worldDim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vGlobSCV_IP[numSCV]
protected

◆ m_vGlobSCVF_IP

template<typename TElem , int TWorldDim, bool TCondensed>
MathVector<worldDim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vGlobSCVF_IP[numSCVF]
protected

◆ m_vLocSCV_IP

template<typename TElem , int TWorldDim, bool TCondensed>
MathVector<dim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vLocSCV_IP[numSCV]
protected

◆ m_vLocSCVF_IP

template<typename TElem , int TWorldDim, bool TCondensed>
MathVector<dim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vLocSCVF_IP[numSCVF]
protected

◆ m_vSCV

template<typename TElem , int TWorldDim, bool TCondensed>
SCV ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vSCV[numSCV]
private

◆ m_vSCVF

template<typename TElem , int TWorldDim, bool TCondensed>
SCVF ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vSCVF[numSCVF]
private

SubControlVolumeFaces.

Referenced by ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::scvf().

◆ m_vvGloMid

◆ m_vvLocMid

template<typename TElem , int TWorldDim, bool TCondensed>
MathVector<dim> ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::m_vvLocMid[dim+1][maxMid]
private

◆ maxMid

template<typename TElem , int TWorldDim, bool TCondensed>
const int ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::maxMid = numSCVF + 1
staticprivate

max number of geom objects in all dimensions

◆ nip

template<typename TElem , int TWorldDim, bool TCondensed>
const size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::nip = 1
static

◆ nsh

template<typename TElem , int TWorldDim, bool TCondensed>
const size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::nsh = local_shape_fct_set_type::nsh
static

◆ numSCV

template<typename TElem , int TWorldDim, bool TCondensed>
const size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::numSCV = traits::numSCV
static

◆ numSCVF

template<typename TElem , int TWorldDim, bool TCondensed>
const size_t ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::numSCVF = traits::numSCVF
static

◆ order

template<typename TElem , int TWorldDim, bool TCondensed>
const int ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::order = 1
static

order

◆ staticLocalData

template<typename TElem , int TWorldDim, bool TCondensed>
const bool ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::staticLocalData = true
static

flag indicating if local data may change

◆ usesHangingNodes

template<typename TElem , int TWorldDim, bool TCondensed>
const bool ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::usesHangingNodes = false
static

Hanging node flag: this Geometry does not support hanging nodes.

◆ worldDim

template<typename TElem , int TWorldDim, bool TCondensed>
const int ug::FV1Geometry_gen< TElem, TWorldDim, TCondensed >::worldDim = TWorldDim
static

dimension of world


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