35 #ifndef MADNESS_COREPOTENTIAL_H
36 #define MADNESS_COREPOTENTIAL_H
43 #include <moldft/atomutil.h>
67 std::vector<double>
A;
68 std::vector<double>
alpha;
73 const std::vector<int>& n,
74 const std::vector<double>& A,
75 const std::vector<double>& alpha)
76 : l(l), n(n), A(A), alpha(alpha), eprec(1e-4), rcut0(1.0), rcut(1.0) {};
78 double eval(
double r)
const;
84 template <
typename Archive>
86 ar & l & n & A & alpha & eprec & rcut0 &
rcut;
96 CoreOrbital() : Bc(0), type(0), coeff(), expnt(), rsqmax(0.0) {}
98 const std::vector<double>& coeff,
99 const std::vector<double>& expnt,
101 : Bc(Bc), type(type), coeff(coeff), expnt(expnt)
103 double minexpnt = expnt[0];
104 for (
unsigned int i=1; i<expnt.size(); ++i)
105 minexpnt =
std::min(minexpnt,expnt[i]);
106 rsqmax = 18.4/minexpnt;
115 double eval(
int m,
double rsq,
double x,
double y,
double z)
const;
117 double eval_derivative(
int m,
int axis,
double xi,
double rsq,
double x,
double y,
double z)
const;
119 template <
typename Archive>
129 std::vector<CoreOrbital>
orbital;
132 AtomCore() : atomic_number(0), ncore(0), orbital(), potential() {};
136 template <
typename Archive>
138 ar & atomic_number &
ncore;
140 for (std::vector<CoreOrbital>::iterator it=orbital.begin(); it != orbital.end(); ++it) {
147 static const double fc;
150 std::map<unsigned int,AtomCore> atom_core;
160 read_file(filename, std::set<unsigned int>(), eprec);
164 return (atom_core.find(atn) != atom_core.end());
167 inline unsigned int n_core_orb(
const unsigned int atn)
const {
168 return (*(atom_core.find(atn))).second.n_orbital();
172 return (*(atom_core.find(atn))).second.orbital.size();
178 return atom_core.find(atn)->second;
182 return atom_core.find(atn)->second.potential;
185 inline unsigned int get_core_l(
unsigned int atn,
unsigned int core)
const {
189 inline double get_core_bc(
unsigned int atn,
unsigned int core)
const {
193 inline double core_eval(
unsigned int atn,
unsigned int core,
int m,
double rsq,
double x,
double y,
double z)
const {
197 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 {
202 AtomCore ac = (*(atom_core.find(atn))).second;
207 AtomCore ac = (*(atom_core.find(atn))).second;
217 template <
typename Archive>
221 for (std::map<unsigned int, AtomCore>::iterator it=atom_core.begin(); it != atom_core.end(); ++it) {
222 ar & it->first & it->second;
double rcut
Definition: DFcode/corepotential.h:69
void read_file(std::string filename, std::set< unsigned int > atomset, double eprec)
std::vector< int > n
Definition: DFcode/corepotential.h:66
CorePotential(const std::vector< int > &l, const std::vector< int > &n, const std::vector< double > &A, const std::vector< double > &alpha)
Definition: jacob/corepotential.h:72
double eval_radial(double rsq) const
double rcut0
Definition: DFcode/corepotential.h:69
std::string to_string() const
void serialize(Archive &ar)
Definition: jacob/corepotential.h:137
std::string guess_file() const
Definition: jacob/corepotential.h:175
double eprec
Definition: DFcode/corepotential.h:69
CorePotential get_potential(unsigned int atn) const
Definition: jacob/corepotential.h:181
vector< double > expnt
Definition: DFcode/corepotential.h:93
::std::string string
Definition: gtest-port.h:872
Defines common mathematical and physical constants.
double core_derivative(unsigned int atn, unsigned int core, int m, int axis, double xi, double rsq, double x, double y, double z) const
Definition: jacob/corepotential.h:197
Definition: DFcode/corepotential.h:146
void set_eprec(double value)
double eval(int m, double rsq, double x, double y, double z) const
void serialize(Archive &ar)
Definition: jacob/corepotential.h:85
AtomCore()
Definition: jacob/corepotential.h:132
double rsqmax
Definition: DFcode/corepotential.h:94
double core_eval(unsigned int atn, unsigned int core, int m, double rsq, double x, double y, double z) const
Definition: jacob/corepotential.h:193
CoreOrbital()
Definition: jacob/corepotential.h:96
Definition: DFcode/corepotential.h:126
double eval_derivative(double xi, double r) const
AtomCore get_atom_core(unsigned int atn) const
Definition: jacob/corepotential.h:177
std::vector< CoreOrbital > orbital
Definition: DFcode/corepotential.h:129
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
double eval_derivative(int m, int axis, double xi, double rsq, double x, double y, double z) const
double potential_derivative(unsigned int atn, double xi, double r) const
Definition: jacob/corepotential.h:206
unsigned int atomic_number
Definition: DFcode/corepotential.h:127
CorePotentialManager()
Definition: jacob/corepotential.h:154
unsigned int n_orbital() const
Definition: jacob/corepotential.h:134
int type
Definition: DFcode/corepotential.h:92
CorePotential potential
Definition: DFcode/corepotential.h:130
vector< double > coeff
Definition: DFcode/corepotential.h:93
Represents a core potential.
Definition: DFcode/corepotential.h:64
void set_rcut(double value)
double potential(unsigned int atn, double r) const
Definition: jacob/corepotential.h:201
const double m
Definition: gfit.cc:199
unsigned int get_core_l(unsigned int atn, unsigned int core) const
Definition: jacob/corepotential.h:185
Defines simple templates for printing to std::cout "a la Python".
double eval_spherical_harmonics(int m, double x, double y, double z, double &dp, int axis) const
CorePotential()
Definition: jacob/corepotential.h:71
unsigned int ncore
Definition: DFcode/corepotential.h:128
double get_core_bc(unsigned int atn, unsigned int core) const
Definition: jacob/corepotential.h:189
std::vector< double > alpha
Definition: DFcode/corepotential.h:68
double Bc
Definition: DFcode/corepotential.h:91
void serialize(Archive &ar)
Definition: jacob/corepotential.h:120
CoreOrbital(int type, const std::vector< double > &coeff, const std::vector< double > &expnt, double Bc)
Definition: jacob/corepotential.h:97
void serialize(Archive &ar)
Definition: jacob/corepotential.h:218
double eval(double r) const
unsigned int n_core_orb_base(const unsigned int atn) const
Definition: jacob/corepotential.h:171
std::vector< int > l
Angular momentum = 0, 1, 2, ...
Definition: DFcode/corepotential.h:65
Definition: DFcode/corepotential.h:90
bool is_defined(const unsigned int atn) const
Definition: jacob/corepotential.h:163
std::vector< double > A
Definition: DFcode/corepotential.h:67
unsigned int n_core_orb(const unsigned int atn) const
Definition: jacob/corepotential.h:167
CorePotentialManager(std::string filename, double eprec)
Definition: jacob/corepotential.h:159
double eval_radial_derivative(double rsq, double xi) const