1 #ifndef ANALYTIC_3D_MAG_HPP
2 #define ANALYTIC_3D_MAG_HPP
12 double get_circular_analytic_psi3d(
const Equilibrium& equil,
double r,
double z,
double phi){
16 double phi_factor = 1.0 + 0.1*sin(phi);
18 return (rp*rp + zp*zp)*phi_factor;
22 double get_analytic_Br(
const Equilibrium& equil,
double r,
double z,
double phi){
26 double phi_factor = 1.0 + 0.1*sin(phi);
32 double get_analytic_Bz(
const Equilibrium& equil,
double r,
double z,
double phi){
36 double phi_factor = 1.0 + 0.1*sin(phi);
41 double get_analytic_Bphi(
const Equilibrium& equil,
double r,
double z,
double phi){
42 double phi_factor = 1.0 + 0.1*cos(phi);
48 Kokkos::View<double***, Kokkos::LayoutRight, HostType> analytic_3d_psi_grid(
const Equilibrium& equil,
49 const View<double*, HostType>& r,
50 const View<double*, HostType>& z,
51 const View<double*, HostType>& phi){
53 Kokkos::View<double***, Kokkos::LayoutRight, HostType> psi_grid(
"psi_grid",phi.size(), z.size(), r.size());
54 for (
int k=0; k<phi.size(); k++){
55 for (
int j=0; j<z.size(); j++){
56 for (
int i=0; i<r.size(); i++){
57 psi_grid(k,j,i) = get_circular_analytic_psi3d(equil, r(i), z(j), phi(k));
65 Kokkos::View<double***, Kokkos::LayoutRight, HostType> analytic_3d_Br_grid(
const Equilibrium& equil,
66 const View<double*, HostType>& r,
67 const View<double*, HostType>& z,
68 const View<double*, HostType>& phi){
70 Kokkos::View<double***, Kokkos::LayoutRight, HostType> Br_grid(
"Br_grid",phi.size(), z.size(), r.size());
71 for (
int k=0; k<phi.size(); k++){
72 for (
int j=0; j<z.size(); j++){
73 for (
int i=0; i<r.size(); i++){
74 Br_grid(k,j,i) = get_analytic_Br(equil, r(i), z(j), phi(k));
82 Kokkos::View<double***, Kokkos::LayoutRight, HostType> analytic_3d_Bz_grid(
const Equilibrium& equil,
83 const View<double*, HostType>& r,
84 const View<double*, HostType>& z,
85 const View<double*, HostType>& phi){
87 Kokkos::View<double***, Kokkos::LayoutRight, HostType> Bz_grid(
"Bz_grid",phi.size(), z.size(), r.size());
88 for (
int k=0; k<phi.size(); k++){
89 for (
int j=0; j<z.size(); j++){
90 for (
int i=0; i<r.size(); i++){
91 Bz_grid(k,j,i) = get_analytic_Bz(equil, r(i), z(j), phi(k));
99 Kokkos::View<double***, Kokkos::LayoutRight, HostType> analytic_3d_Bphi_grid(
const Equilibrium& equil,
100 const View<double*, HostType>& r,
101 const View<double*, HostType>& z,
102 const View<double*, HostType>& phi){
104 Kokkos::View<double***, Kokkos::LayoutRight, HostType> Bphi_grid(
"Bphi_grid",phi.size(), z.size(), r.size());
105 for (
int k=0; k<phi.size(); k++){
106 for (
int j=0; j<z.size(); j++){
107 for (
int i=0; i<r.size(); i++){
108 Bphi_grid(k,j,i) = get_analytic_Bphi(equil, r(i), z(j), phi(k));
double z
Definition: grid_structs.hpp:30
RZBounds bounds
Min and max for r and z.
Definition: equil.hpp:80
double r
Definition: grid_structs.hpp:29
KOKKOS_INLINE_FUNCTION double get_z_width() const
Definition: rz_bounds.hpp:28
KOKKOS_INLINE_FUNCTION double get_r_width() const
Definition: rz_bounds.hpp:24
RZPair axis
Definition: equil.hpp:90