ug4
ug::IApproximationSpace Class Reference

describes the ansatz spaces on a domain More...

#include <approximation_space.h>

+ Inheritance diagram for ug::IApproximationSpace:

Public Types

typedef MultiGrid grid_type
 Type of Subset Handler. More...
 
typedef MGSubsetHandler subset_handler_type
 Type of Subset Handler. More...
 

Public Member Functions

void add (const char *name, const char *type)
 adds function using string to indicate finite element type More...
 
void add (const char *name, const char *type, const char *subsets)
 adds function using string to indicate finite element type More...
 
void add (const char *name, const char *type, int order)
 adds function using string to indicate finite element type More...
 
void add (const char *name, const char *type, int order, const char *subsets)
 adds function using string to indicate finite element type More...
 
void add (const std::vector< std::string > &vName, const char *type)
 adds function using string to indicate finite element type More...
 
void add (const std::vector< std::string > &vName, const char *type, const std::vector< std::string > &vSubsets)
 adds function using string to indicate finite element type More...
 
void add (const std::vector< std::string > &vName, const char *type, int order)
 adds function using string to indicate finite element type More...
 
void add (const std::vector< std::string > &vName, const char *type, int order, const std::vector< std::string > &vSubsets)
 adds function using string to indicate finite element type More...
 
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...
 
void clear ()
 clears functions More...
 
std::vector< SmartPtr< DoFDistribution > > dof_distributions () const
 returns all currently created dof distributions More...
 
bool grouped () const
 returns if dofs are grouped More...
 
 IApproximationSpace (SmartPtr< subset_handler_type > spMGSH, SmartPtr< grid_type > spMG)
 Constructor. More...
 
 IApproximationSpace (SmartPtr< subset_handler_type > spMGSH, SmartPtr< grid_type >, const AlgebraType &algebraType)
 Constructor setting the grouping flag. More...
 
void init_levels ()
 initializes all level dof distributions More...
 
void init_surfaces ()
 initializes all surface dof distributions More...
 
void init_top_surface ()
 initializes all top surface dof distributions More...
 
bool might_contain_ghosts () const
 returns if ghosts might be present on any level More...
 
bool might_contain_ghosts (int lvl) const
 returns if ghosts might be present on a level More...
 
size_t num_levels () const
 returns the number of level More...
 
void print_layout_statistic () const
 prints statistic on layouts More...
 
void print_statistic () const
 prints statistic about DoF Distribution More...
 
void print_statistic (std::string flags) const
 prints statistic about DoF Distribution More...
 
const RevisionCounterrevision () const
 returns the current revision More...
 
ConstSmartPtr< MGSubsetHandlersubset_handler () const
 get underlying subset handler More...
 
ConstSmartPtr< SurfaceViewsurface_view () const
 returns the approximation space More...
 
 ~IApproximationSpace ()
 Destructor. More...
 
SmartPtr< DoFDistributiondof_distribution (const GridLevel &gl, bool bCreate=true)
 
SmartPtr< DoFDistributiondd (const GridLevel &gl, bool bCreate=true)
 
ConstSmartPtr< DoFDistributiondof_distribution (const GridLevel &gl, bool bCreate=true) const
 
ConstSmartPtr< DoFDistributiondd (const GridLevel &gl, bool bCreate=true) const
 
ConstSmartPtr< DoFDistributionInfoddinfo () const
 
ConstSmartPtr< DoFDistributionInfodof_distribution_info () const
 
- Public Member Functions inherited from ug::DoFDistributionInfoProvider
SubsetGroup all_subsets_grp_except_for (const char *names) const
 returns subset group of all the subsets except for (by name) More...
 
int dim (size_t fct) const
 returns the dimension in which solution lives More...
 
int dim_subset (int si) const
 returns dimension of subset More...
 
ConstSmartPtr< DoFDistributionInfodof_distribution_info () const
 returns underlying info More...
 
 DoFDistributionInfoProvider ()
 constructor More...
 
 DoFDistributionInfoProvider (ConstSmartPtr< DoFDistributionInfo > spDDI)
 constructor More...
 
FunctionGroup fct_grp_by_name (const char *names) const
 returns a function group to a string of functions More...
 
size_t fct_id_by_name (const char *name) const
 returns fct id by name More...
 
ConstSmartPtr< FunctionPatternfunction_pattern () const
 returns the function pattern More...
 
bool is_def_everywhere (size_t fct) const
 returns true if the discrete function nr_fct is defined everywhere More...
 
bool is_def_in_subset (size_t fct, int si) const
 returns if a function is defined on a subset More...
 
size_t max_dofs (const GridBaseObjectId gbo) const
 returns the maximum number of dofs on a grid base object type More...
 
size_t max_dofs (const GridBaseObjectId gbo, const int si) const
 returns the maximum number of dofs on a grid base object on a subset More...
 
size_t max_dofs (const int dim) const
 returns the maximum number of dofs on grid objects in a dimension More...
 
size_t max_dofs (const int dim, const int si) const
 returns the maximum number of dofs in a dimension on a subset More...
 
size_t max_dofs (const ReferenceObjectID roid) const
 returns the maximum number of dofs on reference object type More...
 
size_t max_fct_dofs (const size_t fct, const GridBaseObjectId gbo) const
 returns the maximal number of dofs on a base object type for a function component More...
 
size_t max_fct_dofs (const size_t fct, const GridBaseObjectId gbo, const int si) const
 returns the maximum number of dofs on a grid base object on a subset for a function component More...
 
size_t max_fct_dofs (const size_t fct, const int dim, const int si) const
 returns the maximum number of dofs in a dimension on a subset for a function component More...
 
size_t max_fct_dofs (const size_t fct, const ReferenceObjectID roid) const
 returns the number of dofs on a reference object for a function component More...
 
size_t max_fct_dofs (const size_t fct, int dim) const
 returns the maximal number of dofs on a dimension for a function component More...
 
std::string name (size_t fct) const
 returns the name of the discrete function nr_fct More...
 
std::vector< std::string > names () const
 returns the names of the discrete functions More...
 
size_t num_dofs (const ReferenceObjectID roid, const int si) const
 returns the number of dofs on a Reference Object on a subset More...
 
size_t num_fct () const
 number of discrete functions on subset si More...
 
size_t num_fct (int si) const
 number of discrete functions on subset si More...
 
size_t num_fct_dofs (const size_t fct, const ReferenceObjectID roid, const int si) const
 returns the number of dofs on a Reference Object on a subset for a function component More...
 
int num_subsets () const
 returns number of subsets More...
 
size_t offset (const ReferenceObjectID roid, const int si, const size_t fct) const
 returns the offset for reference element, subset and function More...
 
void print_local_dof_statistic () const
 prints statistic on local dof distribution More...
 
void print_local_dof_statistic (int verboseLev) const
 prints informations More...
 
void set_dof_distribution_info (ConstSmartPtr< DoFDistributionInfo > spDDI)
 sets the dd info More...
 
SubsetGroup subset_grp_by_name (const char *names) const
 returns subset group by name More...
 
ConstSmartPtr< ISubsetHandlersubset_handler () const
 returns the subset handler More...
 
int subset_id_by_name (const char *name) const
 returns the subset id More...
 
std::string subset_name (int si) const
 returns subset name More...
 
const LFEIDlocal_finite_element_id (size_t fct) const
 
const LFEIDlfeid (size_t fct) const
 

Protected Member Functions

void create_dof_distribution (const GridLevel &gl)
 creates a dof distribution More...
 
void dof_distribution_info_required ()
 create dof distribution info More...
 
void grid_changed_callback (const GridMessage_Adaption &msg)
 
void grid_distribution_callback (const GridMessage_Distribution &msg)
 called during parallel redistribution More...
 
void init (SmartPtr< subset_handler_type > spMGSH, SmartPtr< grid_type > spMG, const AlgebraType &algebraType)
 initializing More...
 
void register_at_adaption_msg_hub ()
 registers at message hub for grid adaption More...
 
void reinit ()
 reinits all data after grid adaption More...
 
void surface_view_required ()
 creates surface SurfaceView if needed More...
 

Protected Attributes

AlgebraType m_algebraType
 suitable algebra type for the index distribution pattern More...
 
bool m_bAdaptionIsActive
 
bool m_bGrouped
 flag if DoFs should be grouped More...
 
RevisionCounter m_RevCnt
 revision counter More...
 
SmartPtr< DoFDistributionInfom_spDoFDistributionInfo
 DofDistributionInfo. More...
 
MessageHub::SPCallbackId m_spGridAdaptionCallbackID
 message hub id More...
 
MessageHub::SPCallbackId m_spGridDistributionCallbackID
 
SmartPtr< MultiGridm_spMG
 multigrid, where elements are stored More...
 
SmartPtr< MGSubsetHandlerm_spMGSH
 subsethandler, where elements are stored More...
 
SmartPtr< SurfaceViewm_spSurfaceView
 Surface View. More...
 
std::vector< SmartPtr< DoFDistribution > > m_vDD
 MG Level DoF Distribution. More...
 
SmartPtr< DoFIndexStoragem_spDoFIndexStrgForLevelNoGhost
 
SmartPtr< DoFIndexStoragem_spDoFIndexStrgForLevelWithGhost
 
- Protected Attributes inherited from ug::DoFDistributionInfoProvider
ConstSmartPtr< DoFDistributionInfom_spDDI
 Function Pattern. More...
 

Detailed Description

describes the ansatz spaces on a domain

This class provides grid function spaces on a domain.

The Domain defines a partition of the Grid/Multigrid in terms of subsets. The user can add discrete functions on this subsets or unions of them.

Once finalized, this function pattern is fixed. Internally DoF indices are created. Using this Approximation Space the user can create GridFunctions of the following types:

  • surface grid function = grid function representing the space on the surface grid
  • level grid function = grid function representing the space on a level grid (NOTE: For a fully refined Multigrid a level grid covers the whole domain. However for a locally/adaptively refined MultiGrid the level grid solution is only living on a part of the domain)

Member Typedef Documentation

◆ grid_type

Type of Subset Handler.

◆ subset_handler_type

Constructor & Destructor Documentation

◆ IApproximationSpace() [1/2]

ug::IApproximationSpace::IApproximationSpace ( SmartPtr< subset_handler_type spMGSH,
SmartPtr< grid_type spMG 
)

Constructor.

References boost::get(), and init().

◆ IApproximationSpace() [2/2]

ug::IApproximationSpace::IApproximationSpace ( SmartPtr< subset_handler_type spMGSH,
SmartPtr< grid_type spMG,
const AlgebraType algebraType 
)

Constructor setting the grouping flag.

References init().

◆ ~IApproximationSpace()

ug::IApproximationSpace::~IApproximationSpace ( )

Destructor.

Member Function Documentation

◆ add() [1/10]

void ug::IApproximationSpace::add ( const char *  name,
const char *  type 
)

adds function using string to indicate finite element type

References name, and ug::TokenizeTrimString().

◆ add() [2/10]

void ug::IApproximationSpace::add ( const char *  name,
const char *  type,
const char *  subsets 
)

adds function using string to indicate finite element type

Parameters
[in]namename(s) of single solution (comma separated)
[in]typetype of local finite element space
[in]subsetsSubsets separated by ','

References name, and ug::TokenizeTrimString().

◆ add() [3/10]

void ug::IApproximationSpace::add ( const char *  name,
const char *  type,
int  order 
)

adds function using string to indicate finite element type

References name, and ug::TokenizeTrimString().

◆ add() [4/10]

void ug::IApproximationSpace::add ( const char *  name,
const char *  type,
int  order,
const char *  subsets 
)

adds function using string to indicate finite element type

Parameters
[in]namename(s) of single solution (comma separated)
[in]typetype of local finite element space
[in]orderorder of local finite element space
[in]subsetsSubsets separated by ','

References name, and ug::TokenizeTrimString().

◆ add() [5/10]

void ug::IApproximationSpace::add ( const std::vector< std::string > &  vName,
const char *  type 
)

adds function using string to indicate finite element type

References ug::ConvertStringToLFEID(), dim, ug::DIM_SUBSET_EMPTY_GRID, ug::DimensionOfSubsets(), and UG_THROW.

◆ add() [6/10]

void ug::IApproximationSpace::add ( const std::vector< std::string > &  vName,
const char *  type,
const std::vector< std::string > &  vSubsets 
)

adds function using string to indicate finite element type

References ug::ConvertStringToLFEID(), dim, ug::DIM_SUBSET_EMPTY_GRID, ug::SubsetGroup::get_highest_subset_dimension(), and UG_THROW.

◆ add() [7/10]

void ug::IApproximationSpace::add ( const std::vector< std::string > &  vName,
const char *  type,
int  order 
)

adds function using string to indicate finite element type

References ug::ConvertStringToLFEID(), dim, ug::DIM_SUBSET_EMPTY_GRID, ug::DimensionOfSubsets(), and UG_THROW.

◆ add() [8/10]

void ug::IApproximationSpace::add ( const std::vector< std::string > &  vName,
const char *  type,
int  order,
const std::vector< std::string > &  vSubsets 
)

adds function using string to indicate finite element type

References ug::ConvertStringToLFEID(), dim, ug::DIM_SUBSET_EMPTY_GRID, ug::SubsetGroup::get_highest_subset_dimension(), and UG_THROW.

◆ add() [9/10]

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

add single solutions of LocalShapeFunctionSetID to the entire domain

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

References m_spDoFDistributionInfo.

◆ add() [10/10]

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

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 ','

References m_spDoFDistributionInfo.

◆ clear()

void ug::IApproximationSpace::clear ( )
inline

clears functions

References m_spDoFDistributionInfo.

◆ create_dof_distribution()

void ug::IApproximationSpace::create_dof_distribution ( const GridLevel gl)
protected

creates a dof distribution

References ug::GridLevel::ghosts(), ug::GridLevel::is_level(), and ug::SortDD().

◆ dd() [1/2]

SmartPtr< DoFDistribution > ug::IApproximationSpace::dd ( const GridLevel gl,
bool  bCreate = true 
)

returns dof distribution for a grid level

◆ dd() [2/2]

ConstSmartPtr< DoFDistribution > ug::IApproximationSpace::dd ( const GridLevel gl,
bool  bCreate = true 
) const

returns dof distribution for a grid level

◆ ddinfo()

ConstSmartPtr<DoFDistributionInfo> ug::IApproximationSpace::ddinfo ( ) const
inline

returns dof distribution info

References m_spDoFDistributionInfo.

Referenced by dof_distribution_info().

◆ dof_distribution() [1/2]

SmartPtr< DoFDistribution > ug::IApproximationSpace::dof_distribution ( const GridLevel gl,
bool  bCreate = true 
)

returns dof distribution for a grid level

References UG_THROW.

◆ dof_distribution() [2/2]

ConstSmartPtr< DoFDistribution > ug::IApproximationSpace::dof_distribution ( const GridLevel gl,
bool  bCreate = true 
) const

returns dof distribution for a grid level

◆ dof_distribution_info()

ConstSmartPtr<DoFDistributionInfo> ug::IApproximationSpace::dof_distribution_info ( ) const
inline

returns dof distribution info

References ddinfo().

◆ dof_distribution_info_required()

void ug::IApproximationSpace::dof_distribution_info_required ( )
protected

create dof distribution info

References ug::NUM_REFERENCE_OBJECTS, and UG_THROW.

◆ dof_distributions()

std::vector< SmartPtr< DoFDistribution > > ug::IApproximationSpace::dof_distributions ( ) const

returns all currently created dof distributions

Referenced by ug::OrderCuthillMcKee(), ug::OrderDownwind(), and ug::OrderLex().

◆ grid_changed_callback()

void ug::IApproximationSpace::grid_changed_callback ( const GridMessage_Adaption msg)
protected

this callback is called by the message hub, when a grid change has been performed. It will call all necessary actions in order to keep the grid correct for computations.

References ug::GridMessage_Adaption::adaption_begins(), ug::GridMessage_Adaption::adaption_ends(), pcl::ProcRank(), ug::SaveParallelGridLayout(), ug::SaveSurfaceViewTransformed(), UG_LOG, and UG_THROW.

Referenced by register_at_adaption_msg_hub().

◆ grid_distribution_callback()

void ug::IApproximationSpace::grid_distribution_callback ( const GridMessage_Distribution msg)
protected

◆ grouped()

bool ug::IApproximationSpace::grouped ( ) const
inline

returns if dofs are grouped

References m_bGrouped.

◆ init()

void ug::IApproximationSpace::init ( SmartPtr< subset_handler_type spMGSH,
SmartPtr< grid_type spMG,
const AlgebraType algebraType 
)
protected

initializing

References UG_THROW.

◆ init_levels()

void ug::IApproximationSpace::init_levels ( )

initializes all level dof distributions

References PROFILE_FUNC.

◆ init_surfaces()

void ug::IApproximationSpace::init_surfaces ( )

initializes all surface dof distributions

References PROFILE_FUNC.

◆ init_top_surface()

void ug::IApproximationSpace::init_top_surface ( )

initializes all top surface dof distributions

References PROFILE_FUNC.

◆ might_contain_ghosts() [1/2]

bool ug::IApproximationSpace::might_contain_ghosts ( ) const

returns if ghosts might be present on any level

◆ might_contain_ghosts() [2/2]

bool ug::IApproximationSpace::might_contain_ghosts ( int  lvl) const

returns if ghosts might be present on a level

References ug::EDGE, ug::FACE, ug::DistributedGridManager::grid_layout_map(), UG_THROW, ug::VERTEX, and ug::VOLUME.

◆ num_levels()

size_t ug::IApproximationSpace::num_levels ( ) const
inline

returns the number of level

References m_spMGSH.

◆ print_layout_statistic()

void ug::IApproximationSpace::print_layout_statistic ( ) const

◆ print_statistic() [1/2]

void ug::IApproximationSpace::print_statistic ( ) const

prints statistic about DoF Distribution

◆ print_statistic() [2/2]

void ug::IApproximationSpace::print_statistic ( std::string  flags) const

◆ register_at_adaption_msg_hub()

void ug::IApproximationSpace::register_at_adaption_msg_hub ( )
protected

registers at message hub for grid adaption

References grid_changed_callback(), and grid_distribution_callback().

◆ reinit()

void ug::IApproximationSpace::reinit ( )
protected

reinits all data after grid adaption

References PROFILE_FUNC.

◆ revision()

const RevisionCounter& ug::IApproximationSpace::revision ( ) const
inline

returns the current revision

References m_RevCnt.

◆ subset_handler()

ConstSmartPtr<MGSubsetHandler> ug::IApproximationSpace::subset_handler ( ) const
inline

get underlying subset handler

References m_spMGSH.

◆ surface_view()

ConstSmartPtr<SurfaceView> ug::IApproximationSpace::surface_view ( ) const
inline

returns the approximation space

References m_spSurfaceView.

◆ surface_view_required()

void ug::IApproximationSpace::surface_view_required ( )
protected

creates surface SurfaceView if needed

Member Data Documentation

◆ m_algebraType

AlgebraType ug::IApproximationSpace::m_algebraType
protected

suitable algebra type for the index distribution pattern

◆ m_bAdaptionIsActive

bool ug::IApproximationSpace::m_bAdaptionIsActive
protected

◆ m_bGrouped

bool ug::IApproximationSpace::m_bGrouped
protected

flag if DoFs should be grouped

Referenced by grouped().

◆ m_RevCnt

RevisionCounter ug::IApproximationSpace::m_RevCnt
protected

revision counter

Referenced by revision().

◆ m_spDoFDistributionInfo

SmartPtr<DoFDistributionInfo> ug::IApproximationSpace::m_spDoFDistributionInfo
protected

DofDistributionInfo.

Referenced by add(), clear(), and ddinfo().

◆ m_spDoFIndexStrgForLevelNoGhost

SmartPtr<DoFIndexStorage> ug::IApproximationSpace::m_spDoFIndexStrgForLevelNoGhost
protected

Index Storage for Level (ghost / noghost)

◆ m_spDoFIndexStrgForLevelWithGhost

SmartPtr<DoFIndexStorage> ug::IApproximationSpace::m_spDoFIndexStrgForLevelWithGhost
protected

Index Storage for Level (ghost / noghost)

◆ m_spGridAdaptionCallbackID

MessageHub::SPCallbackId ug::IApproximationSpace::m_spGridAdaptionCallbackID
protected

message hub id

◆ m_spGridDistributionCallbackID

MessageHub::SPCallbackId ug::IApproximationSpace::m_spGridDistributionCallbackID
protected

◆ m_spMG

SmartPtr<MultiGrid> ug::IApproximationSpace::m_spMG
protected

multigrid, where elements are stored

◆ m_spMGSH

SmartPtr<MGSubsetHandler> ug::IApproximationSpace::m_spMGSH
protected

subsethandler, where elements are stored

Referenced by ug::ApproximationSpace< TDomain >::ApproximationSpace(), num_levels(), and subset_handler().

◆ m_spSurfaceView

SmartPtr<SurfaceView> ug::IApproximationSpace::m_spSurfaceView
protected

Surface View.

Referenced by surface_view().

◆ m_vDD

std::vector<SmartPtr<DoFDistribution> > ug::IApproximationSpace::m_vDD
protected

MG Level DoF Distribution.


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