eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
ASE.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
14
#include "
eon/Potential.h
"
15
#include <pybind11/pybind11.h>
16
17
namespace
py = pybind11;
18
19
class
ASE
:
public
eonc::Potential
{
20
21
private
:
22
size_t
counter
{0};
23
py::module_
py_module
;
// Member to store the Python module
24
py::object
calculator
;
// Member to store the ASE calculator object
25
py::object
_calculate
;
// Member to store the Python function to calculate
26
// forces and energy
27
py::object
batch_calculate_
;
28
bool
has_batch_
{
false
};
29
30
public
:
31
ASE
(
const
eonc::Parameters
&a_params);
32
virtual
~ASE
() {
33
QUILL_LOG_INFO(
eonc::log::get
(),
"[ASE] called potential {} times"
,
34
counter
);
35
}
36
37
void
force
(
long
nAtoms,
const
double
*R,
const
int
*atomicNrs,
double
*F,
38
double
*U,
double
*variance,
const
double
*box)
override
;
39
[[nodiscard]]
bool
isThreadSafe
() const noexcept
override
{
return
false
; }
42
[[nodiscard]]
bool
needsPerImageInstance
() const noexcept
override
{
43
return
true
;
44
}
45
[[nodiscard]]
bool
supportsBatchEvaluation
() const noexcept
override
{
46
return
has_batch_
;
47
}
48
void
forceBatch
(
long
nSystems,
long
nAtoms,
const
double
*
const
*positions,
49
const
int
*
const
*atomicNrs,
double
*
const
*forces,
50
double
*energies,
double
*variances,
51
const
double
*
const
*boxes)
override
;
52
};
Potential.h
ASE::needsPerImageInstance
bool needsPerImageInstance() const noexcept override
ASE calculators are independent objects.
Definition
ASE.h:42
ASE::batch_calculate_
py::object batch_calculate_
Definition
ASE.h:27
ASE::~ASE
virtual ~ASE()
Definition
ASE.h:32
ASE::has_batch_
bool has_batch_
Definition
ASE.h:28
ASE::calculator
py::object calculator
Definition
ASE.h:24
ASE::supportsBatchEvaluation
bool supportsBatchEvaluation() const noexcept override
Whether this potential supports batched evaluation of N systems in a single call.
Definition
ASE.h:45
ASE::force
void force(long nAtoms, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override
Definition
ASE.cpp:69
ASE::py_module
py::module_ py_module
Definition
ASE.h:23
ASE::isThreadSafe
bool isThreadSafe() const noexcept override
Whether this potential's force() can be called from multiple threads on the SAME instance.
Definition
ASE.h:39
ASE::forceBatch
void forceBatch(long nSystems, long nAtoms, const double *const *positions, const int *const *atomicNrs, double *const *forces, double *energies, double *variances, const double *const *boxes) override
Definition
ASE.cpp:108
ASE::counter
size_t counter
Definition
ASE.h:22
ASE::_calculate
py::object _calculate
Definition
ASE.h:25
ASE::ASE
ASE(const eonc::Parameters &a_params)
Definition
ASE.cpp:30
eonc::Parameters
Definition
Parameters.h:35
eonc::Potential
Definition
Potential.h:42
eonc::log::get
quill::Logger * get() noexcept
Get or create the default "combi" logger.
Definition
EonLogger.h:44
include
eon
potentials
ASE
ASE.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf