40 #ifndef ELECTRONICSTRUCTUREAPP_H_
41 #define ELECTRONICSTRUCTUREAPP_H_
64 if (n <= 3 || (n&0x1)) hash = key.
hash();
90 const std::vector<coordT> _specialpts;
93 const bool& periodic,
const std::vector<coordT>& specialpts)
94 : _mentity(mentity), R(R), periodic(periodic), _specialpts(specialpts) {
117 for (
int xr = -1; xr <= 1; xr += 1)
119 double xx = x[0] + xr*R;
121 if (xx < big && xx > -big)
123 for (
int yr = -1; yr <= 1; yr += 1)
125 double yy = x[1] + yr*R;
127 if (yy < big && yy > -big)
129 for (
int zr = -1; zr <= 1; zr += 1)
131 double zz = x[2] + zr*R;
133 if (zz < big && zz > -big)
159 const double rangesq;
163 std::vector<coordT> _specialpts;
170 bool periodic,
const KPoint kpt)
171 : aofunc(aofunc), R(R), rangesq(aofunc.rangesq()*5), periodic(periodic), kpt(kpt)
176 r[0]=x; r[1]=y; r[2]=z;
177 _specialpts=std::vector<coordT>(1,r);
181 tx[ir+
NTRANS] =
exp(std::complex<double>(0.0, kpt.k[0]*ir * R));
182 ty[ir+
NTRANS] =
exp(std::complex<double>(0.0, kpt.k[1]*ir * R));
183 tz[ir+
NTRANS] =
exp(std::complex<double>(0.0, kpt.k[2]*ir * R));
187 virtual std::vector<coordT> special_points()
const
192 std::complex<double> operator()(
const coordT& x)
const
194 std::complex<double> value = 0.0;
197 const double xxR = xx*R + x[0] -r[0];
198 const double xxRsq = xxR*xxR;
199 if (xxRsq < rangesq) {
201 const double yyR = yy*R + x[1] - r[1];
202 const double yyRsq = xxRsq + yyR*yyR;
203 if (yyRsq < rangesq) {
205 double ao = aofunc(xx*R+x[0], yy*R+x[1], zz*R+x[2]);
206 if (
fabs(ao) > 1e-8) {
208 double kx0 = kpt.k[0] * x[0];
209 double kx1 = kpt.k[1] * x[1];
210 double kx2 = kpt.k[2] * x[2];
211 std::complex<double> t2 =
exp(std::complex<double>(0.0, -kx0 - kx1 - kx2));
223 value = aofunc(x[0], x[1], x[2]);
270 return r[0]*r[0] + r[1]*r[1] + r[2]*r[2];
ProcessID owner(const Key< 3 > &key) const
Find the owner of a given key.
Definition: electronicstructureapp.h:60
const mpreal exp(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2234
const double R
Definition: dielectric.cc:191
A pmap that locates children on odd levels with their even level parents.
Definition: funcimpl.h:104
Main include file for MADNESS and defines Function interface.
Definition: eigsolver.h:63
A simple, fixed dimension Coordinate.
Definition: array.h:99
double rsquared(const coordT &r)
Definition: electronicstructureapp.h:269
LevelPmap(World &world)
Definition: electronicstructureapp.h:57
virtual Level special_level()
Override this change level refinement for special points (default is 6)
Definition: electronicstructureapp.h:102
Definition: electronicstructureapp.h:85
Definition: potentialmanager.h:54
Definition: chem/SCF.h:140
Key parent(int generation=1) const
Returns the key of the parent.
Definition: key.h:248
Used to represent one basis function from a shell on a specific center.
Definition: chem/molecularbasis.h:335
Level level() const
Definition: key.h:220
virtual void operator()(const Vector< double *, 1 > &xvals, double *fvals, int npts) const
Definition: function_interface.h:72
double nuclear_attraction_potential(double x, double y, double z) const
Definition: mentity.cc:452
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
std::size_t hashT
The hash value type.
Definition: worldhash.h:148
double smallest_length_scale() const
Definition: mentity.cc:403
int Level
Definition: key.h:58
int ProcessID
Used to clearly identify process number/rank.
Definition: worldtypes.h:37
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:58
double operator()(const coordT &x) const
Definition: electronicstructureapp.h:107
hashT hash() const
Definition: key.h:209
Interface to be provided by any process map.
Definition: worlddc.h:64
#define NTRANS
Definition: electronicstructureapp.h:153
LevelPmap()
Definition: electronicstructureapp.h:55
const mpreal fabs(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2187
double nuclear_charge_density(double x, double y, double z) const
Definition: mentity.cc:469
void get_coords(double &x, double &y, double &z) const
Definition: chem/molecularbasis.h:380
virtual std::vector< coordT > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: electronicstructureapp.h:97
Key is the index for a node of the 2^NDIM-tree.
Definition: key.h:69
MolecularNuclearChargeDensityFunctor(const MolecularEntity &mentity, const double &R, const bool &periodic, const std::vector< coordT > &specialpts)
Definition: electronicstructureapp.h:92