NonLocalPotential.h 2.24 KB
Newer Older
Francois Gygi committed
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3 4 5 6
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// NonLocalPotential.h
//
////////////////////////////////////////////////////////////////////////////////

#ifndef NONLOCALPOTENTIAL_H
#define NONLOCALPOTENTIAL_H

#include "AtomSet.h"
#include "Basis.h"
#include "SlaterDet.h"
#include "Context.h"
#include "Matrix.h"

class NonLocalPotential
{
  private:
31

Francois Gygi committed
32
  const Context& ctxt_;
33
  const AtomSet& atoms_;
Francois Gygi committed
34 35 36 37 38
  const SlaterDet& sd_;
  const Basis& basis_;

  int nsp;   // number of species
  int nspnl; // number of non-local species
39

40
  std::vector<int>                  nop;      // nop[is]
41 42 43 44 45 46 47 48
  std::vector<int>                  lloc;     // lloc[is]
  std::vector<int>                  na;       // na[is]
  std::vector<int>                  npr;      // npr[is]
  std::vector<int>                  nprna;    // nprna[is]
  std::vector<std::vector<int> >    lproj;    // lproj[is][ipr]
  std::vector<std::vector<double> > wt;       // wt[is][ipr]
  std::vector<std::vector<double> > twnl;     // twnl[is][npr*ngwl]
  std::vector<std::vector<double> > dtwnl;    // dtwnl[is][6*npr*ngwl],ij=0,..,5
49

50 51
  std::vector<int>             nquad;    // nquad[is]
  // rquad[is][iquad], iquad = 0, nquad[is]-1
52
  std::vector<std::vector<double> > rquad;
53
  // wquad[is][iquad], iquad = 0, nquad[is]-1
54 55
  std::vector<std::vector<double> > wquad;

Francois Gygi committed
56
  mutable TimerMap tmap;
Francois Gygi committed
57
  void init(void);
58

Francois Gygi committed
59
  public:
60 61

  NonLocalPotential(const AtomSet& as, const SlaterDet& sd) :
62
    ctxt_(sd.context()), atoms_(as), sd_(sd), basis_(sd.basis()) { init(); }
Francois Gygi committed
63
  ~NonLocalPotential(void);
64

Francois Gygi committed
65
  void update_twnl(void);
66 67
  double energy(bool compute_hpsi, SlaterDet& dsd,
    bool compute_forces, std::vector<std::vector<double> >& fion,
68
    bool compute_stress, std::valarray<double>& sigma_enl);
Francois Gygi committed
69 70
};
#endif