XGC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Plasma Class Reference

#include <plasma.hpp>

Collaboration diagram for Plasma:
Collaboration graph
[legend]

Classes

struct  DecomposedRecalculableF0Arrays
 

Public Types

enum  DevicePtlOpt { UseDevicePtl =0, NoDevicePtl }
 
enum  ParticleType { Electrons =0, Ions }
 

Public Member Functions

 Plasma ()
 
 Plasma (NLReader::NamelistReader &nlr, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid)
 
template<typename F >
void for_all_species (F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
template<typename F >
void for_all_nonadiabatic_species (F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
template<typename F >
void for_electrons (F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
template<typename F >
void for_all_ions (F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
template<typename F >
void for_all (ParticleType particle_type, F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
template<typename F >
void for_one_species (int isp, F func, DevicePtlOpt device_ptl_opt=UseDevicePtl)
 
int largest_n_ptl (bool check_backup)
 
void deallocate_device_ptl ()
 
void update_decomposed_f0_calculations (const DomainDecomposition< DeviceType > &pol_decomp, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid)
 
void resize_f0_f0g (const DomainDecomposition< DeviceType > &pol_decomp, const VelocityGrid &vgrid)
 
void validate_f0_checkpoint_file_dims (const XGC_IO_Stream &stream, const Grid< DeviceType > &grid, const VelocityGrid &vgrid)
 
void write_checkpoint_files (const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, const XGC_IO_Stream &stream, const XGC_IO_Stream &f0_stream)
 
void read_checkpoint_files (const Grid< DeviceType > &grid, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, const XGC_IO_Stream &stream, const XGC_IO_Stream &f0_stream, bool n_ranks_is_same)
 
double get_main_ion_toroidal_transit_time (const MagneticField< DeviceType > &magnetic_field) const
 

Static Public Member Functions

static std::vector
< MemoryPrediction
estimate_memory_usage (NLReader::NamelistReader &nlr, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp)
 

Public Attributes

std::vector< Species
< DeviceType > > 
all_species
 Every particle species in the simulation. More...
 
VGridDistribution< HostTypef0_f0g
 
View< double *, CLayout, HostTypef0_node_cost
 
DecomposedRecalculableF0Arrays decomposed_recalculable_f0_arrays
 Contains f0 values that are poloidally decomposed but don't need to be transferred between ranks during load rebalancing. More...
 
Kokkos::View< double
**, Kokkos::LayoutRight,
HostType
f0_delta_n
 Flux-surface averaged change of density. More...
 
Kokkos::View< double
**, Kokkos::LayoutRight,
HostType
f0_delta_u
 Flux-surface averaged change of parallel flow. More...
 
Kokkos::View< double
**, Kokkos::LayoutRight,
HostType
f0_delta_T
 Flux-surface averaged change of temperature. More...
 
View< double **, CLayout,
HostType
f0_den_global
 Equilibrium density at vertices. More...
 
View< double **, CLayout,
HostType
f0_temp_global
 Equilibrium temperature at vertices. More...
 
int nspecies
 Number of species including electrons. More...
 
int n_nonadiabatic_species
 Number of nonadiabatic species. More...
 
std::vector< std::string > sp_names
 

Private Member Functions

void init_global_f0_arrays (const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field)
 
template<typename T_in , typename T_out >
void set_unmanaged_f0_species_view (const T_in &view_in, int isp, T_out &view_out)
 
void transfer_particles_d_ownership (int isp)
 
void manage_particle_ownership (int isp, DevicePtlOpt device_ptl_opt)
 

Private Attributes

bool species_share_particles_d_ownership
 Whether to use the device particles sharing scheme. More...
 
bool particles_d_has_owner
 Whether a species owns the device particles allocation. More...
 
int particles_d_owner
 Which species, if any, owns the device particles allocation. More...
 
bool f0_grid
 
double main_ion_characteristic_energy
 

Static Private Attributes

static constexpr bool reduced_deltaf = false
 Equivalent to the preprocessor flag for now. More...
 

Member Enumeration Documentation

Enumerator
UseDevicePtl 
NoDevicePtl 
Enumerator
Electrons 
Ions 

Constructor & Destructor Documentation

Plasma::Plasma ( )
inline
Plasma::Plasma ( NLReader::NamelistReader nlr,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const DomainDecomposition< DeviceType > &  pol_decomp,
const VelocityGrid vgrid 
)

< Characteristic ion energy (keV) –> controls reference time (toroidal ion transit time)

Member Function Documentation

void Plasma::deallocate_device_ptl ( )
inline

Here is the caller graph for this function:

std::vector< MemoryPrediction > Plasma::estimate_memory_usage ( NLReader::NamelistReader nlr,
const Grid< DeviceType > &  grid,
const DomainDecomposition< DeviceType > &  pol_decomp 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_all ( ParticleType  particle_type,
func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_all_ions ( func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_all_nonadiabatic_species ( func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_all_species ( func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_electrons ( func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename F >
void Plasma::for_one_species ( int  isp,
func,
DevicePtlOpt  device_ptl_opt = UseDevicePtl 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

double Plasma::get_main_ion_toroidal_transit_time ( const MagneticField< DeviceType > &  magnetic_field) const
inline

Here is the caller graph for this function:

void Plasma::init_global_f0_arrays ( const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field 
)
inlineprivate

Here is the call graph for this function:

int Plasma::largest_n_ptl ( bool  check_backup)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::manage_particle_ownership ( int  isp,
DevicePtlOpt  device_ptl_opt 
)
inlineprivate

Here is the caller graph for this function:

void Plasma::read_checkpoint_files ( const Grid< DeviceType > &  grid,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
const XGC_IO_Stream stream,
const XGC_IO_Stream f0_stream,
bool  n_ranks_is_same 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::resize_f0_f0g ( const DomainDecomposition< DeviceType > &  pol_decomp,
const VelocityGrid vgrid 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T_in , typename T_out >
void Plasma::set_unmanaged_f0_species_view ( const T_in &  view_in,
int  isp,
T_out &  view_out 
)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::transfer_particles_d_ownership ( int  isp)
inlineprivate
void Plasma::update_decomposed_f0_calculations ( const DomainDecomposition< DeviceType > &  pol_decomp,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const VelocityGrid vgrid 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::validate_f0_checkpoint_file_dims ( const XGC_IO_Stream stream,
const Grid< DeviceType > &  grid,
const VelocityGrid vgrid 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::write_checkpoint_files ( const Grid< DeviceType > &  grid,
const DomainDecomposition< DeviceType > &  pol_decomp,
const XGC_IO_Stream stream,
const XGC_IO_Stream f0_stream 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<Species<DeviceType> > Plasma::all_species

Every particle species in the simulation.

DecomposedRecalculableF0Arrays Plasma::decomposed_recalculable_f0_arrays

Contains f0 values that are poloidally decomposed but don't need to be transferred between ranks during load rebalancing.

Kokkos::View<double**,Kokkos::LayoutRight, HostType> Plasma::f0_delta_n

Flux-surface averaged change of density.

Kokkos::View<double**,Kokkos::LayoutRight, HostType> Plasma::f0_delta_T

Flux-surface averaged change of temperature.

Kokkos::View<double**,Kokkos::LayoutRight, HostType> Plasma::f0_delta_u

Flux-surface averaged change of parallel flow.

View<double**,CLayout, HostType> Plasma::f0_den_global

Equilibrium density at vertices.

VGridDistribution<HostType> Plasma::f0_f0g
bool Plasma::f0_grid
private
View<double*,CLayout,HostType> Plasma::f0_node_cost
View<double**,CLayout, HostType> Plasma::f0_temp_global

Equilibrium temperature at vertices.

double Plasma::main_ion_characteristic_energy
private
int Plasma::n_nonadiabatic_species

Number of nonadiabatic species.

int Plasma::nspecies

Number of species including electrons.

bool Plasma::particles_d_has_owner
private

Whether a species owns the device particles allocation.

int Plasma::particles_d_owner
private

Which species, if any, owns the device particles allocation.

constexpr bool Plasma::reduced_deltaf = false
staticprivate

Equivalent to the preprocessor flag for now.

std::vector<std::string> Plasma::sp_names
bool Plasma::species_share_particles_d_ownership
private

Whether to use the device particles sharing scheme.


The documentation for this class was generated from the following files: