Loading...
Searching...
No Matches
testpot.cpp File Reference
#include "eon/Matter.h"
#include "eon/Parameters.h"
#include "eon/Potential.h"
#include "eon/PyGuard.h"
#include <cstdlib>
#include <iostream>
#include <memory>
#include <sstream>

Go to the source code of this file.

Functions

int main ()

Function Documentation

◆ main()

int main ( )

Definition at line 21 of file testpot.cpp.

21 {
22 std::string confile("pos.con");
23 auto params = std::make_shared<eonc::Parameters>();
27 auto pot =
29 auto matter = std::make_unique<eonc::Matter>(pot, params);
30 matter->con2matter(confile);
31 auto [energy, forces] = pot->get_ef(
32 matter->getPositions(), matter->getAtomicNrs(), matter->getCell());
33 std::ostringstream oss;
34 oss << "Got " << energy << "\n" << forces << "\n";
35 std::cout << oss.str();
36 return EXIT_SUCCESS;
37}
std::unique_ptr< Potential > makePotential(const Parameters &params)
Exclusive ownership.
std::shared_ptr< Potential > sharePotential(std::unique_ptr< Potential > pot)
Multi-owner boundary: one instance observed by several Matters, images, or a binding.
Definition Potential.h:292
void ensure_interpreter()
Definition NbGuard.h:21
static potential_options_t & potential_options(Parameters &p)