1 #ifndef MOLECULAR_MASK_H
2 #define MOLECULAR_MASK_H
11 double x =
a[0] -
b[0];
12 double y =
a[1] -
b[1];
13 double z =
a[2] -
b[2];
14 return sqrt(x*x + y*y + z*z);
32 return (r - center)*(1.0/
distance(r,center));
36 double mask(
double s)
const {
37 if (s > 6.0)
return 0.0;
38 else if (s < -6.0)
return 1.0;
39 else return 0.5*erfc(s);
50 if (fabs(s) > 6.0)
return 0.0;
51 return -exp(-s*s)*fac;
76 std::vector<double>
m(
natom);
78 for (
int i=0; i<
natom; i++) {
87 for (
int i=0; i<
natom; i++) {
107 std::vector< madness::Vector<double,3> >
v;
109 for (
int t=0; t<=npt; t++) {
111 for (
int p=0;
p<2*npt;
p++) {
113 const double xx = std::sin(theta)*std::cos(phi);
114 const double yy = std::sin(theta)*std::sin(phi);
115 const double zz = std::cos(theta);
116 for (
int i=0; i<
natom; i++) {
120 v.push_back({x,y,z});
122 if (t==0 || t==npt)
break;
142 for (
int i=0; i<
natom; i++) {
166 for (
int i=0; i<
natom; i++) {
210 const std::vector<double> atomic_radii,
211 const std::vector<madness::coord_3d> atomic_coords)
217 if (
Vint <= 0 ||
Vext <= 0)
throw "Only works for positive values";
222 if (
c == 0.0)
return Vint;
223 else if (
c == 1.0)
return Vext;
239 const std::vector<double> atomic_radii,
240 const std::vector<madness::coord_3d> atomic_coords)
241 :
s(
sigma, Vint, Vext, atomic_radii, atomic_coords)
302 const std::vector<double> atomic_radii,
303 const std::vector<madness::coord_3d> atomic_coords,
305 :
g(
sigma, atomic_radii, atomic_coords, i)
306 ,
fac(log(Vint/Vext))
308 if (Vint <= 0 || Vext <= 0)
throw "Only works for positive values";
Definition: molecularmask.h:18
const std::vector< double > atomic_radii
Definition: molecularmask.h:21
MolecularMaskBase(double sigma, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:95
madness::coord_3d grad_sdf(const madness::coord_3d &r, const madness::coord_3d ¢er) const
Definition: molecularmask.h:31
double sdf(const madness::coord_3d &r, const madness::coord_3d ¢er, double R) const
Definition: molecularmask.h:26
madness::coord_3d grad_atomic_mask(const madness::coord_3d &r, unsigned int i) const
Definition: molecularmask.h:68
double cmask(double s) const
Definition: molecularmask.h:43
std::vector< madness::Vector< double, 3 > > special_points() const
Definition: molecularmask.h:106
double atomic_cmask(const madness::coord_3d &r, unsigned int i) const
Definition: molecularmask.h:62
const double sigma
Definition: molecularmask.h:20
const std::vector< madness::coord_3d > atomic_coords
Definition: molecularmask.h:22
double atomic_mask(const madness::coord_3d &r, unsigned int i) const
Definition: molecularmask.h:55
const int natom
Definition: molecularmask.h:23
madness::coord_3d gradient(const madness::coord_3d &r) const
Definition: molecularmask.h:74
double mask(double s) const
Definition: molecularmask.h:36
double dmask(double s) const
Definition: molecularmask.h:48
Definition: molecularmask.h:253
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:261
MolecularSurface(double sigma, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:255
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:266
Definition: molecularmask.h:156
MolecularVolumeComplementMask(double sigma, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:158
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:164
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:172
Returns the requested component of the derivative of the log of MolecularVolumeExponentialSwitch.
Definition: molecularmask.h:295
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:311
const double fac
Definition: molecularmask.h:297
MolecularVolumeExponentialSwitchLogGrad(double sigma, double Vint, double Vext, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords, int i)
Definition: molecularmask.h:299
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:315
const MolecularVolumeMaskGrad g
Definition: molecularmask.h:296
Computes the reciprocal of MolecularVolumeExponentialSwitch.
Definition: molecularmask.h:233
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:244
MolecularVolumeExponentialSwitchReciprocal(double sigma, double Vint, double Vext, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:236
const MolecularVolumeExponentialSwitch s
Definition: molecularmask.h:234
Switches between positive values Vint and Vext with special log derivative.
Definition: molecularmask.h:203
const double fac
Definition: molecularmask.h:205
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:220
MolecularVolumeExponentialSwitch(double sigma, double Vint, double Vext, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:207
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:227
const MolecularVolumeComplementMask cmask
Definition: molecularmask.h:204
const double Vint
Definition: molecularmask.h:205
const double Vext
Definition: molecularmask.h:205
Definition: molecularmask.h:273
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:284
MolecularVolumeMaskGrad(double sigma, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords, int i)
Definition: molecularmask.h:276
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:289
const int i
Definition: molecularmask.h:274
Definition: molecularmask.h:132
std::vector< madness::Vector< double, 3 > > special_points() const
Override this to return list of special points to be refined more deeply.
Definition: molecularmask.h:148
virtual double operator()(const madness::coord_3d &r) const
Definition: molecularmask.h:140
MolecularVolumeMask(double sigma, const std::vector< double > atomic_radii, const std::vector< madness::coord_3d > atomic_coords)
Definition: molecularmask.h:134
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:68
Defines common mathematical and physical constants.
static const double R
Definition: csqrt.cc:46
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition: derivatives.cc:72
const double sigma
Definition: dielectric.cc:185
const double m
Definition: gfit.cc:199
static const double v
Definition: hatom_sf_dirac.cc:20
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition: madness_exception.h:134
double distance(const madness::coord_3d &a, const madness::coord_3d &b)
Definition: molecularmask.h:10
Main include file for MADNESS and defines Function interface.
const double pi
Mathematical constant .
Definition: constants.h:48
std::vector< Function< T, NDIM > > grad(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
shorthand gradient operator
Definition: vmra.h:1818
Vector< double, 3 > coord_3d
Definition: funcplot.h:1042
static const double b
Definition: nonlinschro.cc:119
static const double a
Definition: nonlinschro.cc:118
static const double c
Definition: relops.cc:10
void e()
Definition: test_sig.cc:75