Loading...
Searching...
No Matches
testpot.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/Matter.h"
13#include "eon/Parameters.h"
14#include "eon/Potential.h"
15#include "eon/PyGuard.h"
16#include <cstdlib>
17#include <iostream>
18#include <memory>
19#include <sstream>
20
21int main() {
22 std::string confile("pos.con");
23 auto params = std::make_shared<eonc::Parameters>();
25 ParametersLoadAccess::potential_options(*params).potential =
27 auto pot = eonc::helpers::makePotential(params);
28 auto matter = std::make_unique<eonc::Matter>(pot, params);
29 matter->con2matter(confile);
30 auto [energy, forces] = pot->get_ef(
31 matter->getPositions(), matter->getAtomicNrs(), matter->getCell());
32 std::ostringstream oss;
33 oss << "Got " << energy << "\n" << forces << "\n";
34 std::cout << oss.str();
35 return EXIT_SUCCESS;
36}
std::shared_ptr< Potential > makePotential(const Parameters &params)
void ensure_interpreter()
Definition NbGuard.h:21
int main()
Definition testpot.cpp:21