#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 > |
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 () |
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) |
void | get_pot_convert_to_ff (const Grid< DeviceType > &grid, FieldFollowingCoordinates &ff, GetPotentialGradTempViews< DeviceType > &tmp, bool convert_00_field) |
void | broadcast_potentials (const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, bool calculate_E_para_em, GetPotentialGradTempViews< DeviceType > &tmp) |
template<typename VectorT > | |
void | transpose_and_set_vector_field (const Grid< DeviceType > &grid, GetPotentialGradTempViews< DeviceType > &tmp, GridField< VectorT > &dfield) |
void | get_pot_grad (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const ElectricField< DeviceType > &electric_field, const GradientMatrices< DeviceType > &grad_matrices, GetPotentialGradTempViews< DeviceType > &tmp, bool calculate_E) |
void | assign_to_tmp (GetPotentialGradTempViews< DeviceType > &tmp) |
void | get_pot_mat_mult (const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, GetPotentialGradTempViews< DeviceType > &tmp, const std::vector< Matrix< DeviceType >> &gyro_avg_matrices, bool calculate_E_para_em) |
template<typename FieldT , typename ScalarT , typename VectorT > | |
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 > &tmp, GridField< ScalarT > &field, GridField< VectorT > &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 > & | tmp | ) |
void broadcast_potentials | ( | const Grid< DeviceType > & | grid, |
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
bool | calculate_E_para_em, | ||
GetPotentialGradTempViews< DeviceType > & | tmp | ||
) |
void get_field_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 > & | tmp, | ||
GridField< ScalarT > & | field, | ||
GridField< VectorT > & | 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 > & | tmp, | ||
bool | convert_00_field | ||
) |
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 > & | tmp, | ||
bool | calculate_E | ||
) |
void get_pot_mat_mult | ( | const Grid< DeviceType > & | grid, |
const DomainDecomposition< DeviceType > & | pol_decomp, | ||
GetPotentialGradTempViews< DeviceType > & | 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 |
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_vector_field | ( | const Grid< DeviceType > & | grid, |
GetPotentialGradTempViews< DeviceType > & | tmp, | ||
GridField< VectorT > & | dfield | ||
) |