ug4
ug::FunctionPattern Class Reference

Describes the setup of discrete functions on a SubsetHandler. More...

#include <function_pattern.h>

+ Inheritance diagram for ug::FunctionPattern:

Classes

struct  Function
 internal structure to hold all functions More...
 

Public Member Functions

void add (const std::vector< std::string > &vName, LFEID id)
 add single solutions of LocalShapeFunctionSetID to the entire domain More...
 
void add (const std::vector< std::string > &vName, LFEID id, const std::vector< std::string > &vSubset)
 add single solutions of LocalShapeFunctionSetID to selected subsets More...
 
SubsetGroup all_subsets_grp_except_for (const char *names) const
 returns a subset group consisting of all the subsets in the domain except for the specified ones More...
 
void clear ()
 clear all functions More...
 
int dim (size_t fct) const
 returns the dimension in which solution lives More...
 
int dim_subset (int si) const
 dimension of subset More...
 
size_t fct_id (size_t loc_fct, int si) const
 returns function id of the loc_fct's function on subset si More...
 
size_t fct_id_by_name (const char *name) const
 returns the function id if function with given name found in pattern, exception else More...
 
 FunctionPattern (ConstSmartPtr< ISubsetHandler > spSH)
 Default Constructor. More...
 
bool is_def_everywhere (size_t fct) const
 returns true if the discrete function nr_fct is defined on all subsets More...
 
bool is_def_in_subset (size_t fct, int si) const
 returns true if the discrete function nr_fct is defined on subset si More...
 
bool is_locked () const
 returns if pattern is locked More...
 
void lock ()
 lock pattern (i.e. can not be changed then) More...
 
const char * name (size_t fct) const
 returns the name of a discrete function More...
 
std::vector< std::string > names () const
 returns the names of a discrete function More...
 
size_t num_fct () const
 number of discrete functions this dof distributor handles More...
 
size_t num_fct (int si) const
 number of discrete functions on a subset More...
 
int num_subsets () const
 number of subsets More...
 
void set_subset_handler (ConstSmartPtr< ISubsetHandler > spSH)
 sets new subsets handler More...
 
SubsetGroup subset_grp_by_name (const char *names) const
 returns a subset group consisting of the subsets specified by their names More...
 
ConstSmartPtr< ISubsetHandlersubset_handler () const
 get underlying subset handler More...
 
int subset_id_by_name (const char *name) const
 returns the subset id More...
 
const char * subset_name (int si) const
 returns the name of a subset More...
 
virtual ~FunctionPattern ()
 virtual destructor More...
 
const LFEIDlocal_finite_element_id (size_t fct) const
 
const LFEIDlfeid (size_t fct) const
 

Protected Attributes

bool m_bLocked
 
ConstSmartPtr< ISubsetHandlerm_spSH
 
std::vector< Functionm_vFunction
 

Private Member Functions

void add (const std::vector< std::string > &vName, LFEID id, const SubsetGroup &ssGrp)
 add single solutions of LocalShapeFunctionSetID to selected subsets More...
 

Detailed Description

Describes the setup of discrete functions on a SubsetHandler.

A Function Pattern is used to describe the setup for discrete functions on a domain. Therefore, it has the underlying SubsetHandler of the Domain. The functions (sometimes also called grid functions) are defined with respect to the subsets: A function can 'live' on parts of the subsets as well as on the whole domain.

Constructor & Destructor Documentation

◆ FunctionPattern()

ug::FunctionPattern::FunctionPattern ( ConstSmartPtr< ISubsetHandler spSH)
inline

Default Constructor.

References clear().

◆ ~FunctionPattern()

virtual ug::FunctionPattern::~FunctionPattern ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ add() [1/3]

void ug::FunctionPattern::add ( const std::vector< std::string > &  vName,
LFEID  id 
)

add single solutions of LocalShapeFunctionSetID to the entire domain

Parameters
[in]namename(s) of single solution (comma separated)
[in]idShape Function set id
[in]dimDimension (optional)

References ug::LFEID::ADAPTIV, ug::SubsetGroup::add_all(), ug::LFEID::dim(), ug::DimensionOfSubsets(), m_bLocked, m_spSH, m_vFunction, name(), ug::LFEID::NONE, ug::LFEID::order(), ug::SubsetGroup::set_subset_handler(), ug::LFEID::type(), and UG_THROW.

Referenced by add().

◆ add() [2/3]

void ug::FunctionPattern::add ( const std::vector< std::string > &  vName,
LFEID  id,
const std::vector< std::string > &  vSubset 
)

add single solutions of LocalShapeFunctionSetID to selected subsets

Parameters
[in]namename(s) of single solution (comma separated)
[in]idShape Function set id
[in]subsetsSubsets separated by ','
[in]dimDimension

References add(), and m_spSH.

◆ add() [3/3]

void ug::FunctionPattern::add ( const std::vector< std::string > &  vName,
LFEID  id,
const SubsetGroup ssGrp 
)
private

add single solutions of LocalShapeFunctionSetID to selected subsets

Parameters
[in]namename(s) of single solution (comma separated)
[in]idShape Function set id
[in]SubsetIndicesSubsetGroup, where solution lives
[in]dimDimension

References ug::LFEID::ADAPTIV, ug::LFEID::dim(), ug::SubsetGroup::get_highest_subset_dimension(), m_bLocked, m_spSH, m_vFunction, name(), ug::LFEID::NONE, ug::LFEID::order(), ug::SubsetGroup::subset_handler(), ug::LFEID::type(), and UG_THROW.

◆ all_subsets_grp_except_for()

SubsetGroup ug::FunctionPattern::all_subsets_grp_except_for ( const char *  names) const
inline

returns a subset group consisting of all the subsets in the domain except for the specified ones

References ug::SubsetGroup::add_all(), names(), ug::SubsetGroup::remove(), subset_handler(), and ug::TokenizeString().

◆ clear()

void ug::FunctionPattern::clear ( )
inline

clear all functions

References is_locked(), m_vFunction, and UG_THROW.

Referenced by FunctionPattern(), and set_subset_handler().

◆ dim()

int ug::FunctionPattern::dim ( size_t  fct) const
inline

◆ dim_subset()

int ug::FunctionPattern::dim_subset ( int  si) const
inline

dimension of subset

References ug::DimensionOfSubset(), and m_spSH.

Referenced by ug::DoFDistributionInfo::print_local_dof_statistic().

◆ fct_id()

size_t ug::FunctionPattern::fct_id ( size_t  loc_fct,
int  si 
) const
inline

returns function id of the loc_fct's function on subset si

References is_def_in_subset().

◆ fct_id_by_name()

size_t ug::FunctionPattern::fct_id_by_name ( const char *  name) const

returns the function id if function with given name found in pattern, exception else

References m_vFunction, name(), and UG_THROW.

◆ is_def_everywhere()

bool ug::FunctionPattern::is_def_everywhere ( size_t  fct) const
inline

returns true if the discrete function nr_fct is defined on all subsets

References m_vFunction, num_fct(), and UG_ASSERT.

Referenced by ug::DoFDistributionInfo::print_local_dof_statistic().

◆ is_def_in_subset()

bool ug::FunctionPattern::is_def_in_subset ( size_t  fct,
int  si 
) const
inline

returns true if the discrete function nr_fct is defined on subset si

References m_vFunction, num_fct(), and UG_ASSERT.

Referenced by ug::DoFDistributionInfo::create_offsets(), fct_id(), num_fct(), and ug::DoFDistributionInfo::print_local_dof_statistic().

◆ is_locked()

bool ug::FunctionPattern::is_locked ( ) const
inline

returns if pattern is locked

References m_bLocked.

Referenced by clear().

◆ lfeid()

const LFEID& ug::FunctionPattern::lfeid ( size_t  fct) const
inline

returns the trial space of a discrete function

References local_finite_element_id().

Referenced by ug::DoFDistributionInfo::create_offsets(), and ug::DoFDistributionInfo::print_local_dof_statistic().

◆ local_finite_element_id()

const LFEID& ug::FunctionPattern::local_finite_element_id ( size_t  fct) const
inline

returns the trial space of a discrete function

References m_vFunction, num_fct(), and UG_ASSERT.

Referenced by lfeid().

◆ lock()

void ug::FunctionPattern::lock ( )
inline

lock pattern (i.e. can not be changed then)

References m_bLocked.

Referenced by ug::DoFDistributionInfo::init().

◆ name()

const char* ug::FunctionPattern::name ( size_t  fct) const
inline

returns the name of a discrete function

References m_vFunction, num_fct(), and UG_ASSERT.

Referenced by add(), fct_id_by_name(), names(), ug::DoFDistributionInfo::print_local_dof_statistic(), and subset_id_by_name().

◆ names()

std::vector<std::string> ug::FunctionPattern::names ( ) const
inline

returns the names of a discrete function

References name(), and num_fct().

Referenced by all_subsets_grp_except_for(), and subset_grp_by_name().

◆ num_fct() [1/2]

size_t ug::FunctionPattern::num_fct ( ) const
inline

◆ num_fct() [2/2]

size_t ug::FunctionPattern::num_fct ( int  si) const
inline

number of discrete functions on a subset

References is_def_in_subset(), m_vFunction, and num_fct().

◆ num_subsets()

int ug::FunctionPattern::num_subsets ( ) const
inline

◆ set_subset_handler()

void ug::FunctionPattern::set_subset_handler ( ConstSmartPtr< ISubsetHandler spSH)

sets new subsets handler

References clear(), m_bLocked, m_spSH, and UG_THROW.

◆ subset_grp_by_name()

SubsetGroup ug::FunctionPattern::subset_grp_by_name ( const char *  names) const
inline

returns a subset group consisting of the subsets specified by their names

References names(), subset_handler(), and ug::TokenizeString().

◆ subset_handler()

ConstSmartPtr<ISubsetHandler> ug::FunctionPattern::subset_handler ( ) const
inline

get underlying subset handler

References m_spSH.

Referenced by all_subsets_grp_except_for(), and subset_grp_by_name().

◆ subset_id_by_name()

int ug::FunctionPattern::subset_id_by_name ( const char *  name) const

returns the subset id

References m_spSH, name(), and UG_THROW.

◆ subset_name()

const char* ug::FunctionPattern::subset_name ( int  si) const
inline

returns the name of a subset

References m_spSH.

Referenced by ug::DoFDistributionInfo::print_local_dof_statistic().

Member Data Documentation

◆ m_bLocked

bool ug::FunctionPattern::m_bLocked
protected

◆ m_spSH

◆ m_vFunction

std::vector<Function> ug::FunctionPattern::m_vFunction
protected

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