eOn client
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
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
28
public
:
29
ASE
(
const
Parameters
&a_params);
30
virtual
~ASE
() {
31
QUILL_LOG_INFO(
eonc::log::get
(),
"[ASE] called potential {} times"
,
32
counter
);
33
}
34
35
void
force
(
long
nAtoms,
const
double
*R,
const
int
*atomicNrs,
double
*F,
36
double
*U,
double
*variance,
const
double
*box)
override
;
37
[[nodiscard]]
bool
isThreadSafe
() const noexcept
override
{
return
false
; }
40
[[nodiscard]]
bool
needsPerImageInstance
() const noexcept
override
{
41
return
true
;
42
}
43
};
Potential.h
ASE::needsPerImageInstance
bool needsPerImageInstance() const noexcept override
ASE calculators are independent objects.
Definition
ASE.h:40
ASE::~ASE
virtual ~ASE()
Definition
ASE.h:30
ASE::calculator
py::object calculator
Definition
ASE.h:24
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:64
ASE::py_module
py::module_ py_module
Definition
ASE.h:23
ASE::ASE
ASE(const Parameters &a_params)
Definition
ASE.cpp:26
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:37
ASE::counter
size_t counter
Definition
ASE.h:22
ASE::_calculate
py::object _calculate
Definition
ASE.h:25
eonc::Parameters
Definition
Parameters.h:28
eonc::Potential::Potential
Potential(PotType a_ptype)
Definition
Potential.h:35
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