ASPECT
stokes_matrix_free.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2025 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _aspect_simulator_solver_stokes_matrix_free_h
22 #define _aspect_simulator_solver_stokes_matrix_free_h
23 
24 #include <aspect/global.h>
25 #include <aspect/parameters.h>
27 
28 #include <deal.II/multigrid/mg_transfer_matrix_free.h>
29 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
30 
34 using GMGNumberType = double;
35 
36 namespace aspect
37 {
42  template <int dim>
43  class StokesMatrixFreeHandler: public StokesSolver::Interface<dim>
44  {
45  public:
50  virtual void setup_dofs()=0;
51 
59  virtual void assemble()=0;
60 
66  virtual void build_preconditioner()=0;
67 
71  static
72  void declare_parameters (ParameterHandler &prm);
73 
78  virtual const DoFHandler<dim> &
79  get_dof_handler_v () const = 0;
80 
85  virtual const DoFHandler<dim> &
86  get_dof_handler_p () const = 0;
87 
92  virtual const DoFHandler<dim> &
93  get_dof_handler_projection () const = 0;
94 
99  virtual const AffineConstraints<double> &
100  get_constraints_v () const = 0;
101 
106  virtual const AffineConstraints<double> &
107  get_constraints_p () const = 0;
108 
113  virtual const MGTransferMF<dim,GMGNumberType> &
114  get_mg_transfer_A () const = 0;
115 
120  virtual const MGTransferMF<dim,GMGNumberType> &
121  get_mg_transfer_S () const = 0;
122 
127  virtual std::size_t get_cell_data_memory_consumption() const = 0;
128  };
129 
133  template <int dim>
134  std::unique_ptr<StokesMatrixFreeHandler<dim>> create_matrix_free_solver(Simulator<dim> &simulator, const Parameters<dim> &parameters);
135 
136 }
137 
138 #endif
virtual const DoFHandler< dim > & get_dof_handler_v() const =0
const Simulator< dim > * simulator
virtual const AffineConstraints< double > & get_constraints_v() const =0
virtual const DoFHandler< dim > & get_dof_handler_p() const =0
virtual const MGTransferMF< dim, GMGNumberType > & get_mg_transfer_A() const =0
virtual const DoFHandler< dim > & get_dof_handler_projection() const =0
virtual const MGTransferMF< dim, GMGNumberType > & get_mg_transfer_S() const =0
virtual std::size_t get_cell_data_memory_consumption() const =0
std::unique_ptr< StokesMatrixFreeHandler< dim > > create_matrix_free_solver(Simulator< dim > &simulator, const Parameters< dim > &parameters)
virtual const AffineConstraints< double > & get_constraints_p() const =0
virtual void build_preconditioner()=0
static void declare_parameters(ParameterHandler &prm)
double GMGNumberType