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*/
13
14std::tuple<double, AtomMatrix, double>
15SurrogatePotential::get_ef_var(const AtomMatrix pos, const VectorXi atmnrs,
16 const Matrix3d box) {
17 double energy{std::numeric_limits<double>::infinity()};
18 long nAtoms = static_cast<long>(pos.rows());
19 AtomMatrix forces{MatrixXd::Zero(nAtoms, 3)};
20 double var{0};
21 this->force(nAtoms, pos.data(), atmnrs.data(), forces.data(), &energy, &var,
22 box.data());
23 return std::make_tuple(energy, forces, var);
24};
Eigen::Matrix< double, 3, 3, eOnStorageOrder > Matrix3d
Definition Eigen.h:35
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
std::tuple< double, AtomMatrix, double > get_ef_var(const AtomMatrix pos, const VectorXi atmnrs, const Matrix3d box)
virtual void force(long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, double *variance, const double *box)=0