ug4
ug::FunctionGroup Class Reference

#include <function_group.h>

Public Member Functions

void add (const char *name)
 adds function with a given name to this group More...
 
void add (const FunctionGroup &fctGroup)
 adds all functions of a function group More...
 
void add (const std::string &name)
 adds function with a given name to this group More...
 
void add (const std::vector< std::string > &name)
 adds functions with a given names to this group More...
 
void add (size_t fct)
 adds a function by id to this group More...
 
void add_all ()
 selects all subsets in the order of the underlying pattern More...
 
void clear ()
 clear all subsets More...
 
bool contains (const FunctionGroup &fctGroup) const
 returns true if all unique ids of another function group are contained More...
 
bool contains (size_t uniqueID) const
 returns true if unique id is contained in this group More...
 
int dim () const
 common dimension of all functions More...
 
int dim (size_t i) const
 dimension of a function More...
 
bool empty () const
 returns if function group is empty More...
 
ConstSmartPtr< FunctionPatternfunction_pattern () const
 get underlying function pattern More...
 
 FunctionGroup ()
 Default Constructor. More...
 
 FunctionGroup (ConstSmartPtr< FunctionPattern > spFuncPattern)
 Constructor setting function pattern. More...
 
 FunctionGroup (ConstSmartPtr< FunctionPattern > spFuncPattern, const char *name)
 Constructor setting function pattern and function. More...
 
 FunctionGroup (ConstSmartPtr< FunctionPattern > spFuncPattern, const std::string &name)
 Constructor setting function pattern and function. More...
 
 FunctionGroup (ConstSmartPtr< FunctionPattern > spFuncPattern, const std::vector< std::string > &vName)
 Constructor setting function pattern and functions. More...
 
size_t local_index (size_t uniqueID) const
 return index in Function group for a function More...
 
const char * name (size_t i) const
 returns the name of a function More...
 
std::string names () const
 returns the comma-separted names of all functions More...
 
size_t operator[] (size_t i) const
 returns unique function id of a function More...
 
void remove (const char *name)
 removes function with a given name from this group More...
 
void remove (const std::string &name)
 removes function with a given name from this group More...
 
void remove (const std::vector< std::string > &vName)
 removes functions with a given names from this group More...
 
void remove (size_t fct)
 removes a function by id from this group More...
 
void set_function_pattern (ConstSmartPtr< FunctionPattern > spFuncPattern)
 set underlying function pattern More...
 
size_t size () const
 number of functions in this group More...
 
void sort ()
 sorts the selected functions by increasing unique id More...
 
size_t unique_id (size_t i) const
 returns unique function id of a function More...
 
LFEID local_finite_element_id (size_t i) const
 
LFEID lfeid (size_t i) const
 

Protected Member Functions

bool is_init () const
 returns if FunctionGroup is ready for use More...
 

Protected Attributes

ConstSmartPtr< FunctionPatternm_spFunctionPattern
 underlying function pattern More...
 
std::vector< size_t > m_vFunction
 vector holding all selected unique function ids More...
 

Detailed Description

Group of functions represented by integers FunctionGroup is just a group of size_t, representing some functions. The function group is based on a FunctionPattern and the integer represent the position of the function in the function pattern. Selection of functions is best via usage of symbolic names of the functions.

Constructor & Destructor Documentation

◆ FunctionGroup() [1/5]

ug::FunctionGroup::FunctionGroup ( )

Default Constructor.

References clear().

◆ FunctionGroup() [2/5]

ug::FunctionGroup::FunctionGroup ( ConstSmartPtr< FunctionPattern spFuncPattern)

Constructor setting function pattern.

References clear().

◆ FunctionGroup() [3/5]

ug::FunctionGroup::FunctionGroup ( ConstSmartPtr< FunctionPattern spFuncPattern,
const char *  name 
)

Constructor setting function pattern and function.

References add(), clear(), and name().

◆ FunctionGroup() [4/5]

ug::FunctionGroup::FunctionGroup ( ConstSmartPtr< FunctionPattern spFuncPattern,
const std::string &  name 
)

Constructor setting function pattern and function.

References add(), clear(), and name().

◆ FunctionGroup() [5/5]

ug::FunctionGroup::FunctionGroup ( ConstSmartPtr< FunctionPattern spFuncPattern,
const std::vector< std::string > &  vName 
)

Constructor setting function pattern and functions.

References add(), and clear().

Member Function Documentation

◆ add() [1/5]

void ug::FunctionGroup::add ( const char *  name)

adds function with a given name to this group

References add(), name(), and ug::TokenizeString().

◆ add() [2/5]

void ug::FunctionGroup::add ( const FunctionGroup fctGroup)

adds all functions of a function group

References add(), function_pattern(), is_init(), m_spFunctionPattern, size(), and UG_THROW.

◆ add() [3/5]

void ug::FunctionGroup::add ( const std::string &  name)

adds function with a given name to this group

◆ add() [4/5]

void ug::FunctionGroup::add ( const std::vector< std::string > &  name)

adds functions with a given names to this group

◆ add() [5/5]

◆ add_all()

void ug::FunctionGroup::add_all ( )

selects all subsets in the order of the underlying pattern

References add(), is_init(), m_spFunctionPattern, and UG_THROW.

Referenced by ug::CreateFunctionIndexMapping().

◆ clear()

void ug::FunctionGroup::clear ( )
inline

clear all subsets

References m_vFunction.

Referenced by ug::CreateUnionOfFunctionGroups(), FunctionGroup(), and set_function_pattern().

◆ contains() [1/2]

bool ug::FunctionGroup::contains ( const FunctionGroup fctGroup) const

returns true if all unique ids of another function group are contained

References contains(), and size().

◆ contains() [2/2]

bool ug::FunctionGroup::contains ( size_t  uniqueID) const

◆ dim() [1/2]

int ug::FunctionGroup::dim ( ) const

common dimension of all functions

Returns the commen dimension of all functions of the group. This dimension is defined to be the highest dimension of grid entity the functions live on

Returns
-1 if no common dimension available dim >= 0 common dimension

References is_init(), size(), and UG_THROW.

◆ dim() [2/2]

int ug::FunctionGroup::dim ( size_t  i) const

dimension of a function

Returns the dimension of a function. The dimension is defined to be the highest dimension of grid entity the function lives on

References is_init(), m_spFunctionPattern, m_vFunction, size(), and UG_THROW.

◆ empty()

bool ug::FunctionGroup::empty ( ) const
inline

returns if function group is empty

References m_vFunction.

◆ function_pattern()

ConstSmartPtr<FunctionPattern> ug::FunctionGroup::function_pattern ( ) const
inline

get underlying function pattern

References m_spFunctionPattern.

Referenced by add(), ug::CreateFunctionIndexMapping(), and ug::vtk_export_ho().

◆ is_init()

bool ug::FunctionGroup::is_init ( ) const
inlineprotected

returns if FunctionGroup is ready for use

References m_spFunctionPattern.

Referenced by add(), add_all(), dim(), local_finite_element_id(), name(), and names().

◆ lfeid()

LFEID ug::FunctionGroup::lfeid ( size_t  i) const

returns the trial space of the discrete function fct

References local_finite_element_id().

◆ local_finite_element_id()

LFEID ug::FunctionGroup::local_finite_element_id ( size_t  i) const

returns the trial space of the discrete function fct

References is_init(), m_spFunctionPattern, m_vFunction, size(), and UG_THROW.

Referenced by lfeid().

◆ local_index()

size_t ug::FunctionGroup::local_index ( size_t  uniqueID) const

return index in Function group for a function

References m_vFunction, and UG_THROW.

Referenced by ug::CreateFunctionIndexMapping(), and ug::MultipleErrEstData< TDomain, TErrEstData >::get().

◆ name()

const char * ug::FunctionGroup::name ( size_t  i) const

returns the name of a function

References is_init(), m_spFunctionPattern, m_vFunction, size(), and UG_THROW.

Referenced by add(), FunctionGroup(), ug::IntegrateDiscFlux(), names(), remove(), and ug::vtk_export_ho().

◆ names()

std::string ug::FunctionGroup::names ( ) const

returns the comma-separted names of all functions

References is_init(), name(), s, size(), and UG_THROW.

◆ operator[]()

size_t ug::FunctionGroup::operator[] ( size_t  i) const
inline

returns unique function id of a function

References unique_id().

◆ remove() [1/4]

void ug::FunctionGroup::remove ( const char *  name)

removes function with a given name from this group

References name(), remove(), and ug::TokenizeString().

◆ remove() [2/4]

void ug::FunctionGroup::remove ( const std::string &  name)

removes function with a given name from this group

◆ remove() [3/4]

void ug::FunctionGroup::remove ( const std::vector< std::string > &  vName)

removes functions with a given names from this group

◆ remove() [4/4]

void ug::FunctionGroup::remove ( size_t  fct)

removes a function by id from this group

References ug::find(), m_vFunction, and UG_THROW.

Referenced by remove().

◆ set_function_pattern()

void ug::FunctionGroup::set_function_pattern ( ConstSmartPtr< FunctionPattern spFuncPattern)

set underlying function pattern

References clear(), and m_spFunctionPattern.

Referenced by ug::CreateUnionOfFunctionGroups(), and ug::UserDataInfo::set_function_pattern().

◆ size()

◆ sort()

void ug::FunctionGroup::sort ( )

sorts the selected functions by increasing unique id

References m_vFunction.

Referenced by ug::CreateUnionOfFunctionGroups().

◆ unique_id()

size_t ug::FunctionGroup::unique_id ( size_t  i) const
inline

returns unique function id of a function

References m_vFunction, size(), and UG_ASSERT.

Referenced by operator[](), and ug::vtk_export_ho().

Member Data Documentation

◆ m_spFunctionPattern

ConstSmartPtr<FunctionPattern> ug::FunctionGroup::m_spFunctionPattern
protected

◆ m_vFunction

std::vector<size_t> ug::FunctionGroup::m_vFunction
protected

vector holding all selected unique function ids

Referenced by add(), clear(), contains(), dim(), empty(), local_finite_element_id(), local_index(), name(), remove(), size(), sort(), and unique_id().


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