eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
SurrogatePotential.cpp
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
#include "
eon/SurrogatePotential.h
"
13
14
#include <span>
15
16
namespace
eonc
{
17
18
std::tuple<double, AtomMatrix, double>
19
SurrogatePotential::get_ef_var
(
const
AtomMatrix
pos,
const
VectorXi atmnrs,
20
const
Matrix3d
box) {
21
double
energy{std::numeric_limits<double>::infinity()};
22
long
nAtoms =
static_cast<
long
>
(pos.rows());
23
AtomMatrix
forces{MatrixXd::Zero(nAtoms, 3)};
24
double
var{0};
25
const
auto
n =
static_cast<
size_t
>
(nAtoms);
26
this->
force
(std::span<const double>(pos.data(), n * 3),
27
std::span<const int>(atmnrs.data(), n),
28
std::span<double>(forces.data(), n * 3), &energy, &var,
29
std::span<const double>(box.data(), 9));
30
return
std::make_tuple(energy, forces, var);
31
}
32
33
}
// namespace eonc
Matrix3d
Eigen::Matrix< double, 3, 3, eOnStorageOrder > Matrix3d
Definition
Eigen.h:35
AtomMatrix
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition
Eigen.h:37
SurrogatePotential.h
eonc::Potential::force
virtual void force(long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, double *variance, const double *box)=0
eonc::SurrogatePotential::get_ef_var
std::tuple< double, AtomMatrix, double > get_ef_var(const AtomMatrix pos, const VectorXi atmnrs, const Matrix3d box)
Definition
SurrogatePotential.cpp:19
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:23
client
SurrogatePotential.cpp
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf