10#include "../global/global.h"
11#include "../global/global_cuda.h"
12#include "../utils/gpu.hpp"
58 __device__ __host__
const T&
operator[](std::size_t i)
const {
return arr_[i]; }
68 __device__ __host__ T&
x() noexcept {
return arr_[0]; }
69 __device__ __host__
const T&
x() const noexcept {
return arr_[0]; }
70 __device__ __host__ T& y() noexcept {
return arr_[1]; }
71 __device__ __host__
const T& y() const noexcept {
return arr_[1]; }
72 __device__ __host__ T& z() noexcept {
return arr_[2]; }
73 __device__ __host__
const T& z() const noexcept {
return arr_[2]; }
98 Real scalar[grid_enum::nscalars];
105 VectorXYZ<Real> const& in_magnetic = {0, 0, 0}, Real
const in_gas_energy = 0.0)
106 : density(in_density), momentum(in_momentum), energy(in_energy)
109 magnetic = in_magnetic;
113 gas_energy = in_gas_energy;
126 Real density, pressure;
140 Real scalar[grid_enum::nscalars];
148 VectorXYZ<Real> const& in_magnetic = {0, 0, 0}, Real
const in_gas_energy = 0.0)
149 : density(in_density), velocity(in_velocity), pressure(in_pressure)
152 magnetic = in_magnetic;
156 gas_energy = in_gas_energy;
167 Real density, energy;
183 Real scalar[grid_enum::nscalars];
193 Real
const in_total_pressure = 0.0)
194 : density(in_density), velocity(in_velocity), energy(in_energy),
pressure(in_pressure)
196 momentum.
x() = velocity.
x() * density;
197 momentum.y() = velocity.y() * density;
198 momentum.z() = velocity.z() * density;
200 magnetic = in_magnetic;
201 total_pressure = in_total_pressure;
Definition basic_structs.h:15
Namespace to contain various utilities for the interface reconstruction kernels.
Definition pcm_cuda.h:23
A data only struct for the conserved variables.
Definition basic_structs.h:83
Conserved(Real const in_density, VectorXYZ< Real > const &in_momentum, Real const in_energy, VectorXYZ< Real > const &in_magnetic={0, 0, 0}, Real const in_gas_energy=0.0)
Manual constructor, mostly used for testing and doesn't init all members.
Definition basic_structs.h:104
Conserved()=default
Default constructor, should init everything to zero.
A data only struct for the primitive variables.
Definition basic_structs.h:124
Primitive(Real const in_density, VectorXYZ< Real > const &in_velocity, Real const in_pressure, VectorXYZ< Real > const &in_magnetic={0, 0, 0}, Real const in_gas_energy=0.0)
Definition basic_structs.h:147
Primitive()=default
Default constructor, should init everything to zero.
A data only struct that acts as a simple 3 element vector.
Definition basic_structs.h:32
__device__ __host__ T & x() noexcept
Directly access the x, y, and z elements. Const version is needed if the object instance is declared ...
Definition basic_structs.h:68
__device__ __host__ T & operator[](std::size_t i)
Overload for the [] operator to allow array-like access. Const version is needed if the object instan...
Definition basic_structs.h:57
__device__ __host__ T * data()
Returns the pointer to the data array.
Definition basic_structs.h:45
T arr_[3]
Definition basic_structs.h:35
Definition basic_structs.h:165
InterfaceState()=default
Default constructor, should set everything to 0.
InterfaceState(Real const in_density, hydro_utilities::VectorXYZ< Real > const in_velocity, Real const in_energy, Real const in_pressure, hydro_utilities::VectorXYZ< Real > const in_magnetic={0, 0, 0}, Real const in_total_pressure=0.0)
Definition basic_structs.h:191
Real pressure
Note that pressure here is the gas pressure not the total pressure which would include the magnetic c...
Definition basic_structs.h:169