XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Enumerations | Functions
get_volume.cpp File Reference
#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"
Include dependency graph for get_volume.cpp:

Enumerations

enum  DomainType { DomainType::ToroidalVolume = 0, DomainType::CylindricalVolume, DomainType::Area }
 
enum  MonteReductionOption { MonteReductionOption::LocalWedge = 0, MonteReductionOption::LocalWedgeAxisym, MonteReductionOption::FullDomain }
 

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)
 

Enumeration Type Documentation

enum DomainType
strong
Enumerator
ToroidalVolume 
CylindricalVolume 
Area 
enum MonteReductionOption
strong
Enumerator
LocalWedge 
LocalWedgeAxisym 
FullDomain 

Function Documentation

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the caller graph for this function:

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,
func,
double &  marker_density 
)

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

template<DomainType T>
KOKKOS_INLINE_FUNCTION double r_norm ( double  rdim,
double  roffset,
double  rand 
)
template<>
KOKKOS_INLINE_FUNCTION double r_norm< DomainType::Area > ( 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::ToroidalVolume > ( double  rdim,
double  roffset,
double  rand 
)
template<typename T >
void reduce_and_normalize_monte ( const DomainDecomposition< DeviceType > &  pol_decomp,
double  local_marker_density,
MonteReductionOption  option,
const T &  view 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function: