33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__ASS_TUNER_IMPL__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__ASS_TUNER_IMPL__
40 template <
typename TAlgebra>
44 if (single_index_assembling_enabled()){ vec.resize(1);}
46 const size_t numIndex = dd->num_indices();
54 template <
typename TAlgebra>
58 if (single_index_assembling_enabled())
60 if (m_bClearOnResize) mat.resize_and_clear(1, 1);
61 else mat.resize_and_keep_values(1,1);
65 const size_t numIndex = dd->num_indices();
68 if (m_bMatrixStructureIsConst)
70 UG_COND_THROW(mat.num_rows() != dd->num_indices() || mat.num_cols() != dd->num_indices(),
71 "The assembling tuner is set to use a constant matrix structure, "
72 "but the number of indices in the new matrix is different from that in the old one.");
73 mat.clear_retain_structure();
76 mat.resize_and_clear(numIndex, numIndex);
79 mat.resize_and_keep_values(numIndex, numIndex);
83 template <
typename TAlgebra>
84 template <
typename TElem>
88 if(!m_pBoolMarker->is_marked(elem))
return false;
94 template <
typename TAlgebra>
95 template <
typename TElem>
100 UG_THROW(
"Selector-iterator not set!")
106 iter != sel->
end<TElem>(); ++iter)
109 vElem.push_back(*iter);
113 template <
typename TAlgebra>
118 if(single_index_assembling_enabled())
120 if (mat.num_rows() != 1 || mat.num_cols() != 1)
121 UG_THROW(
"#rows and #cols need to be 1 for setting dirichlet rows"
122 " in an index-wise manner.")
124 const size_t index = ind[0];
125 if (index == m_SingleAssIndex)
133 template <
typename TAlgebra>
138 if(single_index_assembling_enabled())
141 UG_THROW(
"vector-size needs to be 1 for setting dirichlet values"
142 " in an index-wise manner.");
144 const size_t index = ind[0];
145 if(index == m_SingleAssIndex)
Definition: smart_pointer.h:296
void set_dirichlet_val(vector_type &vec, const DoFIndex &ind, const double val) const
Definition: ass_tuner_impl.h:134
void resize(ConstSmartPtr< DoFDistribution > dd, vector_type &vec) const
resize functions used in assemble funcs
Definition: ass_tuner_impl.h:41
algebra_type::vector_type vector_type
Type of algebra vector.
Definition: ass_tuner.h:99
algebra_type::matrix_type matrix_type
Type of algebra matrix.
Definition: ass_tuner.h:96
bool element_used(TElem *elem) const
returns if element is to be used in assembling
Definition: ass_tuner_impl.h:85
void set_dirichlet_row(matrix_type &mat, const DoFIndex &ind) const
Definition: ass_tuner_impl.h:114
void collect_selected_elements(std::vector< TElem * > &vElem, ConstSmartPtr< DoFDistribution > dd, int si) const
gets the element iterator from the Selector
Definition: ass_tuner_impl.h:96
Definition: subset_handler_interface.h:223
int get_subset_index(GridObject *elem) const
Definition: subset_handler_interface.cpp:560
Definition: multi_index.h:50
specialization of ISelector for a grid of class Grid.
Definition: selector_grid.h:96
geometry_traits< TElem >::iterator end()
Definition: selector_grid_impl.hpp:134
geometry_traits< TElem >::iterator begin()
Definition: selector_grid_impl.hpp:106
void SetDirichletRow(TSparseMatrix &A, size_t i, size_t alpha)
Definition: sparsematrix_util.h:796
#define UG_THROW(msg)
Definition: error.h:57
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
double & BlockRef(T &vec, size_t i)
Definition: blocks.h:66
geometry_traits< TElem >::iterator iterator
Definition: selector_grid.h:104