SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sirius::Simulation_context Class Reference

Simulation context is a set of parameters and objects describing a single simulation. More...

#include <simulation_context.hpp>

Inherits sirius::Simulation_parameters.

Public Member Functions

 Simulation_context (mpi::Communicator const &comm__=mpi::Communicator::world())
 Create an empty simulation context with an explicit communicator. More...
 
 Simulation_context (mpi::Communicator const &comm__, mpi::Communicator const &comm_k__, mpi::Communicator const &comm_band__)
 
 Simulation_context (std::string const &str__)
 Create a simulation context with world communicator and load parameters from JSON string or JSON file. More...
 
 Simulation_context (nlohmann::json const &dict__)
 
 Simulation_context (std::string const &str__, mpi::Communicator const &comm__)
 
 ~Simulation_context ()
 Destructor. More...
 
void initialize ()
 Initialize the similation (can only be called once). More...
 
void print_info (std::ostream &out__) const
 
void update ()
 Update context after setting new lattice vectors or atomic coordinates. More...
 
auto const & atoms_to_grid_idx_map (int ia__) const
 
auto & unit_cell ()
 
auto const & unit_cell () const
 Return const reference to unit cell object. More...
 
auto const & gvec () const
 Return const reference to Gvec object. More...
 
auto gvec_sptr () const
 Return shared pointer to Gvec object. More...
 
auto const & gvec_fft () const
 Return const reference to Gvec_fft object. More...
 
auto gvec_fft_sptr () const
 Return shared pointer to Gvec_fft object. More...
 
auto const & gvec_coarse () const
 
auto const & gvec_coarse_sptr () const
 
auto const & gvec_coarse_fft_sptr () const
 
auto const & remap_gvec () const
 
auto const & blacs_grid () const
 
mpi::Communicator const & comm () const
 Total communicator of the simulation. More...
 
auto const & comm_k () const
 Communicator between k-points. More...
 
auto const & comm_band () const
 Band parallelization communicator. More...
 
auto const & comm_fft () const
 Communicator of the dense FFT grid. More...
 
auto const & comm_ortho_fft () const
 
auto const & comm_fft_coarse () const
 Communicator of the coarse FFT grid. More...
 
auto const & comm_band_ortho_fft_coarse () const
 Communicator, which is orthogonal to comm_fft_coarse within a band communicator. More...
 
auto const & comm_ortho_fft_coarse () const
 
void create_storage_file (std::string name__) const
 
std::string const & start_time_tag () const
 
auto & std_evp_solver ()
 
auto const & std_evp_solver () const
 
auto & gen_evp_solver ()
 
auto const & gen_evp_solver () const
 
auto phase_factors_t (int igloc__, int iat__) const
 
auto const & phase_factors_t () const
 
auto gvec_phase_factor (r3::vector< int > G__, int ia__) const
 Phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \). More...
 
auto gvec_phase_factor (int ig__, int ia__) const
 Phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \). More...
 
auto const & gvec_coord () const
 
void generate_phase_factors (int iat__, sddk::mdarray< std::complex< double >, 2 > &phase_factors__) const
 Generate phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \) for all atoms of a given type. More...
 
double ewald_lambda () const
 Find the lambda parameter used in the Ewald summation. More...
 
auto const & sym_phase_factors () const
 
bool initialized () const
 
auto const & theta_pw (int ig__) const
 Return plane-wave coefficient of the step function. More...
 
double theta (int ir__) const
 Return the value of the step function for the grid point ir. More...
 
auto const & augmentation_op (int iat__) const
 Returns a constant pointer to the augmentation operator of a given atom type. More...
 
auto & augmentation_op (int iat__)
 
auto host_memory_t () const
 Type of the host memory for arrays used in linear algebra operations. More...
 
auto processing_unit_memory_t () const
 Return the memory type for processing unit. More...
 
void fft_grid_size (std::array< int, 3 > fft_grid_size__)
 Set the size of the fine-grained FFT grid. More...
 
template<typename T >
fft::spfft_grid_type< T > & spfft_grid_coarse ()
 
template<typename T >
fft::spfft_transform_type< T > & spfft ()
 
template<typename T >
fft::spfft_transform_type< T > const & spfft () const
 
template<typename T >
fft::spfft_transform_type< T > & spfft_coarse ()
 
template<typename T >
fft::spfft_transform_type< T > const & spfft_coarse () const
 
auto const & fft_grid () const
 
auto const & fft_coarse_grid () const
 
auto const & spla_context () const
 
auto & spla_context ()
 
double evp_work_count (double w__=0) const
 
int num_loc_op_applied (int n=0) const
 Keep track of the total number of wave-functions to which the local operator was applied. More...
 
int num_itsol_steps (int n=0) const
 
auto & cb ()
 
auto const & cb () const
 
auto & ri ()
 
auto const & ri () const
 
std::function< void(void)> band_occ_callback () const
 
std::function< void(void)> veff_callback () const
 
nlohmann::json serialize ()
 Export parameters of simulation context as a JSON dictionary. More...
 
std::ostream & out () const
 Return output stream. More...
 
std::ostream & out (int level__) const
 Return output stream based on the verbosity level. More...
 
rte::ostream out (int level__, const char *label__) const
 
void message (int level__, char const *label__, std::stringstream const &s) const
 Print message from the stringstream. More...
 
void set_periodic_function_ptr (std::string label__, periodic_function_ptr_t< double > ptr__)
 
auto periodic_function_ptr (std::string label__) const
 
template<>
spfft::Transform & spfft ()
 
template<>
spfft::Transform const & spfft () const
 
template<>
spfft::Transform & spfft_coarse ()
 
template<>
spfft::Transform const & spfft_coarse () const
 
template<>
spfft::Grid & spfft_grid_coarse ()
 
- Public Member Functions inherited from sirius::Simulation_parameters
Configcfg ()
 
Config const & cfg () const
 
void import (std::string const &str__)
 Import parameters from a file or a serialized json string. More...
 
void import (nlohmann::json const &dict__)
 Import parameters from a json dictionary. More...
 
void import (cmd_args const &args__)
 Import from command line arguments. More...
 
void lmax_apw (int lmax_apw__)
 
void lmax_rho (int lmax_rho__)
 
void lmax_pot (int lmax_pot__)
 
void set_num_mag_dims (int num_mag_dims__)
 
void set_hubbard_correction (bool hubbard_correction__)
 
bool gamma_point (bool gamma_point__)
 Set flag for Gamma-point calculation. More...
 
std::vector< int > mpi_grid_dims (std::vector< int > mpi_grid_dims__)
 Set dimensions of MPI grid for band diagonalization problem. More...
 
void add_xc_functional (std::string name__)
 
void electronic_structure_method (std::string name__)
 
auto electronic_structure_method () const
 
void core_relativity (std::string name__)
 Set core relativity for the LAPW method. More...
 
void valence_relativity (std::string name__)
 Set valence relativity for the LAPW method. More...
 
void processing_unit (std::string name__)
 
void smearing (std::string name__)
 
auto smearing () const
 
void molecule (bool molecule__)
 
auto verbosity () const
 
int verbosity (int level__)
 Set verbosity level. More...
 
int lmax_rho () const
 
int lmmax_rho () const
 
int lmax_pot () const
 
int lmmax_pot () const
 
double aw_cutoff () const
 
double aw_cutoff (double aw_cutoff__)
 
double pw_cutoff () const
 Plane-wave cutoff for G-vectors (in 1/[a.u.]). More...
 
double pw_cutoff (double pw_cutoff__)
 Set plane-wave cutoff. More...
 
double gk_cutoff () const
 Cutoff for G+k vectors (in 1/[a.u.]). More...
 
double gk_cutoff (double gk_cutoff__)
 Set the cutoff for G+k vectors. More...
 
int num_mag_dims () const
 Number of dimensions in the magnetization vector. More...
 
int num_spins () const
 Number of spin components. More...
 
int num_mag_comp () const
 Number of components in the complex density matrix. More...
 
int num_spinor_comp () const
 Number of non-zero spinor components. More...
 
int num_spinors () const
 Number of spinor wave-functions labeled by a sinlge band index. More...
 
int num_fv_states (int num_fv_states__)
 Set the number of first-variational states. More...
 
int num_fv_states () const
 Number of first-variational states. More...
 
int num_bands (int num_bands__)
 Set the number of bands. More...
 
int num_bands () const
 Total number of bands. More...
 
int max_occupancy () const
 Maximum band occupancy. More...
 
double min_occupancy () const
 Minimum occupancy to consider band to be occupied. More...
 
double min_occupancy (double val__)
 Set minimum occupancy. More...
 
bool so_correction () const
 
bool so_correction (bool so_correction__)
 
bool hubbard_correction () const
 
bool gamma_point () const
 
sddk::device_t processing_unit () const
 
double smearing_width () const
 
double smearing_width (double smearing_width__)
 
void set_auto_rmt (int auto_rmt__)
 
int auto_rmt () const
 
bool need_sv () const
 
std::vector< int > mpi_grid_dims () const
 
int cyclic_block_size () const
 
bool full_potential () const
 
std::vector< std::string > xc_functionals () const
 
std::string std_evp_solver_name () const
 Get the name of the standard eigen-value solver to use. More...
 
std::string std_evp_solver_name (std::string name__)
 Set the name of the standard eigen-value solver to use. More...
 
std::string gen_evp_solver_name () const
 Get the name of the generalized eigen-value solver to use. More...
 
std::string gen_evp_solver_name (std::string name__)
 Set the name of the generalized eigen-value solver to use. More...
 
relativity_t valence_relativity () const
 
relativity_t core_relativity () const
 
double rmt_max () const
 
double spglib_tolerance () const
 
bool molecule () const
 
bool use_symmetry () const
 Get a use_symmetry flag. More...
 
bool use_symmetry (bool use_symmetry__)
 Set a use_symmetry flag. More...
 
std::string iterative_solver_type (std::string type__)
 
double empty_states_tolerance (double tolerance__)
 Set the tolerance for empty states. More...
 
int sht_coverage (int sht_coverage__)
 Set the variable which controls the type of sperical coverage. More...
 

Private Member Functions

void init_fft_grid ()
 Initialize FFT coarse and fine grids. More...
 
void init_comm ()
 Initialize communicators. More...
 
void init_atoms_to_grid_idx (double R__)
 Find a list of real-space grid points around each atom. More...
 
void init_common ()
 Common init function called by all constructors. More...
 
 Simulation_context (Simulation_context const &)=delete
 

Private Attributes

mpi::Communicator const & comm_
 Communicator for this simulation. More...
 
mpi::Communicator comm_k_
 
mpi::Communicator comm_band_
 
mpi::Communicator comm_ortho_fft_coarse_
 Auxiliary communicator for the coarse-grid FFT transformation. More...
 
std::unique_ptr< Unit_cellunit_cell_
 Unit cell of the simulation. More...
 
std::unique_ptr< mpi::Gridmpi_grid_
 MPI grid for this simulation. More...
 
std::unique_ptr< la::BLACS_gridblacs_grid_
 2D BLACS grid for distributed linear algebra operations. More...
 
fft::Grid fft_grid_
 Grid descriptor for the fine-grained FFT transform. More...
 
std::unique_ptr< spfft::Transform > spfft_transform_
 Fine-grained FFT for density and potential. More...
 
std::unique_ptr< spfft::Grid > spfft_grid_
 
fft::Grid fft_coarse_grid_
 Grid descriptor for the coarse-grained FFT transform. More...
 
std::unique_ptr< spfft::Transform > spfft_transform_coarse_
 Coarse-grained FFT for application of local potential and density summation. More...
 
std::unique_ptr< spfft::Grid > spfft_grid_coarse_
 
std::shared_ptr< fft::Gvecgvec_
 G-vectors within the Gmax cutoff. More...
 
std::shared_ptr< fft::Gvec_fftgvec_fft_
 
std::shared_ptr< fft::Gvecgvec_coarse_
 G-vectors within the 2 * |Gmax^{WF}| cutoff. More...
 
std::shared_ptr< fft::Gvec_fftgvec_coarse_fft_
 
std::shared_ptr< fft::Gvec_shellsremap_gvec_
 
timeval start_time_
 Creation time of the parameters. More...
 
std::string start_time_tag_
 A tag string based on the the starting time. More...
 
sddk::mdarray< std::complex< double >, 3 > phase_factors_
 1D phase factors for each atom coordinate and G-vector index. More...
 
sddk::mdarray< std::complex< double >, 3 > sym_phase_factors_
 1D phase factors of the symmetry operations. More...
 
sddk::mdarray< std::complex< double >, 2 > phase_factors_t_
 Phase factors for atom types. More...
 
sddk::mdarray< int, 2 > gvec_coord_
 Lattice coordinats of G-vectors in a GPU-friendly ordering. More...
 
double omega0_
 Volume of the initial unit cell. More...
 
r3::matrix< double > lattice_vectors0_
 Initial lattice vectors. More...
 
std::vector< std::vector< std::pair< int, double > > > atoms_to_grid_idx_
 List of real-space point indices for each of the atoms. More...
 
step_function_t theta_
 Step function in real-space and reciprocal domains. More...
 
std::vector< std::unique_ptr< Augmentation_operator > > augmentation_op_
 Augmentation operator for each atom type. More...
 
std::unique_ptr< la::Eigensolverstd_evp_solver_
 Standard eigen-value problem solver. More...
 
std::unique_ptr< la::Eigensolvergen_evp_solver_
 Generalized eigen-value problem solver. More...
 
sddk::memory_t host_memory_t_ {sddk::memory_t::none}
 Type of host memory (pagable or page-locked) for the arrays that participate in host-to-device memory copy. More...
 
std::shared_ptr<::spla::Context > spla_ctx_ {new ::spla::Context{SPLA_PU_HOST}}
 SPLA library context. More...
 
std::ostream * output_stream_ {nullptr}
 
std::ofstream output_file_stream_
 
std::map< std::string, periodic_function_ptr_t< double > > pf_ext_ptr
 External pointers to periodic functions. More...
 
callback_functions_t cb_
 Stores all callback functions. More...
 
radial_integrals_t ri_
 Stores all radial integrals. More...
 
double evp_work_count_ {0}
 
int num_loc_op_applied_ {0}
 
int num_itsol_steps_ {0}
 Total number of iterative solver steps. More...
 
bool initialized_ {false}
 True if the context is already initialized. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sirius::Simulation_parameters
 Simulation_parameters (Simulation_parameters const &)=delete
 
- Protected Attributes inherited from sirius::Simulation_parameters
sddk::device_t processing_unit_ {sddk::device_t::CPU}
 Type of the processing unit. More...
 
relativity_t valence_relativity_ {relativity_t::zora}
 Type of relativity for valence states. More...
 
relativity_t core_relativity_ {relativity_t::dirac}
 Type of relativity for core states. More...
 
electronic_structure_method_t electronic_structure_method_ {electronic_structure_method_t::full_potential_lapwlo}
 Type of electronic structure method. More...
 
smearing::smearing_t smearing_ {smearing::smearing_t::gaussian}
 Type of occupation numbers smearing. More...
 

Detailed Description

Simulation context is a set of parameters and objects describing a single simulation.

The order of initialization of the simulation context is the following: first, the default parameter values are set in the constructor, then (optionally) import() method is called and the parameters are overwritten with the those from the input file, and finally, the user sets the values with setter metods. Then the unit cell can be populated and the context can be initialized.

Definition at line 182 of file simulation_context.hpp.

Constructor & Destructor Documentation

◆ Simulation_context() [1/5]

sirius::Simulation_context::Simulation_context ( mpi::Communicator const &  comm__ = mpi::Communicator::world())
inline

Create an empty simulation context with an explicit communicator.

Definition at line 331 of file simulation_context.hpp.

◆ Simulation_context() [2/5]

sirius::Simulation_context::Simulation_context ( mpi::Communicator const &  comm__,
mpi::Communicator const &  comm_k__,
mpi::Communicator const &  comm_band__ 
)
inline

Definition at line 337 of file simulation_context.hpp.

◆ Simulation_context() [3/5]

sirius::Simulation_context::Simulation_context ( std::string const &  str__)
inline

Create a simulation context with world communicator and load parameters from JSON string or JSON file.

Definition at line 346 of file simulation_context.hpp.

◆ Simulation_context() [4/5]

sirius::Simulation_context::Simulation_context ( nlohmann::json const &  dict__)
inlineexplicit

Definition at line 354 of file simulation_context.hpp.

◆ Simulation_context() [5/5]

sirius::Simulation_context::Simulation_context ( std::string const &  str__,
mpi::Communicator const &  comm__ 
)
inline

Definition at line 363 of file simulation_context.hpp.

◆ ~Simulation_context()

sirius::Simulation_context::~Simulation_context ( )
inline

Destructor.

Definition at line 372 of file simulation_context.hpp.

Member Function Documentation

◆ init_fft_grid()

void sirius::Simulation_context::init_fft_grid ( )
private

Initialize FFT coarse and fine grids.

Definition at line 103 of file simulation_context.cpp.

◆ init_comm()

void sirius::Simulation_context::init_comm ( )
private

Initialize communicators.

Definition at line 1284 of file simulation_context.cpp.

◆ init_atoms_to_grid_idx()

void sirius::Simulation_context::init_atoms_to_grid_idx ( double  R__)
private

Find a list of real-space grid points around each atom.

Definition at line 1207 of file simulation_context.cpp.

◆ init_common()

void sirius::Simulation_context::init_common ( )
inlineprivate

Common init function called by all constructors.

Definition at line 316 of file simulation_context.hpp.

◆ initialize()

void sirius::Simulation_context::initialize ( )

Initialize the similation (can only be called once).

Definition at line 151 of file simulation_context.cpp.

◆ print_info()

void sirius::Simulation_context::print_info ( std::ostream &  out__) const

Definition at line 522 of file simulation_context.cpp.

◆ update()

void sirius::Simulation_context::update ( )

Update context after setting new lattice vectors or atomic coordinates.

The update of the lattice vectors or atomic positions has an impact on many quantities which have to be recomputed in the correct order. First, the unit cell is updated and the new reciprocal lattice vectors are obtained. Then the G-vectors are computed (if this is the first call to update()) or recomputed with a new reciprocal lattice, but without rebuilding a new list. On the first call the spfft objects are created after G-vectors.

Definition at line 817 of file simulation_context.cpp.

◆ atoms_to_grid_idx_map()

auto const & sirius::Simulation_context::atoms_to_grid_idx_map ( int  ia__) const
inline

Definition at line 387 of file simulation_context.hpp.

◆ unit_cell() [1/2]

auto & sirius::Simulation_context::unit_cell ( )
inline

Definition at line 392 of file simulation_context.hpp.

◆ unit_cell() [2/2]

auto const & sirius::Simulation_context::unit_cell ( ) const
inline

Return const reference to unit cell object.

Definition at line 398 of file simulation_context.hpp.

◆ gvec()

auto const & sirius::Simulation_context::gvec ( ) const
inline

Return const reference to Gvec object.

Definition at line 404 of file simulation_context.hpp.

◆ gvec_sptr()

auto sirius::Simulation_context::gvec_sptr ( ) const
inline

Return shared pointer to Gvec object.

Definition at line 410 of file simulation_context.hpp.

◆ gvec_fft()

auto const & sirius::Simulation_context::gvec_fft ( ) const
inline

Return const reference to Gvec_fft object.

Definition at line 416 of file simulation_context.hpp.

◆ gvec_fft_sptr()

auto sirius::Simulation_context::gvec_fft_sptr ( ) const
inline

Return shared pointer to Gvec_fft object.

Definition at line 422 of file simulation_context.hpp.

◆ gvec_coarse()

auto const & sirius::Simulation_context::gvec_coarse ( ) const
inline

Definition at line 427 of file simulation_context.hpp.

◆ gvec_coarse_sptr()

auto const & sirius::Simulation_context::gvec_coarse_sptr ( ) const
inline

Definition at line 432 of file simulation_context.hpp.

◆ gvec_coarse_fft_sptr()

auto const & sirius::Simulation_context::gvec_coarse_fft_sptr ( ) const
inline

Definition at line 437 of file simulation_context.hpp.

◆ remap_gvec()

auto const & sirius::Simulation_context::remap_gvec ( ) const
inline

Definition at line 442 of file simulation_context.hpp.

◆ blacs_grid()

auto const & sirius::Simulation_context::blacs_grid ( ) const
inline

Definition at line 447 of file simulation_context.hpp.

◆ comm()

mpi::Communicator const & sirius::Simulation_context::comm ( ) const
inline

Total communicator of the simulation.

Definition at line 453 of file simulation_context.hpp.

◆ comm_k()

auto const & sirius::Simulation_context::comm_k ( ) const
inline

Communicator between k-points.

This communicator is used to split k-points

Definition at line 460 of file simulation_context.hpp.

◆ comm_band()

auto const & sirius::Simulation_context::comm_band ( ) const
inline

Band parallelization communicator.

This communicator is used to parallelize the band problem. However it is not necessarily used to create the BLACS grid. Diagonalization might be sequential.

Definition at line 468 of file simulation_context.hpp.

◆ comm_fft()

auto const & sirius::Simulation_context::comm_fft ( ) const
inline

Communicator of the dense FFT grid.

This communicator is passed to the spfft::Transform constructor.

Definition at line 475 of file simulation_context.hpp.

◆ comm_ortho_fft()

auto const & sirius::Simulation_context::comm_ortho_fft ( ) const
inline

Definition at line 481 of file simulation_context.hpp.

◆ comm_fft_coarse()

auto const & sirius::Simulation_context::comm_fft_coarse ( ) const
inline

Communicator of the coarse FFT grid.

This communicator is passed to the spfft::Transform constructor.

Definition at line 488 of file simulation_context.hpp.

◆ comm_band_ortho_fft_coarse()

auto const & sirius::Simulation_context::comm_band_ortho_fft_coarse ( ) const
inline

Communicator, which is orthogonal to comm_fft_coarse within a band communicator.

This communicator is used in reshuffling the wave-functions for the FFT-friendly distribution. It will be used to parallelize application of local Hamiltonian over bands.

Definition at line 500 of file simulation_context.hpp.

◆ comm_ortho_fft_coarse()

auto const & sirius::Simulation_context::comm_ortho_fft_coarse ( ) const
inline

Definition at line 509 of file simulation_context.hpp.

◆ create_storage_file()

void sirius::Simulation_context::create_storage_file ( std::string  name__) const

Definition at line 1138 of file simulation_context.cpp.

◆ start_time_tag()

std::string const & sirius::Simulation_context::start_time_tag ( ) const
inline

Definition at line 516 of file simulation_context.hpp.

◆ std_evp_solver() [1/2]

auto & sirius::Simulation_context::std_evp_solver ( )
inline

Definition at line 521 of file simulation_context.hpp.

◆ std_evp_solver() [2/2]

auto const & sirius::Simulation_context::std_evp_solver ( ) const
inline

Definition at line 526 of file simulation_context.hpp.

◆ gen_evp_solver() [1/2]

auto & sirius::Simulation_context::gen_evp_solver ( )
inline

Definition at line 531 of file simulation_context.hpp.

◆ gen_evp_solver() [2/2]

auto const & sirius::Simulation_context::gen_evp_solver ( ) const
inline

Definition at line 536 of file simulation_context.hpp.

◆ phase_factors_t() [1/2]

auto sirius::Simulation_context::phase_factors_t ( int  igloc__,
int  iat__ 
) const
inline

Definition at line 541 of file simulation_context.hpp.

◆ phase_factors_t() [2/2]

auto const & sirius::Simulation_context::phase_factors_t ( ) const
inline

Definition at line 546 of file simulation_context.hpp.

◆ gvec_phase_factor() [1/2]

auto sirius::Simulation_context::gvec_phase_factor ( r3::vector< int >  G__,
int  ia__ 
) const
inline

Phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \).

Definition at line 552 of file simulation_context.hpp.

◆ gvec_phase_factor() [2/2]

auto sirius::Simulation_context::gvec_phase_factor ( int  ig__,
int  ia__ 
) const
inline

Phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \).

Definition at line 558 of file simulation_context.hpp.

◆ gvec_coord()

auto const & sirius::Simulation_context::gvec_coord ( ) const
inline

Definition at line 563 of file simulation_context.hpp.

◆ generate_phase_factors()

void sirius::Simulation_context::generate_phase_factors ( int  iat__,
sddk::mdarray< std::complex< double >, 2 > &  phase_factors__ 
) const

Generate phase factors \( e^{i {\bf G} {\bf r}_{\alpha}} \) for all atoms of a given type.

Definition at line 1179 of file simulation_context.cpp.

◆ ewald_lambda()

double sirius::Simulation_context::ewald_lambda ( ) const

Find the lambda parameter used in the Ewald summation.

Lambda parameter scales the erfc function argument:

\[ {\rm erf}(\sqrt{\lambda}x) \]

Definition at line 127 of file simulation_context.cpp.

◆ sym_phase_factors()

auto const & sirius::Simulation_context::sym_phase_factors ( ) const
inline

Definition at line 579 of file simulation_context.hpp.

◆ initialized()

bool sirius::Simulation_context::initialized ( ) const
inline

Definition at line 584 of file simulation_context.hpp.

◆ theta_pw()

auto const & sirius::Simulation_context::theta_pw ( int  ig__) const
inline

Return plane-wave coefficient of the step function.

Definition at line 590 of file simulation_context.hpp.

◆ theta()

double sirius::Simulation_context::theta ( int  ir__) const
inline

Return the value of the step function for the grid point ir.

Definition at line 596 of file simulation_context.hpp.

◆ augmentation_op() [1/2]

auto const & sirius::Simulation_context::augmentation_op ( int  iat__) const
inline

Returns a constant pointer to the augmentation operator of a given atom type.

Definition at line 602 of file simulation_context.hpp.

◆ augmentation_op() [2/2]

auto & sirius::Simulation_context::augmentation_op ( int  iat__)
inline

Definition at line 608 of file simulation_context.hpp.

◆ host_memory_t()

auto sirius::Simulation_context::host_memory_t ( ) const
inline

Type of the host memory for arrays used in linear algebra operations.

For CPU execution this is normal host memory, for GPU execution this is pinned memory.

Definition at line 616 of file simulation_context.hpp.

◆ processing_unit_memory_t()

auto sirius::Simulation_context::processing_unit_memory_t ( ) const
inline

Return the memory type for processing unit.

Definition at line 622 of file simulation_context.hpp.

◆ fft_grid_size()

void sirius::Simulation_context::fft_grid_size ( std::array< int, 3 >  fft_grid_size__)
inline

Set the size of the fine-grained FFT grid.

Definition at line 628 of file simulation_context.hpp.

◆ fft_grid()

auto const & sirius::Simulation_context::fft_grid ( ) const
inline

Definition at line 648 of file simulation_context.hpp.

◆ fft_coarse_grid()

auto const & sirius::Simulation_context::fft_coarse_grid ( ) const
inline

Definition at line 653 of file simulation_context.hpp.

◆ spla_context() [1/2]

auto const & sirius::Simulation_context::spla_context ( ) const
inline

Definition at line 658 of file simulation_context.hpp.

◆ spla_context() [2/2]

auto & sirius::Simulation_context::spla_context ( )
inline

Definition at line 663 of file simulation_context.hpp.

◆ evp_work_count()

double sirius::Simulation_context::evp_work_count ( double  w__ = 0) const
inline

Definition at line 668 of file simulation_context.hpp.

◆ num_loc_op_applied()

int sirius::Simulation_context::num_loc_op_applied ( int  n = 0) const
inline

Keep track of the total number of wave-functions to which the local operator was applied.

Definition at line 675 of file simulation_context.hpp.

◆ num_itsol_steps()

int sirius::Simulation_context::num_itsol_steps ( int  n = 0) const
inline

Definition at line 681 of file simulation_context.hpp.

◆ cb() [1/2]

auto & sirius::Simulation_context::cb ( )
inline

Definition at line 687 of file simulation_context.hpp.

◆ cb() [2/2]

auto const & sirius::Simulation_context::cb ( ) const
inline

Definition at line 692 of file simulation_context.hpp.

◆ ri() [1/2]

auto & sirius::Simulation_context::ri ( )
inline

Definition at line 697 of file simulation_context.hpp.

◆ ri() [2/2]

auto const & sirius::Simulation_context::ri ( ) const
inline

Definition at line 702 of file simulation_context.hpp.

◆ band_occ_callback()

std::function< void(void)> sirius::Simulation_context::band_occ_callback ( ) const
inline

Definition at line 707 of file simulation_context.hpp.

◆ veff_callback()

std::function< void(void)> sirius::Simulation_context::veff_callback ( ) const
inline

Definition at line 712 of file simulation_context.hpp.

◆ serialize()

nlohmann::json sirius::Simulation_context::serialize ( )
inline

Export parameters of simulation context as a JSON dictionary.

Definition at line 718 of file simulation_context.hpp.

◆ out() [1/3]

std::ostream & sirius::Simulation_context::out ( ) const
inline

Return output stream.

Definition at line 735 of file simulation_context.hpp.

◆ out() [2/3]

std::ostream & sirius::Simulation_context::out ( int  level__) const
inline

Return output stream based on the verbosity level.

Definition at line 742 of file simulation_context.hpp.

◆ out() [3/3]

rte::ostream sirius::Simulation_context::out ( int  level__,
const char *  label__ 
) const
inline

Definition at line 751 of file simulation_context.hpp.

◆ message()

void sirius::Simulation_context::message ( int  level__,
char const *  label__,
std::stringstream const &  s 
) const
inline

Print message from the stringstream.

Definition at line 761 of file simulation_context.hpp.

◆ set_periodic_function_ptr()

void sirius::Simulation_context::set_periodic_function_ptr ( std::string  label__,
periodic_function_ptr_t< double >  ptr__ 
)
inline

Definition at line 771 of file simulation_context.hpp.

◆ periodic_function_ptr()

auto sirius::Simulation_context::periodic_function_ptr ( std::string  label__) const
inline

Definition at line 776 of file simulation_context.hpp.

◆ spfft() [1/2]

template<>
spfft::Transform & sirius::Simulation_context::spfft ( )

Definition at line 41 of file simulation_context.cpp.

◆ spfft() [2/2]

template<>
spfft::Transform const & sirius::Simulation_context::spfft ( ) const

Definition at line 47 of file simulation_context.cpp.

◆ spfft_coarse() [1/2]

template<>
spfft::Transform & sirius::Simulation_context::spfft_coarse ( )

Definition at line 53 of file simulation_context.cpp.

◆ spfft_coarse() [2/2]

template<>
spfft::Transform const & sirius::Simulation_context::spfft_coarse ( ) const

Definition at line 59 of file simulation_context.cpp.

◆ spfft_grid_coarse()

template<>
spfft::Grid & sirius::Simulation_context::spfft_grid_coarse ( )

Definition at line 65 of file simulation_context.cpp.

Member Data Documentation

◆ comm_

mpi::Communicator const& sirius::Simulation_context::comm_
private

Communicator for this simulation.

Definition at line 186 of file simulation_context.hpp.

◆ comm_k_

mpi::Communicator sirius::Simulation_context::comm_k_
private

Definition at line 188 of file simulation_context.hpp.

◆ comm_band_

mpi::Communicator sirius::Simulation_context::comm_band_
private

Definition at line 189 of file simulation_context.hpp.

◆ comm_ortho_fft_coarse_

mpi::Communicator sirius::Simulation_context::comm_ortho_fft_coarse_
private

Auxiliary communicator for the coarse-grid FFT transformation.

Definition at line 192 of file simulation_context.hpp.

◆ unit_cell_

std::unique_ptr<Unit_cell> sirius::Simulation_context::unit_cell_
private

Unit cell of the simulation.

Definition at line 195 of file simulation_context.hpp.

◆ mpi_grid_

std::unique_ptr<mpi::Grid> sirius::Simulation_context::mpi_grid_
private

MPI grid for this simulation.

Definition at line 198 of file simulation_context.hpp.

◆ blacs_grid_

std::unique_ptr<la::BLACS_grid> sirius::Simulation_context::blacs_grid_
private

2D BLACS grid for distributed linear algebra operations.

Definition at line 201 of file simulation_context.hpp.

◆ fft_grid_

fft::Grid sirius::Simulation_context::fft_grid_
private

Grid descriptor for the fine-grained FFT transform.

Definition at line 204 of file simulation_context.hpp.

◆ spfft_transform_

std::unique_ptr<spfft::Transform> sirius::Simulation_context::spfft_transform_
private

Fine-grained FFT for density and potential.

This is the FFT driver to transform periodic functions such as density and potential on the fine-grained FFT grid. The transformation is parallel.

Definition at line 209 of file simulation_context.hpp.

◆ spfft_grid_

std::unique_ptr<spfft::Grid> sirius::Simulation_context::spfft_grid_
private

Definition at line 210 of file simulation_context.hpp.

◆ fft_coarse_grid_

fft::Grid sirius::Simulation_context::fft_coarse_grid_
private

Grid descriptor for the coarse-grained FFT transform.

Definition at line 217 of file simulation_context.hpp.

◆ spfft_transform_coarse_

std::unique_ptr<spfft::Transform> sirius::Simulation_context::spfft_transform_coarse_
private

Coarse-grained FFT for application of local potential and density summation.

Definition at line 220 of file simulation_context.hpp.

◆ spfft_grid_coarse_

std::unique_ptr<spfft::Grid> sirius::Simulation_context::spfft_grid_coarse_
private

Definition at line 221 of file simulation_context.hpp.

◆ gvec_

std::shared_ptr<fft::Gvec> sirius::Simulation_context::gvec_
private

G-vectors within the Gmax cutoff.

Definition at line 228 of file simulation_context.hpp.

◆ gvec_fft_

std::shared_ptr<fft::Gvec_fft> sirius::Simulation_context::gvec_fft_
private

Definition at line 230 of file simulation_context.hpp.

◆ gvec_coarse_

std::shared_ptr<fft::Gvec> sirius::Simulation_context::gvec_coarse_
private

G-vectors within the 2 * |Gmax^{WF}| cutoff.

Definition at line 233 of file simulation_context.hpp.

◆ gvec_coarse_fft_

std::shared_ptr<fft::Gvec_fft> sirius::Simulation_context::gvec_coarse_fft_
private

Definition at line 235 of file simulation_context.hpp.

◆ remap_gvec_

std::shared_ptr<fft::Gvec_shells> sirius::Simulation_context::remap_gvec_
private

Definition at line 237 of file simulation_context.hpp.

◆ start_time_

timeval sirius::Simulation_context::start_time_
private

Creation time of the parameters.

Definition at line 240 of file simulation_context.hpp.

◆ start_time_tag_

std::string sirius::Simulation_context::start_time_tag_
private

A tag string based on the the starting time.

Definition at line 243 of file simulation_context.hpp.

◆ phase_factors_

sddk::mdarray<std::complex<double>, 3> sirius::Simulation_context::phase_factors_
private

1D phase factors for each atom coordinate and G-vector index.

Definition at line 246 of file simulation_context.hpp.

◆ sym_phase_factors_

sddk::mdarray<std::complex<double>, 3> sirius::Simulation_context::sym_phase_factors_
private

1D phase factors of the symmetry operations.

Definition at line 249 of file simulation_context.hpp.

◆ phase_factors_t_

sddk::mdarray<std::complex<double>, 2> sirius::Simulation_context::phase_factors_t_
private

Phase factors for atom types.

Definition at line 252 of file simulation_context.hpp.

◆ gvec_coord_

sddk::mdarray<int, 2> sirius::Simulation_context::gvec_coord_
private

Lattice coordinats of G-vectors in a GPU-friendly ordering.

Definition at line 255 of file simulation_context.hpp.

◆ omega0_

double sirius::Simulation_context::omega0_
private

Volume of the initial unit cell.

This is needed to estimate the new cutoff for radial integrals.

Definition at line 259 of file simulation_context.hpp.

◆ lattice_vectors0_

r3::matrix<double> sirius::Simulation_context::lattice_vectors0_
private

Initial lattice vectors.

Definition at line 262 of file simulation_context.hpp.

◆ atoms_to_grid_idx_

std::vector<std::vector<std::pair<int, double> > > sirius::Simulation_context::atoms_to_grid_idx_
private

List of real-space point indices for each of the atoms.

Definition at line 265 of file simulation_context.hpp.

◆ theta_

step_function_t sirius::Simulation_context::theta_
private

Step function in real-space and reciprocal domains.

Definition at line 268 of file simulation_context.hpp.

◆ augmentation_op_

std::vector<std::unique_ptr<Augmentation_operator> > sirius::Simulation_context::augmentation_op_
private

Augmentation operator for each atom type.

The augmentation operator is used by Density, Potential, Q_operator, and Non_local_functor classes.

Definition at line 272 of file simulation_context.hpp.

◆ std_evp_solver_

std::unique_ptr<la::Eigensolver> sirius::Simulation_context::std_evp_solver_
private

Standard eigen-value problem solver.

Definition at line 275 of file simulation_context.hpp.

◆ gen_evp_solver_

std::unique_ptr<la::Eigensolver> sirius::Simulation_context::gen_evp_solver_
private

Generalized eigen-value problem solver.

Definition at line 278 of file simulation_context.hpp.

◆ host_memory_t_

sddk::memory_t sirius::Simulation_context::host_memory_t_ {sddk::memory_t::none}
private

Type of host memory (pagable or page-locked) for the arrays that participate in host-to-device memory copy.

Definition at line 281 of file simulation_context.hpp.

◆ spla_ctx_

std::shared_ptr<::spla::Context> sirius::Simulation_context::spla_ctx_ {new ::spla::Context{SPLA_PU_HOST}}
private

SPLA library context.

Definition at line 284 of file simulation_context.hpp.

◆ output_stream_

std::ostream* sirius::Simulation_context::output_stream_ {nullptr}
private

Definition at line 286 of file simulation_context.hpp.

◆ output_file_stream_

std::ofstream sirius::Simulation_context::output_file_stream_
private

Definition at line 287 of file simulation_context.hpp.

◆ pf_ext_ptr

std::map<std::string, periodic_function_ptr_t<double> > sirius::Simulation_context::pf_ext_ptr
private

External pointers to periodic functions.

Definition at line 290 of file simulation_context.hpp.

◆ cb_

callback_functions_t sirius::Simulation_context::cb_
private

Stores all callback functions.

Definition at line 293 of file simulation_context.hpp.

◆ ri_

radial_integrals_t sirius::Simulation_context::ri_
private

Stores all radial integrals.

Definition at line 296 of file simulation_context.hpp.

◆ evp_work_count_

double sirius::Simulation_context::evp_work_count_ {0}
mutableprivate

Definition at line 298 of file simulation_context.hpp.

◆ num_loc_op_applied_

int sirius::Simulation_context::num_loc_op_applied_ {0}
mutableprivate

Definition at line 299 of file simulation_context.hpp.

◆ num_itsol_steps_

int sirius::Simulation_context::num_itsol_steps_ {0}
mutableprivate

Total number of iterative solver steps.

Definition at line 301 of file simulation_context.hpp.

◆ initialized_

bool sirius::Simulation_context::initialized_ {false}
private

True if the context is already initialized.

Definition at line 304 of file simulation_context.hpp.


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