ug4
ug::AssemblingTuner< TAlgebra > Class Template Reference

The AssemblingTuner class combines tools to adapt the assembling routine. More...

#include <ass_tuner.h>

+ Inheritance diagram for ug::AssemblingTuner< TAlgebra >:

Public Types

typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix. More...
 
typedef vector_type::value_type value_type
 Type of algebra value. More...
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector. More...
 

Public Member Functions

void add_local_mat_to_global (matrix_type &mat, const LocalMatrix &lmat, ConstSmartPtr< DoFDistribution > dd) const
 
void add_local_vec_to_global (vector_type &vec, const LocalVector &lvec, ConstSmartPtr< DoFDistribution > dd) const
 LocalToGlobalMapper-function calls. More...
 
 AssemblingTuner ()
 constructor More...
 
template<typename TElem >
void collect_selected_elements (std::vector< TElem * > &vElem, ConstSmartPtr< DoFDistribution > dd, int si) const
 gets the element iterator from the Selector More...
 
bool constraint_type_enabled (int type) const
 returns if constraint type enabled More...
 
void disable_clear_on_resize ()
 
void disable_single_index_assembling ()
 sets an index for which the assembling should be carried out More...
 
bool elem_disc_type_enabled (int type) const
 returns if elem disc type enabled More...
 
template<typename TElem >
bool element_used (TElem *elem) const
 returns if element is to be used in assembling More...
 
void enable_constraints (int bEnableTypes)
 enables constraints More...
 
void enable_elem_discs (int bEnableTypes)
 enables elem discs More...
 
void enable_modify_solution (bool bEnable)
 enables the usage of modify solution More...
 
int enabled_constraints () const
 returns flags of enabled constraints More...
 
int enabled_elem_discs () const
 returns flags of enabled elem discs More...
 
bool matrix_is_const () const
 
void modify_LocalSol (LocalVector &vecMod, const LocalVector &lvec, ConstSmartPtr< DoFDistribution > dd) const
 
bool modify_solution_enabled () const
 checks whether the assemble index is set or not More...
 
bool regular_grid_forced () const
 returns if assembling is to considered as regular grid More...
 
void resize (ConstSmartPtr< DoFDistribution > dd, matrix_type &mat) const
 
void resize (ConstSmartPtr< DoFDistribution > dd, vector_type &vec) const
 resize functions used in assemble funcs More...
 
bool selected_elements_used () const
 returns if only selected elements used for assembling More...
 
void set_dirichlet_row (matrix_type &mat, const DoFIndex &ind) const
 
void set_dirichlet_val (vector_type &vec, const DoFIndex &ind, const double val) const
 
virtual void set_force_regular_grid (bool bForce)
 forces the assembling to consider the grid as regular More...
 
void set_mapping (ILocalToGlobalMapper< TAlgebra > *pMapper=NULL)
 set local to global mapping More...
 
void set_marker (BoolMarker *mark=NULL)
 sets a marker to exclude elements from assembling More...
 
void set_matrix_is_const (bool bCh)
 
void set_matrix_structure_is_const (bool b)
 
void set_selector (Selector *sel=NULL)
 sets a selector of elements for assembling More...
 
void set_single_index_assembling (const size_t index)
 
bool single_index_assembling_enabled () const
 checks whether the assemble DoFindex is set or not More...
 
virtual ~AssemblingTuner ()
 destructor More...
 

Protected Attributes

bool m_bClearOnResize
 disables clearing of vector/matrix on resize More...
 
bool m_bForceRegGrid
 forces the assembling to regard the grid as regular More...
 
bool m_bMatrixIsConst
 disables matrix assembling if set to false More...
 
bool m_bMatrixStructureIsConst
 keeps matrix structure from last call if set to true More...
 
bool m_bModifySolutionImplemented
 
bool m_bSingleAssIndex
 object for DoFindex-wise assemble routine More...
 
int m_ConstraintTypesEnabled
 enables the constraints More...
 
LocalToGlobalMapper< TAlgebra > m_defaultMapper
 default LocalToGlobalMapper More...
 
int m_ElemTypesEnabled
 enables the constraints More...
 
BoolMarkerm_pBoolMarker
 marker used to skip elements More...
 
ILocalToGlobalMapper< TAlgebra > * m_pMapper
 LocalToGlobalMapper. More...
 
Selectorm_pSelector
 selector used to set a list of elements for the assembling More...
 
size_t m_SingleAssIndex
 

Detailed Description

template<typename TAlgebra>
class ug::AssemblingTuner< TAlgebra >

The AssemblingTuner class combines tools to adapt the assembling routine.

Member Typedef Documentation

◆ algebra_type

template<typename TAlgebra >
typedef TAlgebra ug::AssemblingTuner< TAlgebra >::algebra_type

Algebra type.

◆ matrix_type

template<typename TAlgebra >
typedef algebra_type::matrix_type ug::AssemblingTuner< TAlgebra >::matrix_type

Type of algebra matrix.

◆ value_type

template<typename TAlgebra >
typedef vector_type::value_type ug::AssemblingTuner< TAlgebra >::value_type

Type of algebra value.

◆ vector_type

template<typename TAlgebra >
typedef algebra_type::vector_type ug::AssemblingTuner< TAlgebra >::vector_type

Type of algebra vector.

Constructor & Destructor Documentation

◆ AssemblingTuner()

template<typename TAlgebra >
ug::AssemblingTuner< TAlgebra >::AssemblingTuner ( )
inline

constructor

◆ ~AssemblingTuner()

template<typename TAlgebra >
virtual ug::AssemblingTuner< TAlgebra >::~AssemblingTuner ( )
inlinevirtual

destructor

Member Function Documentation

◆ add_local_mat_to_global()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::add_local_mat_to_global ( matrix_type mat,
const LocalMatrix lmat,
ConstSmartPtr< DoFDistribution dd 
) const
inline

◆ add_local_vec_to_global()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::add_local_vec_to_global ( vector_type vec,
const LocalVector lvec,
ConstSmartPtr< DoFDistribution dd 
) const
inline

◆ collect_selected_elements()

template<typename TAlgebra >
template<typename TElem >
void ug::AssemblingTuner< TAlgebra >::collect_selected_elements ( std::vector< TElem * > &  vElem,
ConstSmartPtr< DoFDistribution dd,
int  si 
) const

◆ constraint_type_enabled()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::constraint_type_enabled ( int  type) const
inline

returns if constraint type enabled

References ug::AssemblingTuner< TAlgebra >::m_ConstraintTypesEnabled.

◆ disable_clear_on_resize()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::disable_clear_on_resize ( )
inline

Disable clearing of matrix/vector when resizing. This is useful when an IAssemble object consists of more than one domain disc, e.g., CompositeTimeDisc.

References ug::AssemblingTuner< TAlgebra >::m_bClearOnResize.

◆ disable_single_index_assembling()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::disable_single_index_assembling ( )
inline

sets an index for which the assembling should be carried out

This methods sets a boolean if an DoFindex-wise assemble routine should be used. This proceeding is e.g. useful for a nonlinear Gauss-Seidel or nonlinear Jacobi solver. The specific index is passed.

Parameters
[in]indDoFIndex

References ug::AssemblingTuner< TAlgebra >::m_bSingleAssIndex.

◆ elem_disc_type_enabled()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::elem_disc_type_enabled ( int  type) const
inline

returns if elem disc type enabled

References ug::AssemblingTuner< TAlgebra >::m_ElemTypesEnabled.

◆ element_used()

template<typename TAlgebra >
template<typename TElem >
bool ug::AssemblingTuner< TAlgebra >::element_used ( TElem *  elem) const

returns if element is to be used in assembling

◆ enable_constraints()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::enable_constraints ( int  bEnableTypes)
inline

◆ enable_elem_discs()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::enable_elem_discs ( int  bEnableTypes)
inline

◆ enable_modify_solution()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::enable_modify_solution ( bool  bEnable)
inline

enables the usage of modify solution

References ug::AssemblingTuner< TAlgebra >::m_bModifySolutionImplemented.

◆ enabled_constraints()

template<typename TAlgebra >
int ug::AssemblingTuner< TAlgebra >::enabled_constraints ( ) const
inline

returns flags of enabled constraints

References ug::AssemblingTuner< TAlgebra >::m_ConstraintTypesEnabled.

◆ enabled_elem_discs()

template<typename TAlgebra >
int ug::AssemblingTuner< TAlgebra >::enabled_elem_discs ( ) const
inline

returns flags of enabled elem discs

References ug::AssemblingTuner< TAlgebra >::m_ElemTypesEnabled.

◆ matrix_is_const()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::matrix_is_const ( ) const
inline

whether matrix is to be modified by assembling

Returns
true iff matrix is not to be modified

References ug::AssemblingTuner< TAlgebra >::m_bMatrixIsConst.

◆ modify_LocalSol()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::modify_LocalSol ( LocalVector vecMod,
const LocalVector lvec,
ConstSmartPtr< DoFDistribution dd 
) const
inline

◆ modify_solution_enabled()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::modify_solution_enabled ( ) const
inline

checks whether the assemble index is set or not

References ug::AssemblingTuner< TAlgebra >::m_bModifySolutionImplemented.

◆ regular_grid_forced()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::regular_grid_forced ( ) const
inline

returns if assembling is to considered as regular grid

References ug::AssemblingTuner< TAlgebra >::m_bForceRegGrid.

◆ resize() [1/2]

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::resize ( ConstSmartPtr< DoFDistribution dd,
matrix_type mat 
) const

References UG_COND_THROW.

◆ resize() [2/2]

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::resize ( ConstSmartPtr< DoFDistribution dd,
vector_type vec 
) const

resize functions used in assemble funcs

◆ selected_elements_used()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::selected_elements_used ( ) const
inline

returns if only selected elements used for assembling

References ug::AssemblingTuner< TAlgebra >::m_pSelector.

◆ set_dirichlet_row()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_dirichlet_row ( matrix_type mat,
const DoFIndex ind 
) const

only one index will be set to Dirichlet in case of index-wise assembling instead of setting a complete matrix row to Dirichlet

References ug::SetDirichletRow(), and UG_THROW.

◆ set_dirichlet_val()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_dirichlet_val ( vector_type vec,
const DoFIndex ind,
const double  val 
) const

◆ set_force_regular_grid()

template<typename TAlgebra >
virtual void ug::AssemblingTuner< TAlgebra >::set_force_regular_grid ( bool  bForce)
inlinevirtual

forces the assembling to consider the grid as regular

Reimplemented in ug::CompositeTimeDiscretization< TAlgebra >::CompositeAssTuner.

References ug::AssemblingTuner< TAlgebra >::m_bForceRegGrid.

◆ set_mapping()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_mapping ( ILocalToGlobalMapper< TAlgebra > *  pMapper = NULL)
inline

set local to global mapping

References ug::AssemblingTuner< TAlgebra >::m_pMapper.

◆ set_marker()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_marker ( BoolMarker mark = NULL)
inline

sets a marker to exclude elements from assembling

This methods sets a marker. Only elements that are marked will be assembled during assembling process. If no marker is set, this corresponds to a marker where all elements have been marked.

Parameters
[in]markBoolMarker

References ug::AssemblingTuner< TAlgebra >::m_pBoolMarker.

◆ set_matrix_is_const()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_matrix_is_const ( bool  bCh)
inline

specify whether matrix will be modified by assembling disables matrix assembling if set to true

Parameters
bChset true if matrix is not to be changed during assembling

References ug::AssemblingTuner< TAlgebra >::m_bMatrixIsConst.

◆ set_matrix_structure_is_const()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_matrix_structure_is_const ( bool  b)
inline

◆ set_selector()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_selector ( Selector sel = NULL)
inline

sets a selector of elements for assembling

This methods sets an element list. Only elements of this list will be assembled during assembling process. The list especially defines the begin and end of the element-iterator in the element assembling-loop. If no element list is set, this corresponds to an assembling where the loop is carried out over all elements of a subset.

Parameters
[in]selSelector

References ug::AssemblingTuner< TAlgebra >::m_pSelector.

◆ set_single_index_assembling()

template<typename TAlgebra >
void ug::AssemblingTuner< TAlgebra >::set_single_index_assembling ( const size_t  index)
inline

◆ single_index_assembling_enabled()

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::single_index_assembling_enabled ( ) const
inline

checks whether the assemble DoFindex is set or not

References ug::AssemblingTuner< TAlgebra >::m_bSingleAssIndex.

Member Data Documentation

◆ m_bClearOnResize

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bClearOnResize
protected

disables clearing of vector/matrix on resize

Referenced by ug::AssemblingTuner< TAlgebra >::disable_clear_on_resize().

◆ m_bForceRegGrid

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bForceRegGrid
protected

forces the assembling to regard the grid as regular

Referenced by ug::AssemblingTuner< TAlgebra >::regular_grid_forced(), and ug::AssemblingTuner< TAlgebra >::set_force_regular_grid().

◆ m_bMatrixIsConst

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bMatrixIsConst
protected

◆ m_bMatrixStructureIsConst

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bMatrixStructureIsConst
protected

keeps matrix structure from last call if set to true

Referenced by ug::AssemblingTuner< TAlgebra >::set_matrix_structure_is_const().

◆ m_bModifySolutionImplemented

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bModifySolutionImplemented
protected

calls the 'modify_solution()' method of constraints; gives the modified solution to the assembling methods

Referenced by ug::AssemblingTuner< TAlgebra >::enable_modify_solution(), and ug::AssemblingTuner< TAlgebra >::modify_solution_enabled().

◆ m_bSingleAssIndex

template<typename TAlgebra >
bool ug::AssemblingTuner< TAlgebra >::m_bSingleAssIndex
protected

◆ m_ConstraintTypesEnabled

template<typename TAlgebra >
int ug::AssemblingTuner< TAlgebra >::m_ConstraintTypesEnabled
protected

◆ m_defaultMapper

◆ m_ElemTypesEnabled

template<typename TAlgebra >
int ug::AssemblingTuner< TAlgebra >::m_ElemTypesEnabled
protected

◆ m_pBoolMarker

template<typename TAlgebra >
BoolMarker* ug::AssemblingTuner< TAlgebra >::m_pBoolMarker
protected

marker used to skip elements

Referenced by ug::AssemblingTuner< TAlgebra >::set_marker().

◆ m_pMapper

◆ m_pSelector

template<typename TAlgebra >
Selector* ug::AssemblingTuner< TAlgebra >::m_pSelector
protected

selector used to set a list of elements for the assembling

Referenced by ug::AssemblingTuner< TAlgebra >::selected_elements_used(), and ug::AssemblingTuner< TAlgebra >::set_selector().

◆ m_SingleAssIndex

template<typename TAlgebra >
size_t ug::AssemblingTuner< TAlgebra >::m_SingleAssIndex
protected

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