ExaDG
Loading...
Searching...
No Matches
streamfunction_calculator_rhs_operator.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_CALCULATORS_STREAMFUNCTION_CALCULATOR_RHS_OPERATOR_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CALCULATORS_STREAMFUNCTION_CALCULATOR_RHS_OPERATOR_H_
24
25// deal.II
26#include <deal.II/lac/la_parallel_vector.h>
27
28// ExaDG
29#include <exadg/matrix_free/integrators.h>
30
31namespace ExaDG
32{
33namespace IncNS
34{
35/*
36 * This function calculates the right-hand side of the Laplace equation that is solved in order to
37 * obtain the streamfunction psi
38 *
39 * - laplace(psi) = omega (where omega is the vorticity).
40 *
41 * Note that this function can only be used for the two-dimensional case (dim==2).
42 */
43template<int dim, typename Number>
45{
46private:
47 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
48
49 typedef std::pair<unsigned int, unsigned int> Range;
50
52
53 typedef CellIntegrator<dim, dim, Number> IntegratorVector;
54 typedef CellIntegrator<dim, 1, Number> IntegratorScalar;
55
56public:
58
59 void
60 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
61 unsigned int const dof_index_u_in,
62 unsigned int const dof_index_u_scalar_in,
63 unsigned int const quad_index_in);
64
65 void
66 apply(VectorType & dst, VectorType const & src) const;
67
68private:
69 void
70 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
71 VectorType & dst,
72 VectorType const & src,
73 Range const & cell_range) const;
74
75 dealii::MatrixFree<dim, Number> const * matrix_free;
76
77 unsigned int dof_index_u;
78 unsigned int dof_index_u_scalar;
79 unsigned int quad_index;
80};
81
82} // namespace IncNS
83} // namespace ExaDG
84
85#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CALCULATORS_STREAMFUNCTION_CALCULATOR_RHS_OPERATOR_H_ \
86 */
Definition streamfunction_calculator_rhs_operator.h:45
Definition driver.cpp:33