1 #ifndef ELECTRIC_FIELD_HPP
2 #define ELECTRIC_FIELD_HPP
11 template<
class Device>
24 Kokkos::View<Field<VarType::Vector2D,PhiInterpType::Planes>*,Kokkos::LayoutRight,
HostType>
E00_ff_h;
28 Kokkos::View<double**,Kokkos::LayoutRight,HostType>
Ah_h;
31 Kokkos::View<double**,Kokkos::LayoutRight,HostType>
As_h;
42 Kokkos::View<double**,Kokkos::LayoutRight,HostType>
dpot_h;
43 Kokkos::View<Field<VarType::Scalar,PhiInterpType::Planes>*,Kokkos::LayoutRight,
HostType> dpot_ff_h;
47 Kokkos::View<double*,Kokkos::LayoutRight,HostType>
dpot_h;
54 Kokkos::View<double*,Kokkos::LayoutRight,HostType>
pot0_h;
83 dpot_ff_h(
"dpot_ff_h",
nnode),
101 bool em_mixed_variable = nlr.
get<
bool>(
"sml_em_mixed_variable",
false);
102 bool em_control_variate = nlr.
get<
bool>(
"sml_em_control_variate",
false);
103 int em_pullback_mode = nlr.
get<
int>(
"sml_em_pullback_mode",3);
104 if (em_control_variate){
108 if (em_mixed_variable){
111 if (em_pullback_mode==4){
127 , dEr_B2.rho_h.data()
128 , dEz_B2.rho_h.data()
146 device_view = host_view;
150 template<
typename T1,
typename T2>
153 device_view = T1(
"gfpack_view",host_view.layout());
155 Kokkos::deep_copy(device_view, host_view);
159 template<PhiInterpType PIT>
195 GPTLstart(
"Copy_rho_ff_fields_to_device");
204 GPTLstop(
"Copy_rho_ff_fields_to_device");
219 template<PhiInterpType PIT>
229 template<PhiInterpType PIT>
245 template<PhiInterpType PIT>
GridField< VarType::Scalar, PhiInterpType::Planes > Ah_cv
Definition: electric_field.hpp:34
bool decompose_fields
Whether to decompose fields.
Definition: domain_decomposition.hpp:34
GridField< VarType::Scalar, PhiInterpType::None > pot
Definition: electric_field.hpp:45
static int GPTLstart(const char *name)
Definition: timer_macro.hpp:9
void set_rho_pointers(int nrho, int n, double *pot0, double *dpot, Field< VarType::Vector2D, PhiInterpType::None > *E_rho)
int first_plane
First plane belonging to this rank, including ghost planes.
Definition: field_decomposition.hpp:35
void copy_to_pack(T &device_view, const T &host_view) const
Definition: electric_field.hpp:145
ElectricField(NLReader::NamelistReader &nlr, int nnode_in, int nplanes_in, int nrho_in)
Definition: electric_field.hpp:61
Kokkos::View< Field< VarType::Vector2D, PIT > **, Kokkos::LayoutRight, Device > E_rho
Definition: grid_field_pack.hpp:277
GridFieldPack< Device, PIT > copy_Ah_cv_to_device(KinType kintype_in, const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid) const
Definition: electric_field.hpp:220
T get(const string ¶m, const T default_val, int val_ind=0)
Definition: NamelistReader.hpp:353
Kokkos::Device< HostExSpace, HostMemSpace > HostType
Definition: space_settings.hpp:56
Definition: globals.hpp:82
GridFieldOpts
Definition: grid_field_pack.hpp:209
Definition: plane_field_gatherer.hpp:9
GridFieldPack< Device, PIT > copy_push_fields_to_device(KinType kintype_in, const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid) const
Definition: electric_field.hpp:160
int nrho
Definition: electric_field.hpp:17
Definition: NamelistReader.hpp:163
int phi_offset
Offset for phi_ff field decomposition.
Definition: grid_field_pack.hpp:250
Definition: electric_field.hpp:12
Kokkos::View< double *, Kokkos::LayoutRight, Device > dpot
Definition: grid_field_pack.hpp:278
GridFieldPack< Device, PIT > copy_Ah_ff_to_device(KinType kintype_in, const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid) const
Definition: electric_field.hpp:230
Definition: grid_field_pack.hpp:241
Kokkos::View< Field< VT, PIT > **, Kokkos::LayoutRight, HostType > rho_h
Definition: grid_field_pack.hpp:232
GridField< VarType::Vector2D, PhiInterpType::None > E
Definition: electric_field.hpp:46
Kokkos::View< double **, Kokkos::LayoutRight, HostType > Ah_h
Definition: electric_field.hpp:28
ElectricField()
Definition: electric_field.hpp:57
GridField< VarType::Scalar, PhiInterpType::Planes > ddpotdt
Time derivative of phi-<phi> - Not field-following?
Definition: electric_field.hpp:25
Kokkos::View< Field< VarType::Vector2D, PhiInterpType::Planes > *, Kokkos::LayoutRight, HostType > E00_ff_h
Radial electric field from <phi> in field-following format.
Definition: electric_field.hpp:24
void use_namelist(const string &namelist)
Definition: NamelistReader.hpp:322
GridField< VarType::Scalar, PhiInterpType::Planes > Ah
Definition: electric_field.hpp:30
GridField< VarType::Vector, PhiInterpType::Planes > dAs
Definition: electric_field.hpp:32
GridField< VarType::Scalar, PhiInterpType::Planes > Epar_em
Definition: electric_field.hpp:35
Kokkos::View< double **, Kokkos::LayoutRight, HostType > As_h
Definition: electric_field.hpp:31
void gather_phi_ff_on_device(View< FT **, CLayout, HostType > &tmp, View< FT *, CLayout, HostType > &tmp_full, const T_h &rho_ff_h, View< FT **, CLayout, DeviceType > &phi_ff)
Definition: plane_field_gatherer.hpp:133
Kokkos::View< double *, Kokkos::LayoutRight, HostType > pot0_h
Definition: electric_field.hpp:54
bool E00_efield
Flux-surface averaged potential not used for calculating the electric field if .false.
Definition: electric_field.hpp:21
GridField< VarType::Scalar, PhiInterpType::Planes > As
Definition: electric_field.hpp:33
int node_offset
Offset for phi_ff field decomposition.
Definition: grid_field_pack.hpp:251
Kokkos::View< double *, Kokkos::LayoutRight, HostType > dpot_h
Definition: electric_field.hpp:47
KinType
Definition: globals.hpp:81
Kokkos::View< Field< VT, PIT > **, Kokkos::LayoutRight, HostType > rho_ff_h
Contains the local plane of gyroaveraged, field-following, host field.
Definition: grid_field_pack.hpp:221
Kokkos::View< Field< VT, PIT > *, Kokkos::LayoutRight, HostType > ff_h
Contains the local plane, field-following, host field.
Definition: grid_field_pack.hpp:220
bool turb_efield
E-field calculated only with if .false., psndpot will still contain all (n=0,|m|>0) and (|n|>0...
Definition: electric_field.hpp:20
int nphi
Definition: electric_field.hpp:16
void copy_to_pack(T1 &device_view, const T2 &host_view) const
Definition: electric_field.hpp:151
int nnode
Definition: electric_field.hpp:15
FieldDecomposition< Device > field_decomp
Definition: domain_decomposition.hpp:35
GridFieldPack< Device, PIT > copy_dpot_to_device(KinType kintype_in) const
Definition: electric_field.hpp:246
GridField< VarType::Vector, PhiInterpType::Planes > dAh
Definition: electric_field.hpp:29
int first_node
First mesh node belonging to this rank, including ghost nodes.
Definition: field_decomposition.hpp:32
static int GPTLstop(const char *name)
Definition: timer_macro.hpp:10