Loading...
Searching...
No Matches
GleThermostat.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 <functional>
14#include <string>
15
16#include "eon/Eigen.h"
17
18namespace eonc {
19
49public:
52 GleThermostat(const MatrixXd &a_drift, double kbt, double dt_half,
53 long n_dof);
54
57 static MatrixXd loadDriftMatrix(const std::string &path);
58
61 void apply(VectorXd &vel, const VectorXd &masses3N,
62 const std::function<double()> &gauss);
63
65 bool valid() const { return m_valid; }
66
67private:
68 bool m_valid{false};
72};
73
74} // namespace eonc
75
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, eOnStorageOrder > MatrixXd
Definition Eigen.h:33
Colored-noise (generalized Langevin) thermostat.
MatrixXd m_S
noise factor, S S^T = kbt (I - T T^T)
MatrixXd m_T
exp(-A dt/2)
void apply(VectorXd &vel, const VectorXd &masses3N, const std::function< double()> &gauss)
One OU half-step on the mass-scaled velocities; gauss supplies standard-normal draws from the job's d...
MatrixXd m_Z
extended state, (1 + n_aux) x n_dof
GleThermostat(const MatrixXd &a_drift, double kbt, double dt_half, long n_dof)
Build from the drift matrix, target kB*T (eV), the half-step dt (internal units), and the number of f...
bool valid() const
True when construction produced a usable propagator.
static MatrixXd loadDriftMatrix(const std::string &path)
Load a drift matrix from a gle4md-layout text file ('#' starts a comment).
RAII resource manager for the ARTn C library with global synchronization.