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

Unified data structure for geometry optimization algorithms. More...

#include <relax_data.h>

Collaboration diagram for Relax_Data:

Public Member Functions

 Relax_Data ()=default
 Default constructor.
 ~Relax_Data ()=default
 Default destructor.
void allocate (const int dim_in)
 Allocate memory for data vectors.

Public Attributes

std::vector< double > pos
 Current atomic positions in Bohr.
std::vector< double > grad
 Current gradient (negative force) in Ry/Bohr.
std::vector< double > move
 Displacement vector for next step.
std::vector< double > pos_p
 Previous atomic positions.
std::vector< double > grad_p
 Previous gradient.
std::vector< double > move_p
 Previous displacement.

Static Public Attributes

static int dim = 0
 Dimension of free variables (3 * number of atoms) for ion movement.
static int dim_lattice = 0
 Dimension of free variables (9) for lattice change.
static double largest_grad = 0.0
 Largest gradient component (force) in current step.

Detailed Description

Unified data structure for geometry optimization algorithms.

This class provides a common data container for all relaxation methods (BFGS, CG, SD, etc.) to share and reuse key variables like positions, gradients, and move vectors. It serves as the single source of truth for optimization state across different algorithms.

Constructor & Destructor Documentation

◆ Relax_Data()

Relax_Data::Relax_Data ( )
default

Default constructor.

◆ ~Relax_Data()

Relax_Data::~Relax_Data ( )
default

Default destructor.

Member Function Documentation

◆ allocate()

void Relax_Data::allocate ( const int dim_in)

Allocate memory for data vectors.

Parameters
dim_inDimension of the optimization problem (3 * number of atoms).

Member Data Documentation

◆ dim

int Relax_Data::dim = 0
static

Dimension of free variables (3 * number of atoms) for ion movement.

◆ dim_lattice

int Relax_Data::dim_lattice = 0
static

Dimension of free variables (9) for lattice change.

◆ grad

std::vector<double> Relax_Data::grad

Current gradient (negative force) in Ry/Bohr.

◆ grad_p

std::vector<double> Relax_Data::grad_p

Previous gradient.

◆ largest_grad

double Relax_Data::largest_grad = 0.0
static

Largest gradient component (force) in current step.

◆ move

std::vector<double> Relax_Data::move

Displacement vector for next step.

◆ move_p

std::vector<double> Relax_Data::move_p

Previous displacement.

◆ pos

std::vector<double> Relax_Data::pos

Current atomic positions in Bohr.

◆ pos_p

std::vector<double> Relax_Data::pos_p

Previous atomic positions.


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