20 #ifndef JDFTX_CORE_GRIDINFO_H 21 #define JDFTX_CORE_GRIDINFO_H 27 #include <core/matrix3.h> 69 enum LatticeModification
77 double a, b, c, alpha, beta,
gamma;
123 fftw_plan getPlan(
PlanType planType,
int nThreads)
const;
134 for(
int k=0; k<3; k++)
136 iGwrapped[k] += S[k];
140 {
return iR[2] + S[2]*(iR[1] + S[1]*iR[0]);
147 return iGwrapped[2] + (S[2]/2+1)*(iGwrapped[1] + S[1]*iGwrapped[0]);
152 void updateSdependent();
155 std::map<std::pair<PlanType,int>,fftw_plan> planCache;
156 static std::mutex planLock;
159 #endif //JDFTX_CORE_GRIDINFO_H void printLattice()
Update the grid information on changing the lattice vectors.
cufftHandle planZ2Z
CUFFT plan for all the complex transforms.
Definition: GridInfo.h:125
int halfGindex(const vector3< int > iG) const
< Index into the half-reduced reciprocal-space box:
Definition: GridInfo.h:145
double gamma
lattice specified by type, modification and standard side lengths, angles in degrees ...
Definition: GridInfo.h:77
Simulation grid descriptor.
Definition: GridInfo.h:45
Real to complex transform.
Definition: GridInfo.h:120
Complex to real transform.
Definition: GridInfo.h:121
cufftHandle planD2Z
CUFFT plan for R -> G.
Definition: GridInfo.h:126
double dV
volume per grid point
Definition: GridInfo.h:97
void setLatticeVectors()
Set lattice vectors based on lattice type, modification and parameters above.
int nr
position space grid count = S[0]*S[1]*S[2]
Definition: GridInfo.h:99
vector3 h[3]
real space sample vectors
Definition: GridInfo.h:98
PlanType
Definition: GridInfo.h:115
double GmaxGrid
recommended maximum G-vector for radial functions for the density grid
Definition: GridInfo.h:104
cufftHandle planZ2D
CUFFT plan for G -> R.
Definition: GridInfo.h:127
double GmaxRho
if non-zero, override the FFT box inscribable sphere radius
Definition: GridInfo.h:84
matrix3 R
directly specified lattice vectors
Definition: GridInfo.h:82
Real and complex scalar fields in real and reciprocal space.
int nG
reciprocal lattice count = S[0]*S[1]*(S[2]/2+1) [on account of using r2c and c2r ffts] ...
Definition: GridInfo.h:100
int fullRindex(const vector3< int > iR) const
< Index into the full real-space box:
Definition: GridInfo.h:139
int fullGindex(const vector3< int > iG) const
< Index into the full reciprocal-space box:
Definition: GridInfo.h:142
vector3< int > S
sample points in each dimension (if 0, will be determined automatically based on Gmax) ...
Definition: GridInfo.h:85
cufftHandle planZ2Dcompat
CUFFT plan for G -> R in FFTW compatibility mode (required when nyquist component is assymetric) ...
Definition: GridInfo.h:128
matrix3 invGGT
various combinations of reciporcal lattice-vectors
Definition: GridInfo.h:95
void initialize(bool skipHeader=false, const std::vector< matrix3< int > > sym=std::vector< matrix3< int > >(1, matrix3< int >(1, 1, 1)))
double GmaxSphere
recommended maximum G-vector for radial functions for the wavefunction sphere
Definition: GridInfo.h:103
Forward complex transform.
Definition: GridInfo.h:116
double detR
cell volume
Definition: GridInfo.h:93
Directly specify R.
Definition: GridInfo.h:57
double dGradial
recommended spacing of radial G functions
Definition: GridInfo.h:102
Forward in-place complex transform.
Definition: GridInfo.h:118
matrix3 invRTR
various combinations of lattice-vectors
Definition: GridInfo.h:94
Inverse in-place complex transform.
Definition: GridInfo.h:119
LatticeType
Print the reciprocal lattice vectors.
Definition: GridInfo.h:56
vector3< int > wrapGcoords(const vector3< int > iG) const
< wrap negative G-indices to the positive side
Definition: GridInfo.h:132
void printReciprocalLattice()
Print the lattice vectors.
vector3 lattScale
Remember lattice scale specified at input (Note R always includes scale, once latt-scale has processe...
Definition: GridInfo.h:80
double Gmax
radius of wavefunction G-sphere, whole density sphere (double the radius) must be inscribable within ...
Definition: GridInfo.h:83
static const double maxAllowedStrain
maximum strain allowed when updating lattice vectors and using update()
Definition: GridInfo.h:105
Inverse complex transform.
Definition: GridInfo.h:117