Alsvinn  0.5.3
The fast FVM simulator with UQ support
ExtraVariables.hpp
Go to the documentation of this file.
1 /* Copyright (c) 2018 ETH Zurich, Kjetil Olsen Lye
2  * This program is free software: you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #pragma once
17 #include "alsfvm/types.hpp"
18 
19 
20 namespace alsfvm {
21 namespace equation {
22 namespace euler {
23 
28 template<int nsd>
30 public:
31 
32  typedef typename Types<nsd>::rvec rvec;
33 
34 
36  : p(p), u(u) {
37 
38  }
39 
40  template<class T>
42  : p(p), u(rvec3{ux, uy, uz}) {
43  static_assert(nsd == 3 || sizeof(T) == 0, "Only for 3 dimensions!");
44  }
45 
46  template<class T>
48  : p(p), u(rvec2{ux, uy}) {
49  static_assert(nsd == 2 || sizeof(T) == 0, "Only for 3 dimensions!");
50  }
51 
53  : p(0), u(0) {
54 
55  }
56 
57 
59  rvec u;
60 };
61 
62 
63 } // namespace alsfvm
64 
65 } // namespace numflux
66 
67 } // namespace euler
68 
Definition: types.hpp:104
__device__ __host__ ExtraVariables(real p, rvec u)
Definition: ExtraVariables.hpp:35
#define __host__
Definition: types.hpp:46
Definition: vec2.hpp:24
__device__ __host__ ExtraVariables(T p, T ux, T uy)
Definition: ExtraVariables.hpp:47
double real
Definition: types.hpp:65
int ux
Definition: sodshocktube.py:4
__device__ __host__ ExtraVariables(T p, T ux, T uy, T uz)
Definition: ExtraVariables.hpp:41
rvec u
Definition: ExtraVariables.hpp:59
#define static_assert(x, y)
Definition: types.hpp:52
#define __device__
Definition: types.hpp:45
Types< nsd >::rvec rvec
Definition: ExtraVariables.hpp:32
real p
Definition: ExtraVariables.hpp:58
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
__device__ __host__ ExtraVariables()
Definition: ExtraVariables.hpp:52
Definition: ExtraVariables.hpp:29