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

#include <relax_sync.h>

Collaboration diagram for Relax:

Public Member Functions

 Relax ()
 ~Relax ()
void init_relax (const int nat_in, const Input_para &inp)
bool relax_step (UnitCell &ucell, const ModuleBase::matrix &force, const ModuleBase::matrix &stress, const double etot_in, std::ofstream &ofs_running)
const std::vector< double > & get_max_force_history () const
 Read-only observers of the per-step convergence history, for the final summary.
const std::vector< double > & get_max_stress_history () const

Private Member Functions

bool setup_gradient (const UnitCell &ucell, const ModuleBase::matrix &force, const ModuleBase::matrix &stress, std::ofstream &ofs_running)
double setup_ion_gradient (const UnitCell &ucell, const ModuleBase::matrix &force, bool &force_converged, std::ofstream &ofs_running)
void setup_cell_gradient (const UnitCell &ucell, const ModuleBase::matrix &stress, bool &force_converged, std::ofstream &ofs_running)
void print_gradient_summary (bool force_converged, std::ofstream &ofs_running)
bool check_line_search ()
void perform_line_search (std::ofstream &ofs_running)
void new_direction (std::ofstream &ofs_running)
void move_cell_ions (UnitCell &ucell, const bool is_new_dir, std::ofstream &ofs_running)
void update_lattice (UnitCell &ucell, double fac, bool is_new_dir)
void update_ion_positions (UnitCell &ucell, double fac, std::ofstream &ofs_running)
void update_reciprocal_cell (UnitCell &ucell, std::ofstream &ofs_running)
void calculate_gamma ()

Private Attributes

int istep = 0
int nat = 0
bool ltrial = false
double step_size = 0.0
ModuleBase::matrix grad_ion
ModuleBase::matrix grad_cell
ModuleBase::matrix grad_ion_p
ModuleBase::matrix grad_cell_p
ModuleBase::matrix search_dr_ion
ModuleBase::matrix search_dr_cell
ModuleBase::matrix search_dr_ion_p
ModuleBase::matrix search_dr_cell_p
bool if_cell_moves = false
int cg_step = 0
double gamma = 0.0
double sr_sr = 0.0
double srp_srp = 0.0
double gr_gr = 0.0
double gr_grp = 0.0
double grp_grp = 0.0
double gr_sr = 0.0
double e1ord1 = 0.0
double e1ord2 = 0.0
double e2ord = 0.0
double e2ord2 = 0.0
double dmove = 0.0
double dmovel = 0.0
double dmoveh = 0.0
double etot = 0.0
double etot_p = 0.0
double omega_p = 0.0
 previous cell volume in Angstrom^3, used to print volume diff during cell-relax
double force_thr_eva = 0.0
bool brent_done = false
double fac_force = 0.0
double fac_stress = 0.0
ModuleBase::Matrix3 latvec_save
Line_Search ls
const Input_para * inp_ = nullptr
std::vector< double > max_force_history_
 Largest force of each step (eV/Angstrom), includes trial and line-search steps.
std::vector< double > max_stress_history_
 Largest stress of each step (kbar), only filled in cell-relax.

Constructor & Destructor Documentation

◆ Relax()

Relax::Relax ( )
inline

◆ ~Relax()

Relax::~Relax ( )
inline

Member Function Documentation

◆ calculate_gamma()

void Relax::calculate_gamma ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_line_search()

bool Relax::check_line_search ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_max_force_history()

const std::vector< double > & Relax::get_max_force_history ( ) const
inline

Read-only observers of the per-step convergence history, for the final summary.

Here is the caller graph for this function:

◆ get_max_stress_history()

const std::vector< double > & Relax::get_max_stress_history ( ) const
inline

◆ init_relax()

void Relax::init_relax ( const int nat_in,
const Input_para & inp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ move_cell_ions()

void Relax::move_cell_ions ( UnitCell & ucell,
const bool is_new_dir,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ new_direction()

void Relax::new_direction ( std::ofstream & ofs_running)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ perform_line_search()

void Relax::perform_line_search ( std::ofstream & ofs_running)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_gradient_summary()

void Relax::print_gradient_summary ( bool force_converged,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relax_step()

bool Relax::relax_step ( UnitCell & ucell,
const ModuleBase::matrix & force,
const ModuleBase::matrix & stress,
const double etot_in,
std::ofstream & ofs_running )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_cell_gradient()

void Relax::setup_cell_gradient ( const UnitCell & ucell,
const ModuleBase::matrix & stress,
bool & force_converged,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_gradient()

bool Relax::setup_gradient ( const UnitCell & ucell,
const ModuleBase::matrix & force,
const ModuleBase::matrix & stress,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_ion_gradient()

double Relax::setup_ion_gradient ( const UnitCell & ucell,
const ModuleBase::matrix & force,
bool & force_converged,
std::ofstream & ofs_running )
private
Here is the caller graph for this function:

◆ update_ion_positions()

void Relax::update_ion_positions ( UnitCell & ucell,
double fac,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_lattice()

void Relax::update_lattice ( UnitCell & ucell,
double fac,
bool is_new_dir )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_reciprocal_cell()

void Relax::update_reciprocal_cell ( UnitCell & ucell,
std::ofstream & ofs_running )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ brent_done

bool Relax::brent_done = false
private

◆ cg_step

int Relax::cg_step = 0
private

◆ dmove

double Relax::dmove = 0.0
private

◆ dmoveh

double Relax::dmoveh = 0.0
private

◆ dmovel

double Relax::dmovel = 0.0
private

◆ e1ord1

double Relax::e1ord1 = 0.0
private

◆ e1ord2

double Relax::e1ord2 = 0.0
private

◆ e2ord

double Relax::e2ord = 0.0
private

◆ e2ord2

double Relax::e2ord2 = 0.0
private

◆ etot

double Relax::etot = 0.0
private

◆ etot_p

double Relax::etot_p = 0.0
private

◆ fac_force

double Relax::fac_force = 0.0
private

◆ fac_stress

double Relax::fac_stress = 0.0
private

◆ force_thr_eva

double Relax::force_thr_eva = 0.0
private

◆ gamma

double Relax::gamma = 0.0
private

◆ gr_gr

double Relax::gr_gr = 0.0
private

◆ gr_grp

double Relax::gr_grp = 0.0
private

◆ gr_sr

double Relax::gr_sr = 0.0
private

◆ grad_cell

ModuleBase::matrix Relax::grad_cell
private

◆ grad_cell_p

ModuleBase::matrix Relax::grad_cell_p
private

◆ grad_ion

ModuleBase::matrix Relax::grad_ion
private

◆ grad_ion_p

ModuleBase::matrix Relax::grad_ion_p
private

◆ grp_grp

double Relax::grp_grp = 0.0
private

◆ if_cell_moves

bool Relax::if_cell_moves = false
private

◆ inp_

const Input_para* Relax::inp_ = nullptr
private

◆ istep

int Relax::istep = 0
private

◆ latvec_save

ModuleBase::Matrix3 Relax::latvec_save
private

◆ ls

Line_Search Relax::ls
private

◆ ltrial

bool Relax::ltrial = false
private

◆ max_force_history_

std::vector<double> Relax::max_force_history_
private

Largest force of each step (eV/Angstrom), includes trial and line-search steps.

◆ max_stress_history_

std::vector<double> Relax::max_stress_history_
private

Largest stress of each step (kbar), only filled in cell-relax.

◆ nat

int Relax::nat = 0
private

◆ omega_p

double Relax::omega_p = 0.0
private

previous cell volume in Angstrom^3, used to print volume diff during cell-relax

◆ search_dr_cell

ModuleBase::matrix Relax::search_dr_cell
private

◆ search_dr_cell_p

ModuleBase::matrix Relax::search_dr_cell_p
private

◆ search_dr_ion

ModuleBase::matrix Relax::search_dr_ion
private

◆ search_dr_ion_p

ModuleBase::matrix Relax::search_dr_ion_p
private

◆ sr_sr

double Relax::sr_sr = 0.0
private

◆ srp_srp

double Relax::srp_srp = 0.0
private

◆ step_size

double Relax::step_size = 0.0
private

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