ASPECT
stokes_matrix_free_global_coarsening.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_global_coarsening_h
22 #define _aspect_simulator_solver_stokes_matrix_free_global_coarsening_h
23 
24 #include <aspect/global.h>
27 
31 
35 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
40 
41 namespace aspect
42 {
53  template <int dim, int velocity_degree>
55  {
56  public:
63  const Parameters<dim> &parameters);
64 
69 
73  void initialize() override;
74 
78  std::string name() const override;
79 
104  const LinearAlgebra::BlockVector &system_rhs,
105  const bool solve_newton_system,
106  const double last_pressure_normalization_adjustment,
107  LinearAlgebra::BlockVector &solution_vector) override;
108 
113  void setup_dofs() override;
114 
122  void assemble() override;
123 
128  void build_preconditioner() override;
129 
133  static
135 
139  void parse_parameters (ParameterHandler &prm) override;
140 
144  std::size_t get_dof_handler_memory_consumption() const override;
145 
149  std::size_t get_mg_transfer_memory_consumption() const override;
150 
154  std::size_t get_constraint_memory_consumption() const override;
155 
160  std::size_t get_cell_data_memory_consumption() const override;
161 
162  private:
169 
175 
176 
178 
180 
186 
192 
196 
201 
206 
213 
218 
221 
225 
226  unsigned int min_level;
227  unsigned int max_level;
228 
229  std::vector<std::shared_ptr<MatrixFree<dim,double>>> matrix_free_objects;
230 
231  std::vector<std::shared_ptr<const Triangulation<dim, dim>>> trias;
232 
236 
239 
242  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_A_block;
243  std::unique_ptr<GCMGTransferType<dim,GMGNumberType>> mg_transfer_Schur_complement;
244  };
245 }
246 
247 #endif
ObserverPointer< const Simulator< dim >, SimulatorAccess< dim > > simulator
StokesSolver::SolverOutputs solve(const LinearAlgebra::BlockSparseMatrix &system_matrix, const LinearAlgebra::BlockVector &system_rhs, const bool solve_newton_system, const double last_pressure_normalization_adjustment, LinearAlgebra::BlockVector &solution_vector) override
MGLevelObject< MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > > level_cell_data
MatrixFreeStokesOperators::OperatorCellData< dim, GMGNumberType > active_cell_data
void parse_parameters(ParameterHandler &prm) override
StokesMatrixFreeHandlerGlobalCoarseningImplementation(Simulator< dim > &simulator, const Parameters< dim > &parameters)
std::vector< std::shared_ptr< MatrixFree< dim, double > > > matrix_free_objects
MGLevelObject< MGTwoLevelTransfer< dim, ::LinearAlgebra::distributed::Vector< GMGNumberType > > > transfers_v
std::unique_ptr< GCMGTransferType< dim, GMGNumberType > > mg_transfer_A_block
std::vector< std::shared_ptr< const Triangulation< dim, dim > > > trias
std::unique_ptr< GCMGTransferType< dim, GMGNumberType > > mg_transfer_Schur_complement
MGLevelObject< MGTwoLevelTransfer< dim, ::LinearAlgebra::distributed::Vector< GMGNumberType > > > transfers_p
double GMGNumberType