ExaDG
Loading...
Searching...
No Matches
include
exadg
incompressible_navier_stokes
spatial_discretization
curl_compute.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_CURL_COMPUTE_H_
23
#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CURL_COMPUTE_H_
24
25
#include <deal.II/base/tensor.h>
26
#include <deal.II/base/vectorization.h>
27
28
namespace
ExaDG
29
{
30
namespace
IncNS
31
{
32
template
<
int
dim,
typename
FEEval>
33
struct
CurlCompute
34
{
35
static
typename
FEEval::value_type
36
compute(FEEval
const
& fe_eval,
unsigned
int
const
q_point)
37
{
38
return
fe_eval.get_curl(q_point);
39
}
40
};
41
42
// use partial specialization of templates to handle the 2-dimensional case
43
template
<
typename
FEEval>
44
struct
CurlCompute
<2, FEEval>
45
{
46
static
typename
FEEval::value_type
47
compute(FEEval
const
& fe_eval,
unsigned
int
const
q_point)
48
{
49
/*
50
* fe_eval = / phi \ _____\ grad(fe_eval) = / d(phi)/dx1 d(phi)/dx2 \
51
* \ 0 / / \ 0 0 /
52
*/
53
typename
FEEval::gradient_type temp = fe_eval.get_gradient(q_point);
54
/*
55
* __ / 0 \ / d(phi)/dx2 \
56
* curl = \/ X | 0 | = | - d(phi)/dx1 |
57
* \ phi / \ 0 /
58
*/
59
typename
FEEval::value_type curl;
60
curl[0] = temp[0][1];
// d(phi)/dx2
61
curl[1] = -temp[0][0];
// - d(phi)/dx1
62
return
curl;
63
}
64
};
65
66
}
// namespace IncNS
67
}
// namespace ExaDG
68
69
70
#endif
/* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_CURL_COMPUTE_H_ */
ExaDG
Definition
driver.cpp:33
ExaDG::IncNS::CurlCompute
Definition
curl_compute.h:34
Generated by
1.13.2