Reference documentation for deal.II version 8.4.2
mg_transfer_matrix_free.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2016 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__mg_transfer_matrix_free_h
17 #define dealii__mg_transfer_matrix_free_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/lac/parallel_vector.h>
22 #include <deal.II/multigrid/mg_base.h>
23 #include <deal.II/multigrid/mg_constrained_dofs.h>
24 #include <deal.II/base/mg_level_object.h>
25 #include <deal.II/multigrid/mg_transfer.h>
26 #include <deal.II/matrix_free/shape_info.h>
27 
28 #include <deal.II/dofs/dof_handler.h>
29 
30 
31 DEAL_II_NAMESPACE_OPEN
32 
33 
36 
52 template <int dim, typename Number>
53 class MGTransferMatrixFree : public MGLevelGlobalTransfer<parallel::distributed::Vector<Number> >
54 {
55 public:
61 
67 
71  virtual ~MGTransferMatrixFree ();
72 
76  void initialize_constraints (const MGConstrainedDoFs &mg_constrained_dofs);
77 
81  void clear ();
82 
86  void build (const DoFHandler<dim,dim> &mg_dof);
87 
99  virtual void prolongate (const unsigned int to_level,
101  const parallel::distributed::Vector<Number> &src) const;
102 
118  virtual void restrict_and_add (const unsigned int from_level,
120  const parallel::distributed::Vector<Number> &src) const;
121 
125  DeclException0(ExcNoProlongation);
126 
130  std::size_t memory_consumption () const;
131 
132 private:
133 
139  unsigned int fe_degree;
140 
146 
151  unsigned int n_components;
152 
158  unsigned int n_child_cell_dofs;
159 
170  std::vector<std::vector<unsigned int> > level_dof_indices;
171 
175  std::vector<std::vector<std::pair<unsigned int,unsigned int> > > parent_child_connect;
176 
181  std::vector<unsigned int> n_owned_level_cells;
182 
188 
193 
205  std::vector<AlignedVector<VectorizedArray<Number> > > weights_on_refined;
206 
212  std::vector<std::vector<std::vector<unsigned short> > > dirichlet_indices;
213 
217  template <int degree>
218  void do_prolongate_add(const unsigned int to_level,
220  const parallel::distributed::Vector<Number> &src) const;
221 
225  template <int degree>
226  void do_restrict_add(const unsigned int from_level,
228  const parallel::distributed::Vector<Number> &src) const;
229 };
230 
231 
235 DEAL_II_NAMESPACE_CLOSE
236 
237 #endif
DeclException0(ExcNoProlongation)
std::vector< unsigned int > n_owned_level_cells
AlignedVector< VectorizedArray< Number > > evaluation_data
std::size_t memory_consumption() const
std::vector< std::vector< std::vector< unsigned short > > > dirichlet_indices
SmartPointer< const MGConstrainedDoFs, MGLevelGlobalTransfer< parallel::distributed::Vector< Number > > > mg_constrained_dofs
Definition: mg_transfer.h:401
virtual void restrict_and_add(const unsigned int from_level, parallel::distributed::Vector< Number > &dst, const parallel::distributed::Vector< Number > &src) const
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > parent_child_connect
std::vector< AlignedVector< VectorizedArray< Number > > > weights_on_refined
std::vector< std::vector< unsigned int > > level_dof_indices
virtual void prolongate(const unsigned int to_level, parallel::distributed::Vector< Number > &dst, const parallel::distributed::Vector< Number > &src) const
void do_prolongate_add(const unsigned int to_level, parallel::distributed::Vector< Number > &dst, const parallel::distributed::Vector< Number > &src) const
internal::MatrixFreeFunctions::ShapeInfo< Number > shape_info
void do_restrict_add(const unsigned int from_level, parallel::distributed::Vector< Number > &dst, const parallel::distributed::Vector< Number > &src) const
void initialize_constraints(const MGConstrainedDoFs &mg_constrained_dofs)
void build(const DoFHandler< dim, dim > &mg_dof)