Loading...
Searching...
No Matches
VASP.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
16class VASP : public eonc::Potential {
17
18public:
21 void initialize() {};
22 void cleanMemory();
23 void force(long N, const double *R, const int *atomicNrs, double *F,
24 double *U, double *variance, const double *box) override;
27 [[nodiscard]] bool isThreadSafe() const noexcept override { return false; }
30 [[nodiscard]] bool needsPerImageInstance() const noexcept override {
31 return false;
32 }
42 static void removeStaleFiles();
43
44private:
45 void writePOSCAR(long N, const double *R, const int *atomicNrs,
46 const double *box);
47 void readFU(long N, double *F, double *U);
48 void spawnVASP();
49 bool vaspRunning();
52 static void clearHandshakeFiles();
53 static bool firstRun;
54 static long vaspRunCount;
55 static pid_t vaspPID;
56};
void spawnVASP()
Definition VASP.cpp:144
static long vaspRunCount
Definition VASP.h:54
static void clearHandshakeFiles()
Definition VASP.cpp:102
void initialize()
Definition VASP.h:21
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override
Definition VASP.cpp:219
void writePOSCAR(long N, const double *R, const int *atomicNrs, const double *box)
Definition VASP.cpp:252
void cleanMemory()
Definition VASP.cpp:126
~VASP()
Definition VASP.h:20
static bool firstRun
Definition VASP.h:53
static void removeStaleFiles()
Definition VASP.cpp:114
bool needsPerImageInstance() const noexcept override
Every instance drives the one VASP process named by the static vaspPID through the one set of files,...
Definition VASP.h:30
void readFU(long N, double *F, double *U)
Definition VASP.cpp:312
bool vaspRunning()
Definition VASP.cpp:197
bool isThreadSafe() const noexcept override
force() writes POSCAR, signals through NEWCAR and waits on FU, all at fixed names in the working dire...
Definition VASP.h:27
VASP(const eonc::Parameters &p)
Definition VASP.h:19
static pid_t vaspPID
Definition VASP.h:55
Potential(PotType a_ptype)
Production default: construction-scope registry, else PotRegistry::get().
RAII resource manager for the ARTn C library with global synchronization.