n2p2 - A neural network potential package
Kspace.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 KSPACE_H
18#define KSPACE_H
19
20#include "Vec3D.h"
21#include "EwaldSetup.h"
22#include <vector> // std::vector
23
24namespace nnp
25{
26
28{
29public:
33 double knorm2;
35 double coeff;
36
38 Kvector();
40 Kvector(Vec3D v);
41};
42
44{
45public:
47 double eta;
49 double kCut;
51 double rCut;
53 double volume;
55 double pre;
57 int n[3];
61 std::vector<Kvector> kvectors;
62
64 KspaceGrid();
70 void setup(Vec3D box[3], EwaldSetup& ewaldSetup);
71
72private:
79 void calculatePbcCopies(double cutoffRadius);
80};
81
82}
83
84#endif
85
Setup data for Ewald summation.
Definition: EwaldSetup.h:37
std::vector< Kvector > kvectors
Vector containing all k-vectors.
Definition: Kspace.h:61
double pre
Ewald sum prefactor .
Definition: Kspace.h:55
Vec3D kbox[3]
Reciprocal box vectors.
Definition: Kspace.h:59
void setup(Vec3D box[3], EwaldSetup &ewaldSetup)
Set up reciprocal box vectors and eta.
Definition: Kspace.cpp:45
double rCut
Cutoff in real space.
Definition: Kspace.h:51
KspaceGrid()
Constructor.
Definition: Kspace.cpp:38
double eta
Ewald summation eta parameter.
Definition: Kspace.h:47
void calculatePbcCopies(double cutoffRadius)
Compute box copies in each direction.
Definition: Kspace.cpp:86
double volume
Volume of real box.
Definition: Kspace.h:53
double kCut
Cutoff in reciprocal space.
Definition: Kspace.h:49
int n[3]
Required box copies in each box vector direction.
Definition: Kspace.h:57
Vec3D k
A single k-vector (as Vec3D).
Definition: Kspace.h:31
Kvector()
Constructor.
Definition: Kspace.cpp:26
double coeff
Precomputed coefficient for Ewald summation.
Definition: Kspace.h:35
double knorm2
Square of norm of k-vector.
Definition: Kspace.h:33
Definition: Atom.h:29
Vector in 3 dimensional real space.
Definition: Vec3D.h:30