ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleIO::ReadInput Class Reference

#include <read_input.h>

Collaboration diagram for ModuleIO::ReadInput:

Public Member Functions

 ReadInput (const int &rank)
 ~ReadInput ()
void clear ()
 clear all input items
const std::vector< std::pair< std::string, Input_Item > > & get_input_lists () const
 Get all registered input items (for help system).
void read_parameters (Parameter &param, const std::string &filename_in)
 read in parameters from input file
void create_directory (const Parameter &param)
 Create a directory for output files.
void write_parameters (const Parameter &param, const std::string &filename_out)
 write out parameters to output file

Public Attributes

bool check_ntype_flag = true
 check ntype from STRU file

Static Public Attributes

static bool check_mode = false

Private Member Functions

std::string read_txt_input (Parameter &param, const std::string &filename)
 read INPUT file of txt format
std::string prepare_input (Parameter &param)
void normalize_hs_output_options (Parameter &param)
 Resolve the primary H/S output options and their legacy aliases.
void normalize_occ_mat_options (Parameter &param)
 Resolve init_occ_mat and its legacy alias omc.
void normalize_out_eband_alias (Parameter &param)
 Resolve out_eband and its legacy alias out_eband_terms.
void normalize_td_output_frequency (Parameter &param)
 Resolve out_freq_td, the legacy RT-TDDFT alias of out_freq_ion.
void write_txt_input (const Parameter &param, const std::string &filename)
 write INPUT file of txt format
int current_md_step (const std::string &file_dir)
 determine the md step in restart case
void check_ntype (const std::string &fn, int &param_ntype)
 count_nype from STRU file
void add_item (const Input_Item &item)
 add item to input list
void set_global_dir (const Input_para &inp, System_para &sys)
 set System_para according to input parameters INPUT and STRU need to refer to each other in ABACUS, so it is necessary to obtain the file paths related to all inputs
void set_globalv (const Input_para &inp, System_para &sys)
void item_system ()
void item_elec_stru ()
void item_lcao ()
void item_relax ()
void item_md ()
void item_ofdft ()
void item_sdft ()
void item_deepks ()
void item_rt_tddft ()
void item_tdofdft ()
void item_lr_tddft ()
void item_bse ()
void item_dfpt ()
void item_output ()
void item_postprocess ()
void item_model ()
void item_sccs ()
void item_exx ()
void item_dftu ()
void item_others ()

Private Attributes

int rank = 0
 rank of MPI
std::vector< std::pair< std::string, Input_Item > > input_lists
std::vector< Input_Item * > readvalue_items
std::vector< std::function< void(Parameter &)> > bcastfuncs

Constructor & Destructor Documentation

◆ ReadInput()

ModuleIO::ReadInput::ReadInput ( const int & rank)
Here is the call graph for this function:

◆ ~ReadInput()

ModuleIO::ReadInput::~ReadInput ( )
inline

Member Function Documentation

◆ add_item()

void ModuleIO::ReadInput::add_item ( const Input_Item & item)
private

add item to input list

Parameters
iteminput_item
Here is the caller graph for this function:

◆ check_ntype()

void ModuleIO::ReadInput::check_ntype ( const std::string & fn,
int & param_ntype )
private

count_nype from STRU file

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void ModuleIO::ReadInput::clear ( )
inline

clear all input items

◆ create_directory()

void ModuleIO::ReadInput::create_directory ( const Parameter & param)

Create a directory for output files.

Parameters
paramparameters of ABACUS
Here is the call graph for this function:

◆ current_md_step()

int ModuleIO::ReadInput::current_md_step ( const std::string & file_dir)
private

determine the md step in restart case

Parameters
file_dirdirectory of Restart_md.txt
Returns
md step
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_input_lists()

const std::vector< std::pair< std::string, Input_Item > > & ModuleIO::ReadInput::get_input_lists ( ) const
inline

Get all registered input items (for help system).

Returns
Reference to the vector of input items
Here is the caller graph for this function:

◆ item_bse()

void ModuleIO::ReadInput::item_bse ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_deepks()

void ModuleIO::ReadInput::item_deepks ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_dfpt()

void ModuleIO::ReadInput::item_dfpt ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_dftu()

void ModuleIO::ReadInput::item_dftu ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_elec_stru()

void ModuleIO::ReadInput::item_elec_stru ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_exx()

void ModuleIO::ReadInput::item_exx ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_lcao()

void ModuleIO::ReadInput::item_lcao ( )
private

◆ item_lr_tddft()

void ModuleIO::ReadInput::item_lr_tddft ( )
private
Here is the caller graph for this function:

◆ item_md()

void ModuleIO::ReadInput::item_md ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_model()

void ModuleIO::ReadInput::item_model ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_ofdft()

void ModuleIO::ReadInput::item_ofdft ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_others()

void ModuleIO::ReadInput::item_others ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_output()

void ModuleIO::ReadInput::item_output ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_postprocess()

void ModuleIO::ReadInput::item_postprocess ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_relax()

void ModuleIO::ReadInput::item_relax ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_rt_tddft()

void ModuleIO::ReadInput::item_rt_tddft ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_sccs()

void ModuleIO::ReadInput::item_sccs ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_sdft()

void ModuleIO::ReadInput::item_sdft ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_system()

void ModuleIO::ReadInput::item_system ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_tdofdft()

void ModuleIO::ReadInput::item_tdofdft ( )
private
Here is the caller graph for this function:

◆ normalize_hs_output_options()

void ModuleIO::ReadInput::normalize_hs_output_options ( Parameter & param)
private

Resolve the primary H/S output options and their legacy aliases.

This is called after all INPUT values have been read so that the result does not depend on the order of keywords in the INPUT file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_occ_mat_options()

void ModuleIO::ReadInput::normalize_occ_mat_options ( Parameter & param)
private

Resolve init_occ_mat and its legacy alias omc.

This is called after all INPUT values have been read so that the result does not depend on the order of keywords in the INPUT file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_out_eband_alias()

void ModuleIO::ReadInput::normalize_out_eband_alias ( Parameter & param)
private

Resolve out_eband and its legacy alias out_eband_terms.

This is called after all INPUT values have been read so that the result does not depend on the order of keywords in the INPUT file.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_td_output_frequency()

void ModuleIO::ReadInput::normalize_td_output_frequency ( Parameter & param)
private

Resolve out_freq_td, the legacy RT-TDDFT alias of out_freq_ion.

This is called after all INPUT values have been read so that the result does not depend on the order of keywords in the INPUT file.

Parameters
paramparameters of ABACUS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_input()

std::string ModuleIO::ReadInput::prepare_input ( Parameter & param)
private

Validate explicit domains, read values, resolve defaults and validate resolved domains. Return diagnostics before entering the calculation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_parameters()

void ModuleIO::ReadInput::read_parameters ( Parameter & param,
const std::string & filename_in )

read in parameters from input file

Parameters
paramparameters of ABACUS
filename_inread INPUT file name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_txt_input()

std::string ModuleIO::ReadInput::read_txt_input ( Parameter & param,
const std::string & filename )
private

read INPUT file of txt format

Parameters
paramparameters of ABACUS
filenameINPUT
Returns
Empty on success, otherwise shared input-validation diagnostics.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_global_dir()

void ModuleIO::ReadInput::set_global_dir ( const Input_para & inp,
System_para & sys )
private

set System_para according to input parameters INPUT and STRU need to refer to each other in ABACUS, so it is necessary to obtain the file paths related to all inputs

Note
Here para.inp has not been synchronized of all ranks. Only para.inp in rank 0 is right. So we need to broadcast the results to all ranks.

caculate the global output directory

Set subdirectories based on out_app_flag out_app_flag == 2: use unified uppercase subdirectories otherwise: keep backward-compatible behavior (all point to global_out_dir) The structure subdirectory is named STRUC (not STRU) so it cannot be confused with the STRU input file.

Map legacy directory names to new unified names WFC -> PSI, matrix -> MAT

get the global ML KEDF descriptor directory

get the global directory for DeePKS labels during electronic steps

get the global readin directory

get the stru file for md restart case

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_globalv()

void ModuleIO::ReadInput::set_globalv ( const Input_para & inp,
System_para & sys )
private
Note
Here para.inp has been synchronized of all ranks. All para.inp have the same value.

caculate the gamma_only_pw and gamma_only_local

set deepks_setorb

set the noncolin and lspinorb from nspin

set ncx,ncy,ncz

set ks_run

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_parameters()

void ModuleIO::ReadInput::write_parameters ( const Parameter & param,
const std::string & filename_out )

write out parameters to output file

Parameters
paramparameters of ABACUS
filename_outwrite output file name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_txt_input()

void ModuleIO::ReadInput::write_txt_input ( const Parameter & param,
const std::string & filename )
private

write INPUT file of txt format

Parameters
paramparameters of ABACUS
filenameoutput file name
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ bcastfuncs

std::vector<std::function<void(Parameter&)> > ModuleIO::ReadInput::bcastfuncs
private

◆ check_mode

bool ModuleIO::ReadInput::check_mode = false
static

◆ check_ntype_flag

bool ModuleIO::ReadInput::check_ntype_flag = true

check ntype from STRU file

◆ input_lists

std::vector<std::pair<std::string, Input_Item> > ModuleIO::ReadInput::input_lists
private

◆ rank

int ModuleIO::ReadInput::rank = 0
private

rank of MPI

◆ readvalue_items

std::vector<Input_Item*> ModuleIO::ReadInput::readvalue_items
private

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