NonLocalPotential.h 2.3 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
// NonLocalPotential.h
//
////////////////////////////////////////////////////////////////////////////////
Francois Gygi committed
18
// $Id: NonLocalPotential.h,v 1.9 2008-09-08 15:56:18 fgygi Exp $
Francois Gygi committed
19 20 21 22 23 24 25 26 27 28 29 30 31

#ifndef NONLOCALPOTENTIAL_H
#define NONLOCALPOTENTIAL_H

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

class NonLocalPotential
{
  private:
32

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

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

41
  std::vector<int>                  nop;      // nop[is]
42 43 44 45 46 47 48 49
  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
50

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

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

Francois Gygi committed
60
  public:
61 62

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

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