Loading...
Searching...
No Matches
OHTSTJob.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 "eon/Eigen.h"
14#include "eon/Job.h"
15#include "eon/Matter.h"
16#include "eon/Parameters.h"
17
18namespace tests {
19struct OHTSTPlaneWrapTest;
20}
21
22namespace eonc {
23
26inline double pmfScanS(long plane, long nScan, double guideLen) {
27 const long n = nScan < 2L ? 2L : nScan;
28 return static_cast<double>(plane) * guideLen / static_cast<double>(n - 1);
29}
30
33inline bool reversibleWorkPastRidge(double reversibleWork,
34 double thermalEnergy) {
35 return reversibleWork > 2.0 * thermalEnergy;
36}
37
41
59class OHTSTJob : public Job {
60
61public:
62 OHTSTJob(std::unique_ptr<Parameters> parameters, Runtime &rt)
63 : Job(std::move(parameters), rt) {}
64 ~OHTSTJob(void) = default;
65 std::vector<std::string> run(void);
66
67private:
71 double fn{0.0};
72 VectorXd rotNorm;
73 VectorXd rotRaw;
74 VectorXd
76 };
77
78 // x is the unwrapped free configuration. It is not read back from
79 // Matter: setPositionsFreeV wraps into the primary cell, and the
80 // projection of that image is a different 3N point.
81 PlaneAverages samplePlane(Matter &matter, VectorXd &x, const VectorXd &gamma,
82 const VectorXd &normal);
83
84 friend struct ::tests::OHTSTPlaneWrapTest;
85
88 double reactantQRatio(Matter &matter, const VectorXd &gammaR,
89 const VectorXd &normal);
90
93 void drawThermalVelocities(VectorXd &vel, const VectorXd *normal);
94
100 bool symmetryReflect(const VectorXd &xR, VectorXd &x, VectorXd &v,
101 const VectorXd &xOld, const VectorXd *normal);
102 friend struct OHTSTSymmetryTest;
103
104 std::vector<VectorXd> m_symDirs;
105 VectorXd m_symXR;
106
107 VectorXd m_masses3N;
108 double m_dt{0.0};
109 double m_kbt{0.0};
110 double m_andersenProb{0.0};
111 long m_seedState{12345};
112 double uniformDraw();
113 double gaussDraw();
114 bool m_gaussHave{false};
115 double m_gaussSpare{0.0};
116};
117
122 Eigen::RowVector3d *totalDrift);
123
124} // namespace eonc
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
The job class is used to serve as an abstract class for all jobs, as well as to call a job at runtime...
Job(std::unique_ptr< Parameters > parameters, Runtime &rt, ExclusivePotential)
Definition Job.h:71
double reactantQRatio(Matter &matter, const VectorXd &gammaR, const VectorXd &normal)
Definition OHTSTJob.cpp:247
double m_andersenProb
per-step Andersen collision probability
Definition OHTSTJob.h:110
void drawThermalVelocities(VectorXd &vel, const VectorXd *normal)
Definition OHTSTJob.cpp:94
VectorXd m_masses3N
per-DOF masses of the free atoms (amu)
Definition OHTSTJob.h:107
~OHTSTJob(void)=default
OHTSTJob(std::unique_ptr< Parameters > parameters, Runtime &rt)
Definition OHTSTJob.h:62
PlaneAverages samplePlane(Matter &matter, VectorXd &x, const VectorXd &gamma, const VectorXd &normal)
Definition OHTSTJob.cpp:149
long m_seedState
LCG state for the thermostat draws.
Definition OHTSTJob.h:111
double uniformDraw()
uniform (0,1)
Definition OHTSTJob.cpp:51
double m_gaussSpare
Definition OHTSTJob.h:115
double gaussDraw()
standard normal (Box-Muller)
Definition OHTSTJob.cpp:58
double m_kbt
k_B T (eV)
Definition OHTSTJob.h:109
std::vector< std::string > run(void)
Virtual run; used solely for dynamic dispatch.
Definition OHTSTJob.cpp:307
std::vector< VectorXd > m_symDirs
p-hat_i, index 0 = primary
Definition OHTSTJob.h:104
double m_dt
integration step, internal units
Definition OHTSTJob.h:108
friend struct OHTSTSymmetryTest
Definition OHTSTJob.h:102
VectorXd m_symXR
reactant anchor R of the half-lines
Definition OHTSTJob.h:105
bool symmetryReflect(const VectorXd &xR, VectorXd &x, VectorXd &v, const VectorXd &xOld, const VectorXd *normal)
Definition OHTSTJob.cpp:103
Move-only composition root for process resources (dlopen loaders and the potential registry).
Definition Runtime.h:27
RAII resource manager for the ARTn C library with global synchronization.
AtomMatrix minImageRemoveRigidDrift(const Matter &reference, AtomMatrix diff, Eigen::RowVector3d *totalDrift)
Minimum-image a free-atom difference and remove rigid translation.
Definition OHTSTJob.cpp:71
double pmfScanS(long plane, long nScan, double guideLen)
Uniform PMF-scan coordinate.
Definition OHTSTJob.h:26
bool reversibleWorkPastRidge(double reversibleWork, double thermalEnergy)
The reactant basin is force-free.
Definition OHTSTJob.h:33
VectorXd pos
, anchors Eq 18 and the Eq 12 restart
Definition OHTSTJob.h:75
VectorXd rotNorm
<(n.F) R / (alpha |R|^2)>, drives rotation
Definition OHTSTJob.h:72
VectorXd rotRaw
<(n.F) R>, integrand of Eq 19
Definition OHTSTJob.h:73