ExaDG
Loading...
Searching...
No Matches
navier_stokes_calculators.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_OPERATORS_NAVIER_STOKES_CALCULATORS_H_
23#define INCLUDE_EXADG_OPERATORS_NAVIER_STOKES_CALCULATORS_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{
33template<int dim, typename Number>
35{
36public:
37 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
38
40
41 typedef CellIntegrator<dim, dim, Number> CellIntegratorVector;
42 typedef CellIntegrator<dim, 1, Number> CellIntegratorScalar;
43
44 typedef dealii::VectorizedArray<Number> scalar;
45
47
48 void
49 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
50 unsigned int const dof_index_vector_in,
51 unsigned int const dof_index_scalar_in,
52 unsigned int const quad_index_in);
53 void
54 compute_divergence(VectorType & dst, VectorType const & src) const;
55
56private:
57 void
58 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
59 VectorType & dst,
60 VectorType const & src,
61 std::pair<unsigned int, unsigned int> const & cell_range) const;
62
63 dealii::MatrixFree<dim, Number> const * matrix_free;
64
65 unsigned int dof_index_vector;
66 unsigned int dof_index_scalar;
67 unsigned int quad_index;
68};
69
70template<int dim, typename Number>
72{
73private:
75
76 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
77
78 typedef dealii::VectorizedArray<Number> scalar;
79 typedef dealii::SymmetricTensor<2, dim, dealii::VectorizedArray<Number>> symmetrictensor;
80
81 typedef std::pair<unsigned int, unsigned int> Range;
82
83 typedef CellIntegrator<dim, dim, Number> CellIntegratorVector;
84 typedef CellIntegrator<dim, 1, Number> CellIntegratorScalar;
85
86public:
88
89 void
90 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
91 unsigned int const dof_index_u_in,
92 unsigned int const dof_index_u_scalar_in,
93 unsigned int const quad_index_in);
94
95 void
96 compute_shear_rate(VectorType & dst, VectorType const & src) const;
97
98private:
99 void
100 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
101 VectorType & dst,
102 VectorType const & src,
103 Range const & cell_range) const;
104
105 dealii::MatrixFree<dim, Number> const * matrix_free;
106
107 unsigned int dof_index_u;
108 unsigned int dof_index_u_scalar;
109 unsigned int quad_index;
110};
111
112template<int dim, typename Number>
114{
115public:
116 static unsigned int const number_vorticity_components = (dim == 2) ? 1 : dim;
117
118 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
119
121
122 typedef CellIntegrator<dim, dim, Number> CellIntegratorVector;
123
124 typedef dealii::Tensor<1, dim, dealii::VectorizedArray<Number>> vector;
125
127
128 void
129 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
130 unsigned int const dof_index_in,
131 unsigned int const quad_index_in);
132
133 void
134 compute_vorticity(VectorType & dst, VectorType const & src) const;
135
136private:
137 void
138 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
139 VectorType & dst,
140 VectorType const & src,
141 std::pair<unsigned int, unsigned int> const & cell_range) const;
142
143 dealii::MatrixFree<dim, Number> const * matrix_free;
144 unsigned int dof_index;
145 unsigned int quad_index;
146};
147
148template<int dim, typename Number>
150{
151private:
153
154 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
155
156 typedef dealii::VectorizedArray<Number> scalar;
157
158 typedef std::pair<unsigned int, unsigned int> Range;
159
160 typedef CellIntegrator<dim, dim, Number> IntegratorVector;
161 typedef CellIntegrator<dim, 1, Number> IntegratorScalar;
162
163public:
165
166 void
167 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
168 unsigned int const dof_index_u_in,
169 unsigned int const dof_index_u_scalar_in,
170 unsigned int const quad_index_in);
171
172 void
173 compute(VectorType & dst, VectorType const & src) const;
174
175private:
176 void
177 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
178 VectorType & dst,
179 VectorType const & src,
180 Range const & cell_range) const;
181
182 dealii::MatrixFree<dim, Number> const * matrix_free;
183
184 unsigned int dof_index_u;
185 unsigned int dof_index_u_scalar;
186 unsigned int quad_index;
187};
188
189template<int dim, typename Number>
191{
192private:
194
195 typedef dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
196
197 typedef dealii::VectorizedArray<Number> scalar;
198 typedef dealii::Tensor<2, dim, dealii::VectorizedArray<Number>> tensor;
199
200 typedef std::pair<unsigned int, unsigned int> Range;
201
202 typedef CellIntegrator<dim, dim, Number> CellIntegratorVector;
203 typedef CellIntegrator<dim, 1, Number> CellIntegratorScalar;
204
205public:
207
208 void
209 initialize(dealii::MatrixFree<dim, Number> const & matrix_free_in,
210 unsigned int const dof_index_u_in,
211 unsigned int const dof_index_u_scalar_in,
212 unsigned int const quad_index_in,
213 bool const compressible_flow);
214
215 void
216 compute(VectorType & dst, VectorType const & src) const;
217
218private:
219 void
220 cell_loop(dealii::MatrixFree<dim, Number> const & matrix_free,
221 VectorType & dst,
222 VectorType const & src,
223 Range const & cell_range) const;
224
225 dealii::MatrixFree<dim, Number> const * matrix_free;
226
227 unsigned int dof_index_u;
228 unsigned int dof_index_u_scalar;
229 unsigned int quad_index;
230 bool compressible_flow;
231};
232
233} // namespace ExaDG
234
235#endif /* INCLUDE_EXADG_OPERATORS_NAVIER_STOKES_CALCULATORS_H_ \
236 */
Definition navier_stokes_calculators.h:35
Definition navier_stokes_calculators.h:150
Definition navier_stokes_calculators.h:191
Definition navier_stokes_calculators.h:72
Definition navier_stokes_calculators.h:114
Definition driver.cpp:33