ug4
|
#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< FunctionPattern > | function_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< FunctionPattern > | m_spFunctionPattern |
underlying function pattern More... | |
std::vector< size_t > | m_vFunction |
vector holding all selected unique function ids More... | |
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.
ug::FunctionGroup::FunctionGroup | ( | ) |
Default Constructor.
References clear().
ug::FunctionGroup::FunctionGroup | ( | ConstSmartPtr< FunctionPattern > | spFuncPattern | ) |
Constructor setting function pattern.
References clear().
ug::FunctionGroup::FunctionGroup | ( | ConstSmartPtr< FunctionPattern > | spFuncPattern, |
const char * | name | ||
) |
ug::FunctionGroup::FunctionGroup | ( | ConstSmartPtr< FunctionPattern > | spFuncPattern, |
const std::string & | name | ||
) |
ug::FunctionGroup::FunctionGroup | ( | ConstSmartPtr< FunctionPattern > | spFuncPattern, |
const std::vector< std::string > & | vName | ||
) |
void ug::FunctionGroup::add | ( | const char * | name | ) |
adds function with a given name to this group
References add(), name(), and ug::TokenizeString().
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.
void ug::FunctionGroup::add | ( | const std::string & | name | ) |
adds function with a given name to this group
void ug::FunctionGroup::add | ( | const std::vector< std::string > & | name | ) |
adds functions with a given names to this group
void ug::FunctionGroup::add | ( | size_t | fct | ) |
adds a function by id to this group
References ug::find(), is_init(), m_spFunctionPattern, m_vFunction, and UG_THROW.
Referenced by add(), ug::MultipleErrEstData< TDomain, TErrEstData >::add(), add_all(), ug::CheckGFforNaN(), ug::CheckGFValuesWithinBounds(), ug::CreateUnionOfFunctionGroups(), ug::GridFunctionComponentSpace< TGridFunction >::distance2(), FunctionGroup(), ug::GridFunctionComponentSpace< TGridFunction >::norm2(), and ug::SumGFValuesAt().
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().
|
inline |
clear all subsets
References m_vFunction.
Referenced by ug::CreateUnionOfFunctionGroups(), FunctionGroup(), and set_function_pattern().
bool ug::FunctionGroup::contains | ( | const FunctionGroup & | fctGroup | ) | const |
returns true if all unique ids of another function group are contained
References contains(), and size().
bool ug::FunctionGroup::contains | ( | size_t | uniqueID | ) | const |
returns true if unique id is contained in this group
References ug::find(), and m_vFunction.
Referenced by ug::MultipleErrEstData< TDomain, TErrEstData >::add(), contains(), ug::CreateFunctionIndexMapping(), and ug::MultipleErrEstData< TDomain, TErrEstData >::get().
int ug::FunctionGroup::dim | ( | ) | const |
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.
|
inline |
returns if function group is empty
References m_vFunction.
|
inline |
get underlying function pattern
References m_spFunctionPattern.
Referenced by add(), ug::CreateFunctionIndexMapping(), and ug::vtk_export_ho().
|
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 ug::FunctionGroup::lfeid | ( | size_t | i | ) | const |
returns the trial space of the discrete function fct
References 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().
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().
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().
std::string ug::FunctionGroup::names | ( | ) | const |
|
inline |
returns unique function id of a function
References unique_id().
void ug::FunctionGroup::remove | ( | const char * | name | ) |
removes function with a given name from this group
References name(), remove(), and ug::TokenizeString().
void ug::FunctionGroup::remove | ( | const std::string & | name | ) |
removes function with a given name from this group
void ug::FunctionGroup::remove | ( | const std::vector< std::string > & | vName | ) |
removes functions with a given names from this group
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().
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().
|
inline |
number of functions in this group
References m_vFunction.
Referenced by add(), ug::GridFunctionComponentSpace< TGridFunction >::add_distance_values(), ug::GridFunctionComponentSpace< TGridFunction >::add_norm_values(), ug::IObstacleConstraint< TDomain, TAlgebra >::check_functions_and_subsets(), ug::DirichletBoundary< TDomain, TAlgebra >::check_functions_and_subsets(), ug::CheckGFforNaN(), ug::CheckGFValuesWithinBounds(), contains(), ug::CreateFunctionIndexMapping(), dim(), ug::DirichletBoundary< TDomain, TAlgebra >::extract_data(), ug::IObstacleConstraint< TDomain, TAlgebra >::extract_data(), ug::IntegrateDiscFlux(), local_finite_element_id(), name(), names(), ug::operator<<(), unique_id(), and ug::vtk_export_ho().
void ug::FunctionGroup::sort | ( | ) |
sorts the selected functions by increasing unique id
References m_vFunction.
Referenced by ug::CreateUnionOfFunctionGroups().
|
inline |
returns unique function id of a function
References m_vFunction, size(), and UG_ASSERT.
Referenced by operator[](), and ug::vtk_export_ho().
|
protected |
underlying function pattern
Referenced by add(), add_all(), dim(), function_pattern(), is_init(), local_finite_element_id(), name(), and set_function_pattern().
|
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().