JDFTx  1.2.0
Blip.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_ELECTRONIC_BLIP_H
21 #define JDFTX_ELECTRONIC_BLIP_H
22 
23 #include <core/ScalarField.h>
24 #include <core/vector3.h>
25 #include <core/WignerSeitz.h>
26 
27 //PW to blip conversion utility
28 //To use, create an object:
29 // BlipConverter convert(Nx,Ny,Nz);
30 //and conversions can be done as:
31 // vBlip = convert(vPW);
33 {
34  vector3<int> S;
35  std::vector<double> gamma[3];
36 public:
37  BlipConverter(const vector3<int>& S);
38 
39  //Given a PW basis object (in real or reciprocal space) v,
40  //return corresponding real-space Blip coefficient set
41  // (for double or complex vectors)
42  ScalarField operator()(const ScalarFieldTilde& v) const;
43  ScalarField operator()(const ScalarField& v) const;
44  complexScalarField operator()(const complexScalarFieldTilde& v) const;
45  complexScalarField operator()(const complexScalarField& v) const;
46 };
47 
53 { const GridInfo& gInfoOut;
54  BlipConverter converter;
55  WignerSeitz wsIn;
56  WignerSeitz wsOut;
57 public:
58  BlipResampler(const GridInfo& gInfoIn, const GridInfo& gInfoOut);
59 
60  ScalarField operator()(const ScalarFieldTilde& v) const;
61  complexScalarField operator()(const complexScalarFieldTilde& v) const;
62 };
63 
64 //Compute the kinetic energy for a blip orbital phi (and set max local KE and location in unit cell)
65 double Tblip(const complexScalarField& phi, double* tMax=0, int* i0max=0, int* i1max=0, int*i2max=0);
66 
67 //Compute the local potential energy for blip orbital phi in blip potential V
68 double Vblip(const complexScalarField& phi, const ScalarField& V);
69 
70 #endif // JDFTX_ELECTRONIC_BLIP_H
Definition: Blip.h:32
Simulation grid descriptor.
Definition: GridInfo.h:45
std::shared_ptr< ScalarFieldTildeData > ScalarFieldTilde
A smart reference-counting pointer to ScalarFieldTildeData.
Definition: ScalarField.h:45
Real and complex scalar fields in real and reciprocal space.
std::shared_ptr< complexScalarFieldTildeData > complexScalarFieldTilde
A smart reference-counting pointer to complexScalarFieldTildeData.
Definition: ScalarField.h:47
Wigner-Seitz construction for a 3D lattice (2D lattice may be handled with orthogonal 3rd direction) ...
Definition: WignerSeitz.h:32
std::shared_ptr< complexScalarFieldData > complexScalarField
A smart reference-counting pointer to complexScalarFieldData.
Definition: ScalarField.h:46
Definition: Blip.h:52
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41