1#ifndef LATTICE_CHANGE_BASIC_H
2#define LATTICE_CHANGE_BASIC_H
55 const bool fixed_ibrav);
70 const double &stress_thr);
77void terminate(
const bool converged, std::ofstream &ofs);
85void setup_etot(
const double &energy_in, std::vector<double> &etot_info);
static int dim_lattice
Dimension of free variables (9) for lattice change.
Definition relax_data.h:35
static double largest_grad
Largest gradient component (force) in current step.
Definition relax_data.h:37
Provide the basic information about unitcell.
Definition unitcell.h:16
Basic utilities and shared state for lattice relaxation algorithms.
void terminate(const bool converged, std::ofstream &ofs)
Terminate lattice optimization and output results.
Definition lattice_change_basic.cpp:319
int stress_step
Index of stress optimization step.
Definition lattice_change_basic.cpp:10
void change_lattice(UnitCell &ucell, double *move, double *lat, const bool fixed_ibrav)
Update lattice vectors according to displacement.
Definition lattice_change_basic.cpp:104
int update_iter
Number of successfully updated iterations.
Definition lattice_change_basic.cpp:9
void setup_etot(const double &energy_in, std::vector< double > &etot_info)
Update energy values and compute energy difference.
Definition lattice_change_basic.cpp:349
bool check_converged(const UnitCell &ucell, ModuleBase::matrix &stress, double *grad, std::ofstream &ofs, const double &stress_thr)
Check convergence based on stress threshold.
Definition lattice_change_basic.cpp:242
double lattice_change_ini
Initial trust radius for lattice change (default: 0.01).
Definition lattice_change_basic.cpp:11
void setup_gradient(const UnitCell &ucell, double *lat, double *grad, ModuleBase::matrix &stress)
Setup gradient from stress tensor.
Definition lattice_change_basic.cpp:14
std::string fixed_axes
Fixed axes constraint ("None", "shape", "volume", or specific axes).
Definition lattice_change_basic.cpp:12