n2p2 - A neural network potential package
EwaldSetup.h
Go to the documentation of this file.
1// n2p2 - A neural network potential package
2// Copyright (C) 2018 Andreas Singraber (University of Vienna)
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#ifndef EWALDSETUP_H
18#define EWALDSETUP_H
19
20//#include "Vec3D.h"
21#include "IEwaldTrunc.h"
22#include "Log.h"
23#include <string>
24#include <vector>
25#include <memory>
26
27
28namespace nnp {
29enum class EWALDTruncMethod {
34};
35
38public:
41 EwaldSetup();
42 void setTruncMethod(EWALDTruncMethod const m);
44 double getMaxCharge() const {return GlobSett.maxCharge;};
45 double getPrecision() const {return GlobSett.precision;};
46
51 void setMaxQSigma(double const maxWidth);
56 void readFromArgs(std::vector<std::string> const& args);
57
63 void toNormalizedUnits(double const convEnergy,
64 double const convLength);
70 void calculateParameters(double const newVolume, size_t const newNumAtoms);
75 void logEwaldCutoffs(Log& log, double const lengthConversion) const;
76
77private:
81
82 std::unique_ptr<IEwaldTrunc> truncImpl;
83
84 bool publishedNewCutoffs() const;
85 bool isEstimateReliable() const;
86};
87
88inline void EwaldSetup::setMaxQSigma(double const maxWidth)
89{
90 GlobSett.maxQSigma = maxWidth;
91}
92
94{
95 truncMethod = m;
96}
97
98}
99#endif //EWALDSETUP_H
Setup data for Ewald summation.
Definition: EwaldSetup.h:37
EwaldParameters params
Definition: EwaldSetup.h:39
EwaldSetup()
Default constructor.
Definition: EwaldSetup.cpp:29
void setTruncMethod(EWALDTruncMethod const m)
Definition: EwaldSetup.h:93
void toNormalizedUnits(double const convEnergy, double const convLength)
Convert cutoff parameters to normalized units.
Definition: EwaldSetup.cpp:74
double getPrecision() const
Definition: EwaldSetup.h:45
void setMaxQSigma(double const maxWidth)
Setter for maximum width of charges.
Definition: EwaldSetup.h:88
EWALDTruncMethod truncMethod
Method for determining real and k space cutoffs.
Definition: EwaldSetup.h:79
EWALDTruncMethod getTruncMethod() const
Definition: EwaldSetup.h:43
void calculateParameters(double const newVolume, size_t const newNumAtoms)
Compute eta, rCut and kCut.
Definition: EwaldSetup.cpp:88
std::unique_ptr< IEwaldTrunc > truncImpl
Definition: EwaldSetup.h:82
bool publishedNewCutoffs() const
Definition: EwaldSetup.cpp:115
void logEwaldCutoffs(Log &log, double const lengthConversion) const
Use after Ewald summation!
Definition: EwaldSetup.cpp:95
EwaldGlobalSettings GlobSett
Definition: EwaldSetup.h:80
bool isEstimateReliable() const
Definition: EwaldSetup.cpp:119
double getMaxCharge() const
Definition: EwaldSetup.h:44
void readFromArgs(std::vector< std::string > const &args)
Setup parameters from argument vector.
Definition: EwaldSetup.cpp:36
Logging class for library output.
Definition: Log.h:34
Definition: Atom.h:29
EWALDTruncMethod
Definition: EwaldSetup.h:29
@ KOLAFA_PERRAM
Method 1: Optimized in n2p2 (DOI: 10.1080/08927029208049126).
@ JACKSON_CATLOW
Method 0: Used by RuNNer (DOI: 10.1080/08927028808080944).