JDFTx  1.2.0
Coulomb_ExchangeEval.h
1 /*-------------------------------------------------------------------
2 Copyright 2012 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_CORE_COULOMB_EXCHANGEEVAL_H
21 #define JDFTX_CORE_COULOMB_EXCHANGEEVAL_H
22 
23 #include <core/Coulomb.h>
24 #include <core/Coulomb_internal.h>
25 
28 {
29  ExchangeEval(const GridInfo& gInfo, const CoulombParams& params, const Coulomb& coulomb, double omega);
30  ~ExchangeEval();
31  complexScalarFieldTilde operator()(complexScalarFieldTilde&& in, vector3<> kDiff) const;
32 
33 private:
34  const GridInfo& gInfo;
35  double omega;
36 
37  //Shorthand for combinations of regularization method and geometry
38  enum KernelMode
39  { PeriodicKernel, //regularization = None/AuxiliaryFunction/ProbeChargeEwald, with geometry = Periodic
40  SphericalKernel, //regularization = SphericalTruncated, or regularization = None and geometry = Spherical
41  SlabKernel, //regularization = None/AuxiliaryFunction/ProbeChargeEwald with geometry = Slab
42  WignerSeitzGammaKernel, //regularization = None and geometry = Isolated
43  NumericalKernel //regularization = WignerSeitzTruncated, or regularization = None/AuxiliaryFunction/ProbeChargeEwald with geometry = Wire/Cylinder
44  } kernelMode;
45 
46  //For all analytic modes (None, AuxiliaryFunction, SphericalTruncated):
47  double Vzero; //G=0 term (0, the auxiliary correction, and the G=0 limit respectively)
48  //For spherical mode
49  double Rc;
50  ExchangeSphericalScreened_calc sphericalScreenedCalc; //for screened exchange
51  //For slab mode:
52  ExchangeSlab_calc slabCalc;
53  //For Wigner-Seitz Gamma-only truncated mode:
54  RealKernel* VcGamma; //Gamma-point-only kernel (used for Isolated geometry (with no need for regularization))
55  //For precomputed numerical kernel mode:
56  std::vector< vector3<> > dkArr; //list of allowed k-point differences (modulo integer offsets)
57  double* kernelData; //data for all the kernels (either on the CPU or GPU, as appropriate)
58 };
59 
60 #endif // JDFTX_CORE_COULOMB_EXCHANGEEVAL_H
Simulation grid descriptor.
Definition: GridInfo.h:45
Helper class for evaluating regularized Coulomb kernel for exchange.
Definition: Coulomb_ExchangeEval.h:27
Erfc-screened Spherical-truncated exchange.
Definition: Coulomb_internal.h:159
Definition: Coulomb.h:29
std::shared_ptr< complexScalarFieldTildeData > complexScalarFieldTilde
A smart reference-counting pointer to complexScalarFieldTildeData.
Definition: ScalarField.h:47
Shared inline functions / internal declarations for Coulomb framework.
Abstract base class for the (optionally truncated) Coulomb interaction.
Definition: Coulomb.h:101
Slab-truncated exchange.
Definition: Coulomb_internal.h:173
Special class for storing real reciprocal-space kernels encountered ever so often for convolutions...
Definition: ScalarField.h:180