n2p2 - A neural network potential package
IEwaldTrunc.h
Go to the documentation of this file.
1//
2// Created by philipp on 2/17/23.
3//
4
5#ifndef N2P2_IEWALDTRUNC_H
6#define N2P2_IEWALDTRUNC_H
7
8#include <cstddef> // std::size_t
9
10namespace nnp
11{
13 {
14 double precision = 1.0E-6;
15 double maxCharge = 1.0;
16 double maxQSigma = 1.0;
19 double fourPiEps = 1.0;
20 };
21
23 {
24 public:
25 EwaldStructureData(double const V, std::size_t const N)
26 : volume{V}, numAtoms{N}
27 {};
29
30 double getVolume() const { return volume; };
31 std::size_t getNumAtoms() const { return numAtoms; };
32 private:
33 double volume = 0.0;
34 std::size_t numAtoms = 0;
35 };
36
38 {
40 double eta = 0.0;
42 double rCut = 0.0;
44 double kCut = 0.0;
45
46 EwaldParameters() = default;
47 EwaldParameters(double oEta, double oRCut, double oKCut)
48 : eta{oEta}, rCut{oRCut}, kCut{oKCut}
49 {}
50
51 EwaldParameters toPhysicalUnits(double const convLength) const
52 {
53 return EwaldParameters{eta / convLength,
54 rCut / convLength,
55 kCut * convLength};
56 }
57 EwaldParameters toNormalizedUnits(double const convLength) const
58 {
59 return toPhysicalUnits(1/convLength);
60 }
61 };
62
64 {
65 public:
66 virtual void calculateParameters(EwaldGlobalSettings const& settings,
67 EwaldStructureData const& sData,
68 EwaldParameters &params) = 0;
69 virtual bool publishedNewCutoffs() = 0;
70 virtual bool isEstimateReliable(
71 EwaldGlobalSettings const& settings,
72 EwaldParameters const& params) const = 0;
73 virtual ~IEwaldTrunc() = default;
74 };
75}
76#endif //N2P2_IEWALDTRUNC_H
EwaldStructureData(double const V, std::size_t const N)
Definition: IEwaldTrunc.h:25
double getVolume() const
Definition: IEwaldTrunc.h:30
std::size_t getNumAtoms() const
Definition: IEwaldTrunc.h:31
virtual ~IEwaldTrunc()=default
virtual bool isEstimateReliable(EwaldGlobalSettings const &settings, EwaldParameters const &params) const =0
virtual void calculateParameters(EwaldGlobalSettings const &settings, EwaldStructureData const &sData, EwaldParameters &params)=0
virtual bool publishedNewCutoffs()=0
Definition: Atom.h:29
double fourPiEps
Multiplicative constant .
Definition: IEwaldTrunc.h:19
EwaldParameters()=default
EwaldParameters toPhysicalUnits(double const convLength) const
Definition: IEwaldTrunc.h:51
double rCut
Cutoff in real space.
Definition: IEwaldTrunc.h:42
double eta
Width of the gaussian screening charges.
Definition: IEwaldTrunc.h:40
EwaldParameters toNormalizedUnits(double const convLength) const
Definition: IEwaldTrunc.h:57
double kCut
Cutoff in reciprocal space.
Definition: IEwaldTrunc.h:44
EwaldParameters(double oEta, double oRCut, double oKCut)
Definition: IEwaldTrunc.h:47