Loading...
Searching...
No Matches
LORRotation.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
19namespace eonc {
20
21// Leng et al., J. Chem. Phys. 138, 094110 (2013) — Locally Optimal Rotation
22// (LOR) Algorithm I for softest-mode finding in the dimer rotation step. At
23// most one new force evaluation per rotation iteration via FD H·v + force
24// translation of prior H·N / H·F_⊥ / H·P products.
26private:
28 VectorXd eigenvector;
29 double eigenvalue{0.0};
30 std::shared_ptr<Matter> x0;
31 std::shared_ptr<Matter> x1;
32
33public:
34 LORRotation(std::shared_ptr<Matter> matter, const Parameters &params,
35 std::shared_ptr<Potential> pot);
36 ~LORRotation() = default;
37
38 void compute(std::shared_ptr<Matter> matter, AtomMatrix initialDirection);
39 double getEigenvalue() { return eigenvalue; }
41 return AtomMatrix::Map(eigenvector.data(), eigenvector.size() / 3, 3);
42 }
43
44 // Last LOR curvature sequence (for unit tests / monotonicity checks)
45 std::vector<double> curvatureHistory;
47
55 [[nodiscard]] static VectorXd
56 translateHUnitOrthoP3(const VectorXd &N, const VectorXd &Theta,
57 const VectorXd &P, const VectorXd &HN,
58 const VectorXd &HTheta, const VectorXd &HP);
59};
60
61} // namespace eonc
62
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
std::shared_ptr< Matter > x0
Definition LORRotation.h:30
AtomMatrix getEigenvector()
Definition LORRotation.h:40
LORRotation(std::shared_ptr< Matter > matter, const Parameters &params, std::shared_ptr< Potential > pot)
eonc::log::Scoped log
Definition LORRotation.h:27
std::shared_ptr< Matter > x1
Definition LORRotation.h:31
void compute(std::shared_ptr< Matter > matter, AtomMatrix initialDirection)
static VectorXd translateHUnitOrthoP3(const VectorXd &N, const VectorXd &Theta, const VectorXd &P, const VectorXd &HN, const VectorXd &HTheta, const VectorXd &HP)
Force-translation identity for H·P3 when P3 is the unit Gram-Schmidt residual of P against orthonorma...
double getEigenvalue()
Definition LORRotation.h:39
VectorXd eigenvector
Definition LORRotation.h:28
std::vector< double > curvatureHistory
Definition LORRotation.h:45
~LORRotation()=default
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