ExaDG
Loading...
Searching...
No Matches
operator_projection_methods.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PROJECTION_METHODS_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PROJECTION_METHODS_H_
24
25#include <exadg/incompressible_navier_stokes/spatial_discretization/spatial_operator_base.h>
26
27namespace ExaDG
28{
29namespace IncNS
30{
31/*
32 * Base class for projection-type incompressible Navier-Stokes solvers such as the high-order dual
33 * splitting (velocity-correction) scheme or pressure correction schemes.
34 */
35template<int dim, typename Number>
37{
38protected:
40
41 typedef typename Base::VectorType VectorType;
43
44public:
45 /*
46 * Constructor.
47 */
49 std::shared_ptr<Grid<dim> const> grid,
50 std::shared_ptr<dealii::Mapping<dim> const> mapping,
51 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
52 std::shared_ptr<BoundaryDescriptor<dim> const> boundary_descriptor,
53 std::shared_ptr<FieldFunctions<dim> const> field_functions,
54 Parameters const & parameters,
55 std::string const & field,
56 MPI_Comm const & mpi_comm);
57
58 /*
59 * Destructor.
60 */
62
63protected:
64 /*
65 * Calls setup() function of base class and additionally initializes the pressure Poisson operator
66 * needed for projection-type methods.
67 */
68 void
69 setup_derived() override;
70
71 void
72 setup_preconditioners_and_solvers() override;
73
74public:
75 void
76 update_after_grid_motion(bool const update_matrix_free) override;
77
78 /*
79 * This function evaluates the rhs-contribution of the viscous term and adds the result to the
80 * dst-vector.
81 */
82 void
83 do_rhs_add_viscous_term(VectorType & dst, double const time) const;
84
85 /*
86 * Pressure Poisson equation: This function evaluates the inhomogeneous parts of boundary face
87 * integrals of the negative Laplace operator and adds the result to the dst-vector.
88 */
89 void
90 do_rhs_ppe_laplace_add(VectorType & dst, double const & time) const;
91
92 /*
93 * This function solves the pressure Poisson equation and returns the number of iterations.
94 */
95 unsigned int
96 do_solve_pressure(VectorType & dst,
97 VectorType const & src,
98 bool const update_preconditioner) const;
99
100 /*
101 * This function applies the projection operator (used for throughput measurements).
102 */
103 void
104 apply_projection_operator(VectorType & dst, VectorType const & src) const;
105
106 /*
107 * This function applies the Laplace operator (used for throughput measurements).
108 */
109 void
110 apply_laplace_operator(VectorType & dst, VectorType const & src) const;
111
112protected:
113 // Pressure Poisson equation (operator, preconditioner, solver).
115
116 std::shared_ptr<PreconditionerBase<Number>> preconditioner_pressure_poisson;
117
118 std::shared_ptr<Krylov::SolverBase<VectorType>> pressure_poisson_solver;
119
120private:
121 void
122 initialize_laplace_operator();
123
124 /*
125 * Setup functions called during setup of pressure Poisson solver.
126 */
127 void
128 setup_preconditioner_pressure_poisson();
129
130 void
131 setup_solver_pressure_poisson();
132};
133
134} // namespace IncNS
135} // namespace ExaDG
136
137
138#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PROJECTION_METHODS_H_ \
139 */
Definition grid.h:40
Definition operator_projection_methods.h:37
void setup_derived() override
Definition operator_projection_methods.cpp:59
Definition parameters.h:46
Definition spatial_operator_base.h:68
Definition grid.h:84
Definition laplace_operator.h:229
Definition multigrid_preconditioner.h:38
Definition driver.cpp:33
Definition boundary_descriptor.h:240
Definition field_functions.h:31