Loading...
Searching...
No Matches
ASE_NWCHEM.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#define PYBIND11_DETAILED_ERROR_MESSAGES
14
15#include "eon/Potential.h"
16
17#include <filesystem>
18
19#include <pybind11/eigen.h>
20#include <pybind11/embed.h>
21#include <pybind11/pybind11.h>
22
23namespace py = pybind11;
24using namespace pybind11::literals; // to bring in the `_a` literal
25
26class ASENwchemPot : public Potential {
27
28private:
29 py::object calc;
30 py::object ase;
31 std::filesystem::path workDir;
32 size_t counter{0};
33
34public:
35 ASENwchemPot(const Parameters &a_params);
36 virtual ~ASENwchemPot();
37
38 // Functions
39 void force(long nAtoms, const double *R, const int *atomicNrs, double *F,
40 double *U, double *variance, const double *box) override;
41 [[nodiscard]] bool isThreadSafe() const noexcept override { return false; }
43 [[nodiscard]] bool needsPerImageInstance() const noexcept override {
44 return true;
45 }
46
47 [[nodiscard]] bool requiresIsolatedMoleculeLayout() const noexcept override {
48 return true;
49 }
50};
void force(long nAtoms, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override
virtual ~ASENwchemPot()
bool requiresIsolatedMoleculeLayout() const noexcept override
ASE-NWChem molecular SCF does not support PBC (#188).
Definition ASE_NWCHEM.h:47
std::filesystem::path workDir
Definition ASE_NWCHEM.h:31
py::object calc
Definition ASE_NWCHEM.h:29
bool isThreadSafe() const noexcept override
Whether this potential's force() can be called from multiple threads on the SAME instance.
Definition ASE_NWCHEM.h:41
bool needsPerImageInstance() const noexcept override
NWChem runs as external subprocess; separate instances are independent.
Definition ASE_NWCHEM.h:43
py::object ase
Definition ASE_NWCHEM.h:30
ASENwchemPot(const Parameters &a_params)
size_t counter
Definition ASE_NWCHEM.h:32
Potential(PotType a_ptype)
Definition Potential.h:35