XGCa
|
#include <Kokkos_Random.hpp>
#include "rng_seed.hpp"
#include "globals.hpp"
#include "my_mpi.hpp"
#include "basic_physics.hpp"
#include "magnetic_field.hpp"
#include "grid.hpp"
#include "species.hpp"
#include "linear_weights.hpp"
#include "view_arithmetic.hpp"
#include "grid_node_tr_mapping.hpp"
#include "bounds.hpp"
#include "grid_field.hpp"
#include "vertex_list.hpp"
#include "my_subview.hpp"
#include "linear_1d_interpolation.hpp"
#include "get_volume.hpp"
Functions | |
long long int | get_n_monte_carlo (double desired_volume_accuracy, double simulation_volume) |
void | get_tr_vol_and_area (const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, View< double *, CLayout, DeviceType > &tr_area, View< double *, CLayout, DeviceType > &tr_vol) |
void | analytical_area_and_volume (const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const View< int *, CLayout, DeviceType > &num_t_node, const View< int **, CLayout, DeviceType > &tr_node, const View< double *, CLayout, DeviceType > &tr_area, View< double *, CLayout, DeviceType > &node_area, View< double *, CLayout, DeviceType > &node_vol, View< double **, CLayout, DeviceType > &node_vol_ff, View< double *, CLayout, DeviceType > &node_vol_nearest) |
template<DomainType T> | |
KOKKOS_INLINE_FUNCTION double | r_norm (double rdim, double roffset, double rand) |
template<> | |
KOKKOS_INLINE_FUNCTION double | r_norm< DomainType::ToroidalVolume > (double rdim, double roffset, double rand) |
template<> | |
KOKKOS_INLINE_FUNCTION double | r_norm< DomainType::CylindricalVolume > (double rdim, double roffset, double rand) |
template<> | |
KOKKOS_INLINE_FUNCTION double | r_norm< DomainType::Area > (double rdim, double roffset, double rand) |
template<DomainType DT, typename F > | |
void | monte_carlo_parallel_for (const RZBounds &rz_bounds, const Bounds &phi_bounds, long long int n_monte_carlo, bool use_nonrandom_sampling, F func, double &marker_density) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_vol00 (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const SimdVector2D &x, const Simd< double > &psi, const SimdGridWeights< Order::One, PIT_GLOBAL > &grid_wts, const View< double *, CLayout, DeviceType > &vol00) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_diag_1d (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const SimdVector &v, const View< double *, CLayout, DeviceType > &vol) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_col_vb (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const SimdVector &v, double psi_min, double psi_max, int m, int mtheta, double inv_dp, double inv_dtheta, const View< double **, CLayout, DeviceType > &vol) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_node_area (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const SimdVector &v, const View< double *, CLayout, DeviceType > &node_area) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_node_vol (const Grid< DeviceType > &grid, const SimdGridWeights< Order::One, PhiInterpType::None > &grid_wts, const View< double *, CLayout, DeviceType > &node_vol) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_node_vol_ff (const Grid< DeviceType > &grid, const SimdGridWeights< Order::One, PhiInterpType::Planes > &grid_wts, const Simd< double > &phi, const Bounds &phi_bounds, const View< double **, CLayout, DeviceType > &node_vol_ff) |
KOKKOS_INLINE_FUNCTION void | monte_carlo_node_vol_nearest (const Grid< DeviceType > &grid, const SimdGridWeights< Order::Zero, PIT_GLOBAL > &grid_wts0, const View< double *, CLayout, DeviceType > &node_vol_nearest) |
template<typename T > | |
void | reduce_and_normalize_monte (const DomainDecomposition< DeviceType > &pol_decomp, double local_marker_density, MonteReductionOption option, const T &view) |
void | monte_carlo_area (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, long long int n_monte_carlo, bool use_nonrandom_sampling, View< double *, CLayout, DeviceType > &node_area) |
void | monte_carlo_psi_volume (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, long long int n_monte_carlo, bool use_nonrandom_sampling, View< double *, CLayout, DeviceType > &vol00) |
void | monte_carlo_diag_1d_vol (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, long long int n_monte_carlo, bool use_nonrandom_sampling, View< double *, CLayout, DeviceType > &vol) |
void | monte_carlo_col_vb_vol (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, long long int n_monte_carlo, bool use_nonrandom_sampling, double psi_min, double psi_max, int m, int mtheta, double inv_dp, double inv_dtheta, View< double **, CLayout, DeviceType > &vol) |
void | monte_carlo_volume (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, long long int n_monte_carlo, bool use_nonrandom_sampling, View< double *, CLayout, DeviceType > &node_vol, View< double **, CLayout, DeviceType > &node_vol_ff, View< double **, CLayout, DeviceType > &node_vol_ff_l, View< double **, CLayout, DeviceType > &node_vol_ff_r, View< double *, CLayout, DeviceType > &node_vol_nearest, View< double *, CLayout, DeviceType > &vol00) |
void | set_psi00_volume_analytic (const View< int *, CLayout, HostType > &nnodes_on_surface, const View< int **, CLayout, HostType > &surf_idx, const View< double *, CLayout, DeviceType > &psi_d, const View< double *, CLayout, DeviceType > &node_vol_d, const View< double *, CLayout, HostType > &psi00, View< double *, CLayout, DeviceType > vol00_d) |
void | get_node_volume (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const View< int *, CLayout, DeviceType > &num_t_node, const View< int **, CLayout, DeviceType > &tr_node, bool node_vol_monte, int n_monte_carlo, const View< int *, CLayout, HostType > &nnodes_on_surface_h, const View< int **, CLayout, HostType > &surf_idx_h, VolumesAndAreas &volumes_and_areas) |
|
strong |
|
strong |
void analytical_area_and_volume | ( | const MagneticField< DeviceType > & | magnetic_field, |
const Grid< DeviceType > & | grid, | ||
const View< int *, CLayout, DeviceType > & | num_t_node, | ||
const View< int **, CLayout, DeviceType > & | tr_node, | ||
const View< double *, CLayout, DeviceType > & | tr_area, | ||
View< double *, CLayout, DeviceType > & | node_area, | ||
View< double *, CLayout, DeviceType > & | node_vol, | ||
View< double **, CLayout, DeviceType > & | node_vol_ff, | ||
View< double *, CLayout, DeviceType > & | node_vol_nearest | ||
) |
long long int get_n_monte_carlo | ( | double | desired_volume_accuracy, |
double | simulation_volume | ||
) |
void get_node_volume | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
const View< int *, CLayout, DeviceType > & | num_t_node, | ||
const View< int **, CLayout, DeviceType > & | tr_node, | ||
bool | node_vol_monte, | ||
int | n_monte_carlo, | ||
const View< int *, CLayout, HostType > & | nnodes_on_surface_h, | ||
const View< int **, CLayout, HostType > & | surf_idx_h, | ||
VolumesAndAreas & | volumes_and_areas | ||
) |
Get volume arrays
void get_tr_vol_and_area | ( | const MagneticField< DeviceType > & | magnetic_field, |
const Grid< DeviceType > & | grid, | ||
View< double *, CLayout, DeviceType > & | tr_area, | ||
View< double *, CLayout, DeviceType > & | tr_vol | ||
) |
void monte_carlo_area | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
View< double *, CLayout, DeviceType > & | node_area | ||
) |
Get area array
KOKKOS_INLINE_FUNCTION void monte_carlo_col_vb | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
const SimdVector & | v, | ||
double | psi_min, | ||
double | psi_max, | ||
int | m, | ||
int | mtheta, | ||
double | inv_dp, | ||
double | inv_dtheta, | ||
const View< double **, CLayout, DeviceType > & | vol | ||
) |
void monte_carlo_col_vb_vol | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
double | psi_min, | ||
double | psi_max, | ||
int | m, | ||
int | mtheta, | ||
double | inv_dp, | ||
double | inv_dtheta, | ||
View< double **, CLayout, DeviceType > & | vol | ||
) |
Get col_vb_vol
KOKKOS_INLINE_FUNCTION void monte_carlo_diag_1d | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
const SimdVector & | v, | ||
const View< double *, CLayout, DeviceType > & | vol | ||
) |
void monte_carlo_diag_1d_vol | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
View< double *, CLayout, DeviceType > & | vol | ||
) |
Get diag_1d_vol
KOKKOS_INLINE_FUNCTION void monte_carlo_node_area | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
const SimdVector & | v, | ||
const View< double *, CLayout, DeviceType > & | node_area | ||
) |
KOKKOS_INLINE_FUNCTION void monte_carlo_node_vol | ( | const Grid< DeviceType > & | grid, |
const SimdGridWeights< Order::One, PhiInterpType::None > & | grid_wts, | ||
const View< double *, CLayout, DeviceType > & | node_vol | ||
) |
KOKKOS_INLINE_FUNCTION void monte_carlo_node_vol_ff | ( | const Grid< DeviceType > & | grid, |
const SimdGridWeights< Order::One, PhiInterpType::Planes > & | grid_wts, | ||
const Simd< double > & | phi, | ||
const Bounds & | phi_bounds, | ||
const View< double **, CLayout, DeviceType > & | node_vol_ff | ||
) |
KOKKOS_INLINE_FUNCTION void monte_carlo_node_vol_nearest | ( | const Grid< DeviceType > & | grid, |
const SimdGridWeights< Order::Zero, PIT_GLOBAL > & | grid_wts0, | ||
const View< double *, CLayout, DeviceType > & | node_vol_nearest | ||
) |
void monte_carlo_parallel_for | ( | const RZBounds & | rz_bounds, |
const Bounds & | phi_bounds, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
F | func, | ||
double & | marker_density | ||
) |
void monte_carlo_psi_volume | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
View< double *, CLayout, DeviceType > & | vol00 | ||
) |
Get vol00
KOKKOS_INLINE_FUNCTION void monte_carlo_vol00 | ( | const Grid< DeviceType > & | grid, |
const MagneticField< DeviceType > & | magnetic_field, | ||
const SimdVector2D & | x, | ||
const Simd< double > & | psi, | ||
const SimdGridWeights< Order::One, PIT_GLOBAL > & | grid_wts, | ||
const View< double *, CLayout, DeviceType > & | vol00 | ||
) |
void monte_carlo_volume | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
const Grid< DeviceType > & | grid, | ||
const MagneticField< DeviceType > & | magnetic_field, | ||
long long int | n_monte_carlo, | ||
bool | use_nonrandom_sampling, | ||
View< double *, CLayout, DeviceType > & | node_vol, | ||
View< double **, CLayout, DeviceType > & | node_vol_ff, | ||
View< double **, CLayout, DeviceType > & | node_vol_ff_l, | ||
View< double **, CLayout, DeviceType > & | node_vol_ff_r, | ||
View< double *, CLayout, DeviceType > & | node_vol_nearest, | ||
View< double *, CLayout, DeviceType > & | vol00 | ||
) |
Get volume arrays
KOKKOS_INLINE_FUNCTION double r_norm | ( | double | rdim, |
double | roffset, | ||
double | rand | ||
) |
KOKKOS_INLINE_FUNCTION double r_norm< DomainType::Area > | ( | double | rdim, |
double | roffset, | ||
double | rand | ||
) |
KOKKOS_INLINE_FUNCTION double r_norm< DomainType::CylindricalVolume > | ( | double | rdim, |
double | roffset, | ||
double | rand | ||
) |
KOKKOS_INLINE_FUNCTION double r_norm< DomainType::ToroidalVolume > | ( | double | rdim, |
double | roffset, | ||
double | rand | ||
) |
void reduce_and_normalize_monte | ( | const DomainDecomposition< DeviceType > & | pol_decomp, |
double | local_marker_density, | ||
MonteReductionOption | option, | ||
const T & | view | ||
) |
void set_psi00_volume_analytic | ( | const View< int *, CLayout, HostType > & | nnodes_on_surface, |
const View< int **, CLayout, HostType > & | surf_idx, | ||
const View< double *, CLayout, DeviceType > & | psi_d, | ||
const View< double *, CLayout, DeviceType > & | node_vol_d, | ||
const View< double *, CLayout, HostType > & | psi00, | ||
View< double *, CLayout, DeviceType > | vol00_d | ||
) |