16 #ifndef dealii_mg_sparse_matrix_collection_h 17 #define dealii_mg_sparse_matrix_collection_h 19 #include <deal.II/base/mg_level_object.h> 21 #include <deal.II/lac/dynamic_sparsity_pattern.h> 22 #include <deal.II/lac/sparse_matrix.h> 23 #include <deal.II/lac/vector.h> 25 #include <deal.II/multigrid/mg_base.h> 26 #include <deal.II/multigrid/mg_tools.h> 30 DEAL_II_NAMESPACE_OPEN
41 template <
typename number>
46 resize(
const unsigned int minlevel,
const unsigned int maxlevel);
48 template <
typename DoFHandlerType>
50 reinit(
const DoFHandlerType &dof_handler);
66 template <
typename number>
69 const unsigned int maxlevel)
71 matrix.resize(minlevel, maxlevel);
72 matrix.clear_elements();
73 matrix_up.resize(minlevel + 1, maxlevel);
74 matrix_up.clear_elements();
75 matrix_down.resize(minlevel + 1, maxlevel);
76 matrix_down.clear_elements();
77 matrix_in.resize(minlevel, maxlevel);
78 matrix_in.clear_elements();
79 matrix_out.resize(minlevel, maxlevel);
80 matrix_out.clear_elements();
81 sparsity.resize(minlevel, maxlevel);
82 sparsity_edge.resize(minlevel, maxlevel);
86 template <
typename number>
87 template <
typename DoFHandlerType>
89 SparseMatrixCollection<number>::reinit(
const DoFHandlerType &dof_handler)
92 dof_handler.get_triangulation().n_levels());
94 for (
unsigned int level = sparsity.min_level();
95 level <= sparsity.max_level();
100 sparsity[level].copy_from(dsp);
101 matrix[level].reinit(sparsity[level]);
102 matrix_in[level].reinit(sparsity[level]);
103 matrix_out[level].reinit(sparsity[level]);
107 ci_sparsity.
reinit(dof_handler.n_dofs(level - 1),
108 dof_handler.n_dofs(level));
112 sparsity_edge[level].copy_from(ci_sparsity);
113 matrix_up[level].reinit(sparsity_edge[level]);
114 matrix_down[level].reinit(sparsity_edge[level]);
119 template <
typename number>
121 SparseMatrixCollection<number>::set_zero()
132 DEAL_II_NAMESPACE_CLOSE
Contents is actually a matrix.
#define AssertIndexRange(index, range)
void reinit(const size_type m, const size_type n, const IndexSet &rowset=IndexSet())