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

Friend helper to mutate PARAM private members in unit tests. More...

#include <td_test_utils.h>

Collaboration diagram for TestParameters:

Public Member Functions

 TestParameters (Parameter &parameter)
 ~TestParameters ()
void set_output (const std::string &directory, bool append, const std::string &band_directory)
 TestParameters (Parameter &target)
 ~TestParameters () noexcept
 TestParameters (const TestParameters &)=delete
TestParameters & operator= (const TestParameters &)=delete
 TestParameters (TestParameters &&)=delete
TestParameters & operator= (TestParameters &&)=delete

Static Public Member Functions

static void reset ()
static void set_nspin (const int nspin)
static void set_nelec (const double nelec)
static void set_two_fermi (const bool two_fermi)
static Input_para & input ()
static System_para & sys ()
static void reset ()
static void use_cpu_single ()
static void set_global_dir (ModuleIO::ReadInput &readinput, const Input_para &inp, System_para &sys)
static void set_globalv (ModuleIO::ReadInput &readinput, const Input_para &inp, System_para &sys)
static Input_para & input ()
static System_para & sys ()
static Input_para & input ()
static System_para & sys ()
static MD_para & mdp ()
static Input_para & input (Parameter &param)
static System_para & sys (Parameter &param)
static Input_para & input (Parameter &param)
static System_para & sys (Parameter &param)
static Input_para & input ()
static System_para & sys ()
static Input_para & input ()
static System_para & sys ()
static Input_para & input ()
static System_para & sys ()
static Input_para & input ()
static System_para & sys ()
static void init (int npol, bool gamma_only_local, int nlocal, int nspin)
static void gamma_only (const bool enabled)
static void set_relax (const std::string &out_level, const double relax_bfgs_rmax, const double relax_bfgs_rmin, const double relax_bfgs_init, const std::string &fixed_axes)

Private Attributes

Parameter & parameter_
bool append_ = false
std::string directory_
std::string band_directory_
Parameter & target_
Input_para input_
System_para system_

Detailed Description

Friend helper to mutate PARAM private members in unit tests.

Install isolated spinor test settings and restore the supplied parameter object's state.

Friend helper to mutate Parameter private members in unit tests.

Friend helper to invoke ReadInput private setters in unit tests.

FixedWeights: elecstate::ElecState::fixed_weights()

  • fix wg using external weights: ocp_kb

CalEBand: elecstate::ElecState::cal_eband()

  • calculate the electronic states energy contribution to total energy

CalculateWeights: elecstate::ElecState::calculate_weights()

  • calculate the weights for each electronic state

Parameter grants friend access to TestParameters so the test can modify input/sys fields without #define private public. The class must stay at global scope to match the friend declaration in parameter.h; an anonymous-namespace class would not be the friend.

ReadInput grants friend access to TestParameters so the test can drive its private setup routines without #define private public. The class must stay at global scope to match the friend declaration in read_input.h; an anonymous-namespace class would not be the friend.

Parameter grants friend access to TestParameters so the test can modify input/sys fields of a local Parameter instance without #define private public. The class must stay at global scope to match the friend declaration in parameter.h; an anonymous-namespace class would not be the friend.

Save and restore only the global settings consumed by band output.

Constructor & Destructor Documentation

◆ TestParameters() [1/4]

TestParameters::TestParameters ( Parameter & parameter)
inlineexplicit
Here is the caller graph for this function:

◆ ~TestParameters() [1/2]

TestParameters::~TestParameters ( )
inlinenoexcept

◆ TestParameters() [2/4]

TestParameters::TestParameters ( Parameter & target)
explicit

◆ ~TestParameters() [2/2]

TestParameters::~TestParameters ( )
noexcept

◆ TestParameters() [3/4]

TestParameters::TestParameters ( const TestParameters & )
delete
Here is the call graph for this function:

◆ TestParameters() [4/4]

TestParameters::TestParameters ( TestParameters && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ gamma_only()

void TestParameters::gamma_only ( const bool enabled)
inlinestatic

◆ init()

void TestParameters::init ( int npol,
bool gamma_only_local,
int nlocal,
int nspin )
inlinestatic
Here is the caller graph for this function:

◆ input() [1/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [2/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [3/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [4/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [5/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [6/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [7/9]

Input_para & TestParameters::input ( )
inlinestatic

◆ input() [8/9]

Input_para & TestParameters::input ( Parameter & param)
inlinestatic

◆ input() [9/9]

Input_para & TestParameters::input ( Parameter & param)
inlinestatic

◆ mdp()

MD_para & TestParameters::mdp ( )
inlinestatic
Here is the caller graph for this function:

◆ operator=() [1/2]

TestParameters & TestParameters::operator= ( const TestParameters & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

TestParameters & TestParameters::operator= ( TestParameters && )
delete
Here is the call graph for this function:

◆ reset() [1/2]

void TestParameters::reset ( )
inlinestatic
Here is the caller graph for this function:

◆ reset() [2/2]

void TestParameters::reset ( )
inlinestatic

◆ set_global_dir()

void TestParameters::set_global_dir ( ModuleIO::ReadInput & readinput,
const Input_para & inp,
System_para & sys )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_globalv()

void TestParameters::set_globalv ( ModuleIO::ReadInput & readinput,
const Input_para & inp,
System_para & sys )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_nelec()

void TestParameters::set_nelec ( const double nelec)
inlinestatic
Here is the caller graph for this function:

◆ set_nspin()

void TestParameters::set_nspin ( const int nspin)
inlinestatic
Here is the caller graph for this function:

◆ set_output()

void TestParameters::set_output ( const std::string & directory,
bool append,
const std::string & band_directory )
inline

◆ set_relax()

void TestParameters::set_relax ( const std::string & out_level,
const double relax_bfgs_rmax,
const double relax_bfgs_rmin,
const double relax_bfgs_init,
const std::string & fixed_axes )
inlinestatic
Here is the caller graph for this function:

◆ set_two_fermi()

void TestParameters::set_two_fermi ( const bool two_fermi)
inlinestatic
Here is the caller graph for this function:

◆ sys() [1/9]

System_para & TestParameters::sys ( )
inlinestatic
Here is the caller graph for this function:

◆ sys() [2/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [3/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [4/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [5/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [6/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [7/9]

System_para & TestParameters::sys ( )
inlinestatic

◆ sys() [8/9]

System_para & TestParameters::sys ( Parameter & param)
inlinestatic

◆ sys() [9/9]

System_para & TestParameters::sys ( Parameter & param)
inlinestatic

◆ use_cpu_single()

void TestParameters::use_cpu_single ( )
inlinestatic
Here is the caller graph for this function:

Member Data Documentation

◆ append_

bool TestParameters::append_ = false
private

◆ band_directory_

std::string TestParameters::band_directory_
private

◆ directory_

std::string TestParameters::directory_
private

◆ input_

Input_para TestParameters::input_
private

◆ parameter_

Parameter& TestParameters::parameter_
private

◆ system_

System_para TestParameters::system_
private

◆ target_

Parameter& TestParameters::target_
private

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