22#include <rapidxml.hpp> 
   30namespace pseudopotential {
 
   35  KLEINMAN_BYLANDER = 32,
 
   42  FORMAT_NOT_SUPPORTED = 456,
 
   44  UNSUPPORTED_TYPE_ULTRASOFT = 458,
 
   45  UNSUPPORTED_TYPE_PAW = 459,
 
   46  UNSUPPORTED_TYPE = 460
 
   74enum class correlation {
 
   90  virtual pseudopotential::type type()
 const { 
return type_; }
 
   91  virtual int lmax()
 const { 
return lmax_; }
 
   94  virtual pseudopotential::format format() 
const = 0;
 
   95  virtual int size() 
const = 0;
 
   98  virtual int atomic_number() 
const = 0;
 
   99  virtual double mass() 
const = 0;
 
  100  virtual double valence_charge() 
const = 0;
 
  101  virtual int llocal() 
const = 0;
 
  102  virtual int nchannels() 
const = 0;
 
  103  virtual double mesh_spacing() 
const = 0;
 
  104  virtual int mesh_size() 
const = 0;
 
  105  virtual void local_potential(std::vector<double> &potential) 
const = 0;
 
  106  virtual int nprojectors() 
const = 0;
 
  107  virtual int nprojectors_per_l(
int l) 
const = 0;
 
  108  virtual void projector(
int l, 
int i, std::vector<double> &proj) 
const = 0;
 
  109  virtual double d_ij(
int l, 
int i, 
int j) 
const = 0;
 
  110  virtual bool has_radial_function(
int l) 
const = 0;
 
  111  virtual void radial_function(
int l, std::vector<double> &function) 
const = 0;
 
  112  virtual void radial_potential(
int l, std::vector<double> &function) 
const = 0;
 
  114  virtual void grid(std::vector<double> &val)
 const {
 
  115    val.resize(mesh_size());
 
  116    for (
unsigned ii = 0; ii < val.size(); ii++)
 
  117      val[ii] = ii * mesh_spacing();
 
  120  virtual void grid_weights(std::vector<double> &val)
 const {
 
  121    val.resize(mesh_size());
 
  122    for (
unsigned ii = 1; ii < val.size() - 1; ii++)
 
  123      val[ii] = mesh_spacing();
 
  124    val[0] = 0.5 * mesh_spacing();
 
  125    val[val.size() - 1] = 0.5 * mesh_spacing();
 
  129  virtual int nquad()
 const { 
return 0; }
 
  130  virtual double rquad()
 const { 
return 0.0; }
 
  131  virtual bool has_nlcc()
 const { 
return false; }
 
  132  virtual void nlcc_density(std::vector<double> &
density)
 const {
 
  135  virtual void beta(
int index, 
int &
l, std::vector<double> &proj)
 const {
 
  139  virtual void dnm_zero(
int nbeta,
 
  140                        std::vector<std::vector<double>> &dnm)
 const {
 
  143  virtual bool has_rinner()
 const { 
return false; }
 
  144  virtual void rinner(std::vector<double> &val)
 const { val.clear(); }
 
  145  virtual void qnm(
int index, 
int &l1, 
int &l2, 
int &n, 
int &m,
 
  146                   std::vector<double> &val)
 const {
 
  149  virtual void qfcoeff(
int index, 
int ltot, std::vector<double> &val)
 const {
 
  152  virtual bool has_density()
 const { 
return false; }
 
  153  virtual void density(std::vector<double> &val)
 const { val.clear(); }
 
  154  virtual int nwavefunctions()
 const { 
return 0; }
 
  155  virtual void wavefunction(
int index, 
int &n, 
int &
l, 
double &occ,
 
  156                            std::vector<double> &val)
 const {
 
  159  virtual pseudopotential::exchange exchange()
 const {
 
  160    return pseudopotential::exchange::UNKNOWN;
 
  162  virtual pseudopotential::correlation correlation()
 const {
 
  163    return pseudopotential::correlation::UNKNOWN;
 
  166  virtual bool has_total_angular_momentum()
 const { 
return false; }
 
  167  virtual int projector_2j(
int l, 
int ic)
 const {
 
  170  virtual int wavefunction_2j(
int ii)
 const {
 
  177  template <
typename Type> 
static Type value(
const rapidxml::xml_base<> *node) {
 
  179    std::istringstream stst(node->value());
 
  185  pseudopotential::type type_;
 
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug when !prints out the assertion string
 
integer, parameter, public density
 
integer, parameter, public mass
 
const int *restrict index