#include "timer_macro.hpp"
#include "my_subview.hpp"
#include "sml.hpp"
#include "gradparx2.hpp"
#include "field_following_coordinates.hpp"
#include "matrix.hpp"
#include "gradient_matrices.hpp"
#include "get_potential_grad.hpp"
Classes | |
struct | GetPotentialGradTempViews< Device, VT, PIT > |
Functions | |
int * | get_psn_ff_1dp_tr_loc () |
double * | get_psn_ff_1dp_p_loc () |
double * | get_psn_ff_1dp_dx_loc () |
rtype * | get_psn_pbd0_2_iseg_loc () |
int | get_psn_pbd0_2_nseg () |
void | get_field_Ah_cv_ff (Field< VarType::Scalar, PhiInterpType::Planes > *psn_Ah_cv_ff) |
void | get_pot_epar_em_filter (double *tmp, double *E_para_em) |
void | get_gyro_avg_mat_data (int ind, int *m, int *n, int *w, int *nnz, int *is_csr_int, int **csr_ridx_or_eindex, int **csr_cidx_or_nelement, double **values) |
template<VarType VT, PhiInterpType PIT> | |
void | get_pot_convert_to_ff (const Grid< DeviceType > &grid, FieldFollowingCoordinates &ff, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, bool convert_00_field) |
template<VarType VT, PhiInterpType PIT> | |
void | broadcast_potentials (const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, bool calculate_E_para_em, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp) |
template<VarType VT, PhiInterpType PIT> | |
void | transpose_and_set_vector_field (const Grid< DeviceType > &grid, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, GridField< VT, PIT > &dfield) |
template<VarType VT, PhiInterpType PIT> | |
void | transpose_and_set_scalar_field (const Grid< DeviceType > &grid, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, const Kokkos::View< double ***, Kokkos::LayoutRight, DeviceType > &tmp_field, GridField< VarType::Scalar, PIT > &field) |
template<VarType VT, PhiInterpType PIT> | |
void | get_E00 (GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, Kokkos::View< Field< VarType::Vector2D, PIT > *, Kokkos::LayoutRight, HostType > &E00_ff_h) |
template<VarType VT, PhiInterpType PIT> | |
void | get_pot_grad (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const ElectricField< DeviceType > &electric_field, const GradientMatrices< DeviceType > &grad_matrices, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, bool calculate_E) |
template<VarType VT, PhiInterpType PIT> | |
void | get_pot_epar (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, FieldFollowingCoordinates &ff, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, bool calculate_E_para_em) |
template<VarType VT, PhiInterpType PIT> | |
void | assign_to_tmp (GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp) |
template<VarType VT, PhiInterpType PIT> | |
void | get_pot_mat_mult (const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, const std::vector< Matrix< DeviceType >> &gyro_avg_matrices, bool calculate_E_para_em) |
template<typename FieldT , VarType VT, PhiInterpType PIT> | |
void | get_field_grad (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, const GradientMatrices< DeviceType > &grad_matrices, FieldFollowingCoordinates &ff, std::vector< Matrix< DeviceType >> &gyro_avg_matrices, FieldT &psn_field, GetPotentialGradTempViews< DeviceType, VT, PIT > &tmp, GridField< VarType::Scalar, PIT > &field, GridField< VT, PIT > &dfield, bool calculate_E, bool do_get_E00) |
void | get_potential_grad (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field) |
void assign_to_tmp | ( | GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp | ) |
void broadcast_potentials | ( | const Grid< DeviceType > & | grid, |
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
bool | calculate_E_para_em, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp | ||
) |
void get_E00 | ( | GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, |
Kokkos::View< Field< VarType::Vector2D, PIT > *, Kokkos::LayoutRight, HostType > & | E00_ff_h | ||
) |
void get_field_Ah_cv_ff | ( | Field< VarType::Scalar, PhiInterpType::Planes > * | psn_Ah_cv_ff | ) |
void get_field_grad | ( | const Simulation< DeviceType > & | sml, |
const Grid< DeviceType > & | grid, | ||
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
ElectricField< DeviceType > & | electric_field, | ||
const GradientMatrices< DeviceType > & | grad_matrices, | ||
FieldFollowingCoordinates & | ff, | ||
std::vector< Matrix< DeviceType >> & | gyro_avg_matrices, | ||
FieldT & | psn_field, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
GridField< VarType::Scalar, PIT > & | field, | ||
GridField< VT, PIT > & | dfield, | ||
bool | calculate_E, | ||
bool | do_get_E00 | ||
) |
Calculates a gyro-averaged potential and its gradients, in field-following coordinates (if XGC1). The calculations inside the calculate_E flag can probably be refactored and pulled out of get_field_grad for clarity.
[in] | grid | is the grid object |
[in] | magnetic_field | is the magnetic field object |
[in] | psn_field | is the input potential |
[out] | psn_field_rho_ff | is the gyroaveraged potential (field-following if XGC1) |
[out] | psn_dfield_rho_ff | is the gyroaveraged gradient (field-following if XGC1) |
[in] | calculate_E_int | is 1 if calculating E, which has some extra steps compared to the As or Ah calculation |
void get_gyro_avg_mat_data | ( | int | ind, |
int * | m, | ||
int * | n, | ||
int * | w, | ||
int * | nnz, | ||
int * | is_csr_int, | ||
int ** | csr_ridx_or_eindex, | ||
int ** | csr_cidx_or_nelement, | ||
double ** | values | ||
) |
void get_pot_convert_to_ff | ( | const Grid< DeviceType > & | grid, |
FieldFollowingCoordinates & | ff, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
bool | convert_00_field | ||
) |
void get_pot_epar | ( | const Simulation< DeviceType > & | sml, |
const Grid< DeviceType > & | grid, | ||
FieldFollowingCoordinates & | ff, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
bool | calculate_E_para_em | ||
) |
void get_pot_epar_em_filter | ( | double * | tmp, |
double * | E_para_em | ||
) |
void get_pot_grad | ( | const Simulation< DeviceType > & | sml, |
const Grid< DeviceType > & | grid, | ||
const ElectricField< DeviceType > & | electric_field, | ||
const GradientMatrices< DeviceType > & | grad_matrices, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
bool | calculate_E | ||
) |
void get_pot_mat_mult | ( | const Grid< DeviceType > & | grid, |
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
const std::vector< Matrix< DeviceType >> & | gyro_avg_matrices, | ||
bool | calculate_E_para_em | ||
) |
void get_potential_grad | ( | const Simulation< DeviceType > & | sml, |
const Grid< DeviceType > & | grid, | ||
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
ElectricField< DeviceType > & | electric_field | ||
) |
Calculates gyro-averaged electric field, electric potential in field-following coordinates (if XGC1) If EM, also calculates analogous magnetic potential and gradients
[in] | sml | is the simulation object |
[in] | grid | is the grid object |
[in] | magnetic_field | is the magnetic field object |
[in] | electric_field | is the electric field object |
double* get_psn_ff_1dp_dx_loc | ( | ) |
double* get_psn_ff_1dp_p_loc | ( | ) |
int* get_psn_ff_1dp_tr_loc | ( | ) |
rtype* get_psn_pbd0_2_iseg_loc | ( | ) |
int get_psn_pbd0_2_nseg | ( | ) |
void transpose_and_set_scalar_field | ( | const Grid< DeviceType > & | grid, |
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
const Kokkos::View< double ***, Kokkos::LayoutRight, DeviceType > & | tmp_field, | ||
GridField< VarType::Scalar, PIT > & | field | ||
) |
void transpose_and_set_vector_field | ( | const Grid< DeviceType > & | grid, |
GetPotentialGradTempViews< DeviceType, VT, PIT > & | tmp, | ||
GridField< VT, PIT > & | dfield | ||
) |