Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
reconstruction.h
Go to the documentation of this file.
1
7#ifndef RECONSTRUCTION_H
8#define RECONSTRUCTION_H
9
10#include "../reconstruction/pcm_cuda.h"
11#include "../reconstruction/reconstruction_internals.h"
12#include "../utils/hydro_utilities.h"
13
14namespace reconstruction
15{
33template <int reconstruction_order, uint direction>
34void __device__ __host__ inline Reconstruct_Interface_States(Real const *dev_conserved, size_t const xid,
35 size_t const yid, size_t const zid, size_t const nx,
36 size_t const ny, size_t const n_cells, Real const gamma,
37 reconstruction::InterfaceState &left_interface,
38 reconstruction::InterfaceState &right_interface)
39{
40 // First, check that our reconstruction order is correct
41 static_assert(
42 (reconstruction_order == reconstruction::Kind::pcm) or (reconstruction_order == reconstruction::Kind::plmc) or
43 (reconstruction_order == reconstruction::Kind::plmp) or
44 (reconstruction_order == reconstruction::Kind::ppmc) or (reconstruction_order == reconstruction::Kind::ppmp),
45 "The reconstruction chosen does not exist. You must use a member of reconstruction::Kind to choose the order.");
46
47 // Choose the correct reconstruction method and compute the interface states
48 if constexpr (reconstruction_order == reconstruction::Kind::pcm) {
49 left_interface =
50 reconstruction::PCM_Reconstruction<direction>(dev_conserved, xid, yid, zid, nx, ny, n_cells, gamma);
51 right_interface = reconstruction::PCM_Reconstruction<direction>(dev_conserved, xid + int(direction == 0),
52 yid + int(direction == 1),
53 zid + int(direction == 2), nx, ny, n_cells, gamma);
54 }
55 // else if constexpr(reconstruction_order == reconstruction::Kind::plmc)
56 // {
57
58 // }
59 // else if constexpr(reconstruction_order == reconstruction::Kind::plmp)
60 // {
61
62 // }
63 // else if constexpr(reconstruction_order == reconstruction::Kind::ppmc)
64 // {
65
66 // }
67 // else if constexpr(reconstruction_order == reconstruction::Kind::ppmp)
68 // {
69
70 // }
71 // else
72 // {
73 // // todo, once refactor is done, move static assert warning to here since having it seperate effectively
74 // duplicates effort
75 // }
76
77 // Renable this once all reconstructions have been converted
78 // struct LocalReturnStruct {
79 // reconstruction::InterfaceState left, right;
80 // };
81 // return LocalReturnStruct{left_interface, right_interface};
82}
83
84} // namespace reconstruction
85
86#endif
Namespace to contain various utilities for the interface reconstruction kernels.
Definition pcm_cuda.h:23
void __device__ __host__ Reconstruct_Interface_States(Real const *dev_conserved, size_t const xid, size_t const yid, size_t const zid, size_t const nx, size_t const ny, size_t const n_cells, Real const gamma, reconstruction::InterfaceState &left_interface, reconstruction::InterfaceState &right_interface)
Definition reconstruction.h:34
Definition basic_structs.h:165