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
51class OHTSTJob : public Job {
52
53public:
54 OHTSTJob(std::unique_ptr<Parameters> parameters, Runtime &rt)
55 : Job(std::move(parameters), rt) {}
56 ~OHTSTJob(void) = default;
57 std::vector<std::string> run(void);
58
59private:
63 double fn{0.0};
64 VectorXd rotNorm;
65 VectorXd rotRaw;
66 VectorXd pos;
67 };
68
69 // x is the unwrapped free configuration. It is not read back from
70 // Matter: setPositionsFreeV wraps into the primary cell, and the
71 // projection of that image is a different 3N point.
72 PlaneAverages samplePlane(Matter &matter, VectorXd &x, const VectorXd &gamma,
73 const VectorXd &normal);
74
75 friend struct ::tests::OHTSTPlaneWrapTest;
76
79 double reactantQRatio(Matter &matter, const VectorXd &gammaR,
80 const VectorXd &normal);
81
84 void drawThermalVelocities(VectorXd &vel, const VectorXd *normal);
85
91 bool symmetryReflect(const VectorXd &xR, VectorXd &x, VectorXd &v,
92 const VectorXd &xOld, const VectorXd *normal);
93 friend struct OHTSTSymmetryTest;
94
95 std::vector<VectorXd> m_symDirs;
96 VectorXd m_symXR;
97
98 VectorXd m_masses3N;
99 double m_dt{0.0};
100 double m_kbt{0.0};
101 double m_andersenProb{0.0};
102 long m_seedState{12345};
103 double uniformDraw();
104 double gaussDraw();
105 bool m_gaussHave{false};
106 double m_gaussSpare{0.0};
107};
108
112AtomMatrix minImageRemoveRigidDrift(const Matter &reference, AtomMatrix diff,
113 Eigen::RowVector3d *totalDrift);
114
115} // 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)
Borrow: caller keeps Runtime alive (CLI stack / Python Session).
Definition Job.h:76
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:101
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:98
~OHTSTJob(void)=default
OHTSTJob(std::unique_ptr< Parameters > parameters, Runtime &rt)
Definition OHTSTJob.h:54
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:102
double uniformDraw()
uniform (0,1)
Definition OHTSTJob.cpp:51
double m_gaussSpare
Definition OHTSTJob.h:106
double gaussDraw()
standard normal (Box-Muller)
Definition OHTSTJob.cpp:58
double m_kbt
k_B T (eV)
Definition OHTSTJob.h:100
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:95
double m_dt
integration step, internal units
Definition OHTSTJob.h:99
friend struct OHTSTSymmetryTest
Definition OHTSTJob.h:93
VectorXd m_symXR
reactant anchor R of the half-lines
Definition OHTSTJob.h:96
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
VectorXd pos
<r>, anchors Eq 18 and the Eq 12 restart
Definition OHTSTJob.h:66
VectorXd rotNorm
<(n.F) R / (alpha |R|^2)>, drives rotation
Definition OHTSTJob.h:64
VectorXd rotRaw
<(n.F) R>, integrand of Eq 19
Definition OHTSTJob.h:65