#ifndef RELAX_DATA_H#define RELAX_DATA_H#include <vector>/*** @brief 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.*/class Relax_Data {public:/*** @brief Default constructor.*/Relax_Data() = default;/*** @brief Default destructor.*/~Relax_Data() = default;/*** @brief Allocate memory for data vectors.* @param dim_in Dimension of the optimization problem (3 * number of atoms).*/void allocate(const int dim_in);// Static members - shared global state across all relaxation instancesstatic int dim; ///< Dimension of free variables (3 * number of atoms) for ion movementstatic int dim_lattice; ///< Dimension of free variables (9) for lattice changestatic double largest_grad; ///< Largest gradient component (force) in current step// Instance members - per-iteration datastd::vector<double> pos; ///< Current atomic positions in Bohrstd::vector<double> grad; ///< Current gradient (negative force) in Ry/Bohrstd::vector<double> move; ///< Displacement vector for next stepstd::vector<double> pos_p; ///< Previous atomic positionsstd::vector<double> grad_p; ///< Previous gradientstd::vector<double> move_p; ///< Previous displacement};#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。