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)
 
template<typename F >
bool true_for_some_species (F func) const
 
template<typename F >
bool true_for_all_species (F func) const
 
bool electrons_are_adiabatic () const
 
bool f0_grid () const
 
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)
 
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, int version)
 
double get_main_ion_toroidal_transit_time (const MagneticField< DeviceType > &magnetic_field) const
 
void read_initial_distribution_all (NLReader::NamelistReader &nlr, const DomainDecomposition< DeviceType > &pol_decomp)
 

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...
 
View< double **, CLayout,
HostType
f0_delta_n
 Flux-surface averaged change of density. More...
 
View< double **, CLayout,
HostType
f0_delta_u
 Flux-surface averaged change of parallel flow. More...
 
View< double **, CLayout,
HostType
f0_delta_T
 Flux-surface averaged change of temperature. More...
 
View< double *, CLayout, HostTypespitzer_resistivity
 
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 initialize_spitzer_res ()
 
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...
 
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:

bool Plasma::electrons_are_adiabatic ( ) const
inline
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:

bool Plasma::f0_grid ( ) const
inline

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:

void Plasma::initialize_spitzer_res ( )
private

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,
int  version 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Plasma::read_initial_distribution_all ( NLReader::NamelistReader nlr,
const DomainDecomposition< DeviceType > &  pol_decomp 
)
inline

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
template<typename F >
bool Plasma::true_for_all_species ( func) const
inline

Here is the caller graph for this function:

template<typename F >
bool Plasma::true_for_some_species ( func) const
inline

Here is the caller graph for this function:

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 
)

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.

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

Flux-surface averaged change of density.

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

Flux-surface averaged change of temperature.

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

Flux-surface averaged change of parallel flow.

VGridDistribution<HostType> Plasma::f0_f0g
View<double*,CLayout,HostType> Plasma::f0_node_cost
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.

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

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