ug4
ug::IElemDiscBase< TDomain > Class Template Referenceabstract

base class for all element-wise discretizations More...

#include <elem_disc_interface.h>

+ Inheritance diagram for ug::IElemDiscBase< TDomain >:

Public Types

typedef TDomain domain_type
 Domain type. More...
 
typedef TDomain::position_type position_type
 Position type. More...
 

Public Member Functions

SmartPtr< ApproximationSpace< TDomain > > approx_space ()
 returns approximation space More...
 
ConstSmartPtr< ApproximationSpace< TDomain > > approx_space () const
 returns approximation space More...
 
void check_setup (bool bNonRegularGrid)
 checks the setup of the elem disc More...
 
void clear_imports ()
 removes all imports More...
 
SmartPtr< TDomain > domain ()
 returns the domain More...
 
ConstSmartPtr< TDomain > domain () const
 returns the domain More...
 
const FunctionGroupfunction_group () const
 returns the current function group More...
 
ConstSmartPtr< FunctionPatternfunction_pattern () const
 returns the current function pattern More...
 
IDataImport< dim > & get_import (size_t i)
 returns an import More...
 
 IElemDiscBase (const char *functions="", const char *subsets="")
 Constructor. More...
 
 IElemDiscBase (const std::vector< std::string > &vFct, const std::vector< std::string > &vSubset)
 Constructor. More...
 
bool is_time_dependent () const
 returns if assembling is time-dependent More...
 
bool local_time_series_needed ()
 
const LocalVectorTimeSerieslocal_time_solutions () const
 returns the local time solutions More...
 
const FunctionIndexMappingmap () const
 returns the current function index mapping More...
 
size_t num_fct () const
 number of functions this discretization handles More...
 
size_t num_imports () const
 returns number of imports More...
 
size_t num_subsets () const
 number of subsets this discretization handles More...
 
virtual void prepare_setting (const std::vector< LFEID > &vLfeID, bool bNonRegularGrid)=0
 requests assembling for trial spaces and grid type More...
 
void register_import (IDataImport< dim > &Imp)
 registers a data import More...
 
virtual bool requests_local_time_series ()
 returns if local time series needed by assembling More...
 
void set_approximation_space (SmartPtr< ApproximationSpace< TDomain > > approxSpace)
 sets the approximation space More...
 
void set_functions (const std::string &functions)
 Approximation Space. More...
 
void set_functions (const std::vector< std::string > &functions)
 sets functions by vector of names More...
 
void set_stationary ()
 
void set_stationary (bool bStationaryForced=true)
 sets that the assembling is always stationary (even in instationary case) More...
 
void set_subsets (const std::string &subsets)
 sets subset(s) by name list, divided by ',' More...
 
void set_subsets (const std::vector< std::string > &subsets)
 sets subset(s) by name list, divided by ',' More...
 
void set_time_dependent (LocalVectorTimeSeries &locTimeSeries, const std::vector< number > &vScaleMass, const std::vector< number > &vScaleStiff)
 sets if assembling should be time-dependent and the local time series More...
 
void set_time_independent ()
 sets that the assembling is time independent More...
 
void set_time_point (const size_t timePoint)
 sets the current time point More...
 
TDomain::subset_handler_type & subset_handler ()
 returns the subset handler More...
 
const TDomain::subset_handler_type & subset_handler () const
 returns the subset handler More...
 
const std::vector< std::string > & symb_fcts () const
 returns the symbolic functions More...
 
const std::vector< std::string > & symb_subsets () const
 returns the symbolic subsets More...
 
number time () const
 returns currently set timepoint More...
 
size_t time_point () const
 returns the currently considered time point of the time-disc scheme More...
 
virtual int type () const
 returns the type of elem disc More...
 
virtual bool use_hanging () const
 returns if discretization acts on hanging nodes if present More...
 
virtual ~IElemDiscBase ()
 Virtual destructor. More...
 
const std::vector< number > & mass_scales () const
 
const std::vector< number > & stiff_scales () const
 
number mass_scale (const size_t timePoint) const
 
number stiff_scale (const size_t timePoint) const
 
number mass_scale () const
 
number stiff_scale () const
 

Static Public Attributes

static const int dim = TDomain::dim
 World dimension. More...
 

Protected Member Functions

virtual void approximation_space_changed ()
 callback invoked, when approximation space is changed More...
 
void set_function_pattern (ConstSmartPtr< FunctionPattern > fctPatt)
 sets current function pattern More...
 
void update_function_index_mapping ()
 updates the function index mapping More...
 

Protected Attributes

bool m_bStationaryForced
 flag if stationary assembling is to be used even in instationary assembling More...
 
FunctionGroup m_fctGrp
 current function group More...
 
FunctionIndexMapping m_fctIndexMap
 current function index mapping More...
 
LocalVectorTimeSeriesm_pLocalVectorTimeSeries
 list of local vectors for all solutions of the time series More...
 
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
 Approximation Space. More...
 
ConstSmartPtr< FunctionPatternm_spFctPattern
 current function pattern More...
 
size_t m_timePoint
 time point More...
 
std::vector< std::string > m_vFct
 vector holding name of all symbolic functions More...
 
std::vector< IDataImport< dim > * > m_vIImport
 data imports More...
 
std::vector< std::string > m_vSubset
 vector holding name of all symbolic subsets More...
 
std::vector< numberm_vScaleMass
 
std::vector< numberm_vScaleStiff
 

Detailed Description

template<typename TDomain>
class ug::IElemDiscBase< TDomain >

base class for all element-wise discretizations

This class is the base class for element-wise discretizations. An implementation of this class must provide local stiffness/mass-matrix contribution of one element to the global jacobian and local contributions of one element to the local defect.

Member Typedef Documentation

◆ domain_type

template<typename TDomain >
typedef TDomain ug::IElemDiscBase< TDomain >::domain_type

Domain type.

◆ position_type

template<typename TDomain >
typedef TDomain::position_type ug::IElemDiscBase< TDomain >::position_type

Position type.

Constructor & Destructor Documentation

◆ IElemDiscBase() [1/2]

template<typename TDomain >
ug::IElemDiscBase< TDomain >::IElemDiscBase ( const char *  functions = "",
const char *  subsets = "" 
)

◆ IElemDiscBase() [2/2]

template<typename TDomain >
ug::IElemDiscBase< TDomain >::IElemDiscBase ( const std::vector< std::string > &  vFct,
const std::vector< std::string > &  vSubset 
)

◆ ~IElemDiscBase()

template<typename TDomain >
virtual ug::IElemDiscBase< TDomain >::~IElemDiscBase ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ approx_space() [1/2]

template<typename TDomain >
SmartPtr<ApproximationSpace<TDomain> > ug::IElemDiscBase< TDomain >::approx_space ( )
inline

returns approximation space

References ug::IElemDiscBase< TDomain >::m_spApproxSpace.

◆ approx_space() [2/2]

template<typename TDomain >
ConstSmartPtr<ApproximationSpace<TDomain> > ug::IElemDiscBase< TDomain >::approx_space ( ) const
inline

returns approximation space

References ug::IElemDiscBase< TDomain >::m_spApproxSpace.

◆ approximation_space_changed()

template<typename TDomain >
virtual void ug::IElemDiscBase< TDomain >::approximation_space_changed ( )
inlineprotectedvirtual

callback invoked, when approximation space is changed

◆ check_setup()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::check_setup ( bool  bNonRegularGrid)

checks the setup of the elem disc

References ug::SubsetGroup::size(), and UG_LOG.

◆ clear_imports()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::clear_imports ( )
inline

removes all imports

References ug::IElemDiscBase< TDomain >::m_vIImport.

◆ domain() [1/2]

template<typename TDomain >
SmartPtr<TDomain> ug::IElemDiscBase< TDomain >::domain ( )
inline

returns the domain

References ug::IElemDiscBase< TDomain >::m_spApproxSpace.

◆ domain() [2/2]

template<typename TDomain >
ConstSmartPtr<TDomain> ug::IElemDiscBase< TDomain >::domain ( ) const
inline

returns the domain

References ug::IElemDiscBase< TDomain >::m_spApproxSpace.

◆ function_group()

template<typename TDomain >
const FunctionGroup& ug::IElemDiscBase< TDomain >::function_group ( ) const
inline

returns the current function group

References ug::IElemDiscBase< TDomain >::m_fctGrp.

◆ function_pattern()

template<typename TDomain >
ConstSmartPtr<FunctionPattern> ug::IElemDiscBase< TDomain >::function_pattern ( ) const
inline

returns the current function pattern

References ug::IElemDiscBase< TDomain >::m_spFctPattern.

◆ get_import()

template<typename TDomain >
IDataImport<dim>& ug::IElemDiscBase< TDomain >::get_import ( size_t  i)
inline

◆ is_time_dependent()

template<typename TDomain >
bool ug::IElemDiscBase< TDomain >::is_time_dependent ( ) const
inline

◆ local_time_series_needed()

template<typename TDomain >
bool ug::IElemDiscBase< TDomain >::local_time_series_needed ( )
inline

◆ local_time_solutions()

template<typename TDomain >
const LocalVectorTimeSeries* ug::IElemDiscBase< TDomain >::local_time_solutions ( ) const
inline

returns the local time solutions

This function returns the local time solutions. This a type of vector, that holds the local unknowns for each time point of a time series. Note, that the first sol is always the current (iterated, unknown) time point, while all remaining sols are the already computed time steps used e.g. in a time stepping scheme.

Returns
vLocalTimeSol vector of local time Solutions

References ug::IElemDiscBase< TDomain >::m_pLocalVectorTimeSeries.

◆ map()

template<typename TDomain >
const FunctionIndexMapping& ug::IElemDiscBase< TDomain >::map ( ) const
inline

returns the current function index mapping

References ug::IElemDiscBase< TDomain >::m_fctIndexMap.

◆ mass_scale() [1/2]

template<typename TDomain >
number ug::IElemDiscBase< TDomain >::mass_scale ( ) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_timePoint, and ug::IElemDiscBase< TDomain >::m_vScaleMass.

◆ mass_scale() [2/2]

template<typename TDomain >
number ug::IElemDiscBase< TDomain >::mass_scale ( const size_t  timePoint) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_vScaleMass.

◆ mass_scales()

template<typename TDomain >
const std::vector<number>& ug::IElemDiscBase< TDomain >::mass_scales ( ) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_vScaleMass.

◆ num_fct()

template<typename TDomain >
size_t ug::IElemDiscBase< TDomain >::num_fct ( ) const
inline

number of functions this discretization handles

References ug::IElemDiscBase< TDomain >::m_vFct.

Referenced by ug::NeumannBoundaryBase< TDomain >::NeumannBoundaryBase().

◆ num_imports()

template<typename TDomain >
size_t ug::IElemDiscBase< TDomain >::num_imports ( ) const
inline

◆ num_subsets()

template<typename TDomain >
size_t ug::IElemDiscBase< TDomain >::num_subsets ( ) const
inline

number of subsets this discretization handles

References ug::IElemDiscBase< TDomain >::m_vSubset.

◆ prepare_setting()

template<typename TDomain >
virtual void ug::IElemDiscBase< TDomain >::prepare_setting ( const std::vector< LFEID > &  vLfeID,
bool  bNonRegularGrid 
)
pure virtual

requests assembling for trial spaces and grid type

This function is called before the assembling starts. The IElemDisc-Implementation is supposed to checks if it can assemble the set of LFEID and the grid type. It may register corresponding assembling functions or perform other initialization. If the ElemDisc does not support the setting it should throw an exception.

Parameters
[in]vLfeIDvector of Local Finite Element IDs
[in]bNonRegularGridregular grid type

Implemented in ug::FV1InnerBoundaryElemDisc< TImpl, TDomain >, ug::NeumannBoundaryFV1< TDomain >, ug::NeumannBoundaryFV< TDomain >, ug::NeumannBoundaryFE< TDomain >, ug::DiracSourceDisc< TDomain >, ug::NavierStokes::CompressibleNavierStokesFV1< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionFE< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionFractFV1< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionFV< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionFV1< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionFVCR< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionStabFE< class >, ug::NavierStokes::CRNavierStokesSymBC< class >, ug::NavierStokes::NavierStokesFE< class >, ug::NavierStokes::NavierStokesFV< class >, ug::NavierStokes::NavierStokesFV1< class >, ug::NavierStokes::NavierStokesFVCR< class >, ug::NavierStokes::NavierStokesNoNormalStressOutflowFV< class >, ug::NavierStokes::NavierStokesNoNormalStressOutflowFV1< class >, ug::NavierStokes::NavierStokesNoNormalStressOutflowFVCR< class >, ug::NavierStokes::NavierStokesSymBCFV1< class >, ug::NavierStokes::NavierStokesWSBCFV1< class >, ug::SmallStrainMechanics::SmallStrainMechanicsElemDisc< class >, ug::Electromagnetism::NedelecLoopCurrent::AuxLaplaceLocAss, ug::Electromagnetism::NedelecProject::AuxLaplaceLocAss, and ug::Electromagnetism::EddyCurrent_E_Nedelec< class, class >.

◆ register_import()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::register_import ( IDataImport< dim > &  Imp)

registers a data import

◆ requests_local_time_series()

template<typename TDomain >
virtual bool ug::IElemDiscBase< TDomain >::requests_local_time_series ( )
inlinevirtual

returns if local time series needed by assembling

This callback must be implemented by a derived Elem Disc in order to handle time-dependent data. As return the derived Elem Disc can specify, if it really needs data from previous time steps for the (spatial) disc. The default is false.

Returns
if elem disc needs time series local solutions

Reimplemented in ug::NavierStokes::CompressibleNavierStokesBase< class >, ug::ConvectionDiffusionPlugin::ConvectionDiffusionBase< class >, ug::NavierStokes::CRNavierStokesSymBC< class >, ug::NavierStokes::IncompressibleNavierStokesBase< class >, ug::NavierStokes::NavierStokesBase< class >, ug::NavierStokes::NavierStokesFV< class >, ug::NavierStokes::NavierStokesNoNormalStressOutflowBase< class >, ug::NavierStokes::NavierStokesSymBCFV1< class >, and ug::NavierStokes::NavierStokesWSBCFV1< class >.

Referenced by ug::IElemDiscBase< TDomain >::local_time_series_needed().

◆ set_approximation_space()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_approximation_space ( SmartPtr< ApproximationSpace< TDomain > >  approxSpace)

sets the approximation space

Calls protected virtual 'approximation_space_changed', when a new approximation space has been set. Note that 'approximation_space_changed' is only called once if the same approximation space is set multiple times.

◆ set_function_pattern()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_function_pattern ( ConstSmartPtr< FunctionPattern fctPatt)
protected

sets current function pattern

◆ set_functions() [1/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_functions ( const std::string &  functions)

Approximation Space.

sets functions by name list, divided by ','

Referenced by ug::IElemDiscBase< TDomain >::IElemDiscBase().

◆ set_functions() [2/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_functions ( const std::vector< std::string > &  functions)

sets functions by vector of names

◆ set_stationary() [1/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_stationary ( )
inline

◆ set_stationary() [2/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_stationary ( bool  bStationaryForced = true)
inline

sets that the assembling is always stationary (even in instationary case)

References ug::IElemDiscBase< TDomain >::m_bStationaryForced.

◆ set_subsets() [1/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_subsets ( const std::string &  subsets)

sets subset(s) by name list, divided by ','

References ug::TokenizeString().

Referenced by ug::IElemDiscBase< TDomain >::IElemDiscBase().

◆ set_subsets() [2/2]

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_subsets ( const std::vector< std::string > &  subsets)

sets subset(s) by name list, divided by ','

References ug::RemoveWhitespaceFromString(), and UG_THROW.

◆ set_time_dependent()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_time_dependent ( LocalVectorTimeSeries locTimeSeries,
const std::vector< number > &  vScaleMass,
const std::vector< number > &  vScaleStiff 
)

sets if assembling should be time-dependent and the local time series

This function specifies if the assembling is time-dependent. If NULL is passed, the assembling is assumed to be time-independent. If a local time series is passed, this series is used as previous solution.

Parameters
[in]locTimeSeriesTime series of previous solutions

◆ set_time_independent()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_time_independent

sets that the assembling is time independent

◆ set_time_point()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::set_time_point ( const size_t  timePoint)
inline

sets the current time point

References ug::IElemDiscBase< TDomain >::m_timePoint.

◆ stiff_scale() [1/2]

template<typename TDomain >
number ug::IElemDiscBase< TDomain >::stiff_scale ( ) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_timePoint, and ug::IElemDiscBase< TDomain >::m_vScaleStiff.

◆ stiff_scale() [2/2]

template<typename TDomain >
number ug::IElemDiscBase< TDomain >::stiff_scale ( const size_t  timePoint) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_vScaleStiff.

◆ stiff_scales()

template<typename TDomain >
const std::vector<number>& ug::IElemDiscBase< TDomain >::stiff_scales ( ) const
inline

returns the weight factors of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_vScaleStiff.

◆ subset_handler() [1/2]

template<typename TDomain >
TDomain::subset_handler_type& ug::IElemDiscBase< TDomain >::subset_handler ( )
inline

returns the subset handler

References ug::IElemDiscBase< TDomain >::m_spApproxSpace, and UG_ASSERT.

◆ subset_handler() [2/2]

template<typename TDomain >
const TDomain::subset_handler_type& ug::IElemDiscBase< TDomain >::subset_handler ( ) const
inline

returns the subset handler

References ug::IElemDiscBase< TDomain >::m_spApproxSpace, and UG_ASSERT.

◆ symb_fcts()

template<typename TDomain >
const std::vector<std::string>& ug::IElemDiscBase< TDomain >::symb_fcts ( ) const
inline

returns the symbolic functions

References ug::IElemDiscBase< TDomain >::m_vFct.

◆ symb_subsets()

template<typename TDomain >
const std::vector<std::string>& ug::IElemDiscBase< TDomain >::symb_subsets ( ) const
inline

returns the symbolic subsets

References ug::IElemDiscBase< TDomain >::m_vSubset.

◆ time()

template<typename TDomain >
number ug::IElemDiscBase< TDomain >::time ( ) const
inline

◆ time_point()

template<typename TDomain >
size_t ug::IElemDiscBase< TDomain >::time_point ( ) const
inline

returns the currently considered time point of the time-disc scheme

References ug::IElemDiscBase< TDomain >::m_timePoint.

◆ type()

template<typename TDomain >
virtual int ug::IElemDiscBase< TDomain >::type ( ) const
inlinevirtual

returns the type of elem disc

Reimplemented in ug::NeumannBoundaryBase< TDomain >.

References ug::EDT_ELEM, and ug::EDT_SIDE.

◆ update_function_index_mapping()

template<typename TDomain >
void ug::IElemDiscBase< TDomain >::update_function_index_mapping
protected

updates the function index mapping

◆ use_hanging()

template<typename TDomain >
virtual bool ug::IElemDiscBase< TDomain >::use_hanging ( ) const
inlinevirtual

Member Data Documentation

◆ dim

template<typename TDomain >
const int ug::IElemDiscBase< TDomain >::dim = TDomain::dim
static

World dimension.

◆ m_bStationaryForced

template<typename TDomain >
bool ug::IElemDiscBase< TDomain >::m_bStationaryForced
protected

flag if stationary assembling is to be used even in instationary assembling

Referenced by ug::IElemDiscBase< TDomain >::is_time_dependent(), and ug::IElemDiscBase< TDomain >::set_stationary().

◆ m_fctGrp

template<typename TDomain >
FunctionGroup ug::IElemDiscBase< TDomain >::m_fctGrp
protected

current function group

Referenced by ug::IElemDiscBase< TDomain >::function_group().

◆ m_fctIndexMap

template<typename TDomain >
FunctionIndexMapping ug::IElemDiscBase< TDomain >::m_fctIndexMap
protected

current function index mapping

Referenced by ug::IElemDiscBase< TDomain >::map().

◆ m_pLocalVectorTimeSeries

template<typename TDomain >
LocalVectorTimeSeries* ug::IElemDiscBase< TDomain >::m_pLocalVectorTimeSeries
protected

◆ m_spApproxSpace

template<typename TDomain >
SmartPtr<ApproximationSpace<TDomain> > ug::IElemDiscBase< TDomain >::m_spApproxSpace
protected

◆ m_spFctPattern

template<typename TDomain >
ConstSmartPtr<FunctionPattern> ug::IElemDiscBase< TDomain >::m_spFctPattern
protected

current function pattern

Referenced by ug::IElemDiscBase< TDomain >::function_pattern().

◆ m_timePoint

◆ m_vFct

template<typename TDomain >
std::vector<std::string> ug::IElemDiscBase< TDomain >::m_vFct
protected

vector holding name of all symbolic functions

Referenced by ug::IElemDiscBase< TDomain >::num_fct(), and ug::IElemDiscBase< TDomain >::symb_fcts().

◆ m_vIImport

template<typename TDomain >
std::vector<IDataImport<dim>*> ug::IElemDiscBase< TDomain >::m_vIImport
protected

◆ m_vScaleMass

template<typename TDomain >
std::vector<number> ug::IElemDiscBase< TDomain >::m_vScaleMass
protected

weight factors for time dependent assembling

Referenced by ug::IElemDiscBase< TDomain >::mass_scale(), and ug::IElemDiscBase< TDomain >::mass_scales().

◆ m_vScaleStiff

template<typename TDomain >
std::vector<number> ug::IElemDiscBase< TDomain >::m_vScaleStiff
protected

weight factors for time dependent assembling

Referenced by ug::IElemDiscBase< TDomain >::stiff_scale(), and ug::IElemDiscBase< TDomain >::stiff_scales().

◆ m_vSubset

template<typename TDomain >
std::vector<std::string> ug::IElemDiscBase< TDomain >::m_vSubset
protected

vector holding name of all symbolic subsets

Referenced by ug::IElemDiscBase< TDomain >::num_subsets(), and ug::IElemDiscBase< TDomain >::symb_subsets().


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