Loading...
Searching...
No Matches
ImprovedDimer.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "Eigen.h"
14#include "EonLogger.h"
15#include "LowestEigenmode.h"
16#include "Matter.h"
17#include "Parameters.h"
18#include <vector>
19
20namespace eonc {
21
22// dimer method to find the lowest curvature mode
24
25private:
27 // For use when called as part of the NEB-MMF
29 bool hasFixedReference = false;
30
31public:
32 // Optimization for the dimer
33 // static const string OPT_SD;
34 // static const string OPT_CG;
35 // static const string OPT_LBFGS;
36 static const char OPT_SD[];
37 static const char OPT_CG[];
38 static const char OPT_LBFGS[];
39
40 ImprovedDimer(std::shared_ptr<Matter> matter, const Parameters &params,
41 std::shared_ptr<Potential> pot);
42 ~ImprovedDimer() = default;
43
44 void compute(std::shared_ptr<Matter> matter, AtomMatrix initialDirection);
45 double getEigenvalue();
47
48 std::shared_ptr<Matter> x0; // Center image
49 std::shared_ptr<Matter> x1; // Forward image
50 VectorXd tau; // Dimer direction
51 VectorXd theta; // Dimer rotation direction
52 VectorXd F_R; // Dimer rotational force
53 double C_tau{0.0}; // Curvature along tau
54 // For use when called as part of the NEB-MMF
55 void setReferenceMode(const VectorXd &ref);
56 void clearReferenceMode();
59 // parameters used for conjugate gradients
60 VectorXd F_R_Old;
61 VectorXd thetaOld;
62 double a{0.0}, b{0.0}, gamma{0.0};
63 bool init_cg{false};
64
65 // variables for LBFGS
66 std::vector<VectorXd> s, y;
67 std::vector<double> rho;
68 bool init_lbfgs{false};
69 VectorXd rPrev;
70
71 std::vector<VectorXd> gradients;
72 std::vector<VectorXd> positions;
73};
74
75} // namespace eonc
76
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
std::shared_ptr< Matter > x1
void setReferenceMode(const VectorXd &ref)
std::vector< VectorXd > s
VectorXd fixedReferenceMode
static const char OPT_CG[]
std::vector< VectorXd > positions
static const char OPT_LBFGS[]
static const char OPT_SD[]
std::vector< VectorXd > gradients
~ImprovedDimer()=default
std::shared_ptr< Matter > x0
std::vector< VectorXd > y
ImprovedDimer(std::shared_ptr< Matter > matter, const Parameters &params, std::shared_ptr< Potential > pot)
eonc::log::Scoped log
std::vector< double > rho
AtomMatrix getEigenvector()
void compute(std::shared_ptr< Matter > matter, AtomMatrix initialDirection)
const Parameters & params
std::shared_ptr< Potential > pot
LowestEigenmode(std::shared_ptr< Potential > potPassed, const Parameters &parameters)
RAII resource manager for the ARTn C library with global synchronization.
RAII helper for class-scoped logging.
Definition EonLogger.h:171