35#ifndef MADNESS_CHEM_COREPOTENTIAL_H__INCLUDED
36#define MADNESS_CHEM_COREPOTENTIAL_H__INCLUDED
69 std::vector<double>
A;
70 std::vector<double>
alpha;
73 CorePotential() : l(), n(),
A(),
alpha() {};
74 CorePotential(
const std::vector<int>& l,
75 const std::vector<int>& n,
76 const std::vector<double>&
A,
77 const std::vector<double>&
alpha)
80 double eval(
double r)
const;
82 double eval_derivative(
double xi,
double r)
const;
86 template <
typename Archive>
95 vector<double> coeff, expnt;
98 CoreOrbital() : Bc(0),
type(0), coeff(), expnt(), rsqmax(0.0) {}
100 const std::vector<double>& coeff,
101 const std::vector<double>& expnt,
103 : Bc(Bc),
type(
type), coeff(coeff), expnt(expnt)
105 double minexpnt = expnt[0];
106 for (
unsigned int i=1; i<expnt.size(); ++i)
107 minexpnt = std::min(minexpnt,expnt[i]);
108 rsqmax = 18.4/minexpnt;
111 double eval_radial(
double rsq)
const;
113 double eval_radial_derivative(
double rsq,
double xi)
const;
115 double eval_spherical_harmonics(
int m,
double x,
double y,
double z,
double& dp,
int axis)
const;
117 double eval(
int m,
double rsq,
double x,
double y,
double z)
const;
119 double eval_derivative(
int m,
int axis,
double xi,
double rsq,
double x,
double y,
double z)
const;
121 template <
typename Archive>
123 ar & Bc &
type & rsqmax;
129 unsigned int atomic_number;
131 std::vector<CoreOrbital> orbital;
134 AtomCore() : atomic_number(0), ncore(0), orbital(),
potential() {};
136 inline unsigned int n_orbital()
const {
return ncore; };
138 template <
typename Archive>
140 ar & atomic_number & ncore;
142 for (std::vector<CoreOrbital>::iterator it=orbital.begin(); it != orbital.end(); ++it) {
148class CorePotentialManager {
149 static const double fc;
150 std::string core_type;
151 std::string guess_filename;
152 std::map<unsigned int,AtomCore> atom_core;
156 CorePotentialManager() :
161 CorePotentialManager(std::string filename,
double eprec) : core_type(filename) {
162 read_file(filename, std::set<unsigned int>(),
eprec);
165 inline bool is_defined(
const unsigned int atn)
const {
166 return (atom_core.find(atn) != atom_core.end());
169 inline unsigned int n_core_orb(
const unsigned int atn)
const {
170 return (*(atom_core.find(atn))).second.n_orbital();
173 inline unsigned int n_core_orb_base(
const unsigned int atn)
const {
174 return (*(atom_core.find(atn))).second.orbital.size();
177 inline std::string guess_file()
const {
return guess_filename; }
179 AtomCore get_atom_core(
unsigned int atn)
const {
180 return atom_core.find(atn)->second;
183 CorePotential get_potential(
unsigned int atn)
const {
184 return atom_core.find(atn)->second.potential;
187 inline unsigned int get_core_l(
unsigned int atn,
unsigned int core)
const {
188 return get_atom_core(atn).orbital[core].type;
191 inline double get_core_bc(
unsigned int atn,
unsigned int core)
const {
192 return get_atom_core(atn).orbital[core].Bc*fc/2;
195 inline double core_eval(
unsigned int atn,
unsigned int core,
int m,
double rsq,
double x,
double y,
double z)
const {
196 return get_atom_core(atn).orbital[core].eval(
m, rsq, x, y, z);
199 inline double core_derivative(
unsigned int atn,
unsigned int core,
int m,
int axis,
double xi,
double rsq,
double x,
double y,
double z)
const {
200 return get_atom_core(atn).orbital[core].eval_derivative(
m,
axis,
xi, rsq, x, y, z);
203 double potential(
unsigned int atn,
double r)
const {
204 AtomCore ac = (*(atom_core.find(atn))).second;
205 return ac.potential.eval(r);
208 double potential_derivative(
unsigned int atn,
double xi,
double r)
const {
209 AtomCore ac = (*(atom_core.find(atn))).second;
210 return ac.potential.eval_derivative(
xi, r);
213 void read_file(std::string filename, std::set<unsigned int> atomset,
double eprec);
215 void set_eprec(
double value);
217 void set_rcut(
double value);
219 template <
typename Archive>
223 for (std::map<unsigned int, AtomCore>::iterator it=atom_core.begin(); it != atom_core.end(); ++it) {
224 ar & it->first & it->second;
double potential(const coord_3d &r)
Definition 3dharmonic.cc:132
real_convolution_3d A(World &world)
Definition DKops.h:230
Declaration of utility class and functions for atom.
Defines common mathematical and physical constants.
std::enable_if_t< ! is_default_serializable< Archive, T >::value &&is_archive< Archive >::value, void > serialize(const Archive &ar, const T *t, std::size_t n)
Serialize (or deserialize) an array of non-fundamental stuff.
Definition archive.h:498
static const double rcut
Definition hatom_sf_dirac.cc:19
static const double eprec
Definition hatom_sf_dirac.cc:18
Macros and tools pertaining to the configuration of MADNESS.
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
std::string to_string(const Representation r)
Definition Restart.h:64
std::string type(const PairType &n)
Definition PNOParameters.h:18
Defines simple templates for printing to std::cout "a la Python".
static const double m
Definition relops.cc:9
const double xi
Exponent for delta function approx.
Definition siam_example.cc:60
void e()
Definition test_sig.cc:75
static const double alpha
Definition testcosine.cc:10
std::size_t axis
Definition testpdiff.cc:59