WavefunctionHandler.h 2.25 KB
Newer Older
Francois Gygi's avatar
Francois Gygi committed
1
2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi's avatar
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's avatar
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's avatar
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's avatar
Francois Gygi committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// WavefunctionHandler.h
//
////////////////////////////////////////////////////////////////////////////////

#ifndef WavefunctionHANDLER_H
#define WavefunctionHANDLER_H

#include "StructureHandler.h"
#include "UnitCell.h"
#include "Wavefunction.h"
#include "SlaterDet.h"

class FourierTransform;

class WavefunctionHandler : public StructureHandler
{
  private:
32

Francois Gygi's avatar
Francois Gygi committed
33
34
35
  Wavefunction& wf_;
  DoubleMatrix& gfdata_;
  UnitCell uc;
36
  UnitCell ruc;
Francois Gygi's avatar
Francois Gygi committed
37
  double ecut;
38
  int nx_, ny_, nz_;
Francois Gygi's avatar
Francois Gygi committed
39
  int current_gf_nx,current_gf_ny,current_gf_nz;
40
  std::string current_gf_encoding;
41
42
  int current_ispin,current_ikp;
  std::vector<double> dmat_;
Francois Gygi's avatar
Francois Gygi committed
43
44
  double current_kx, current_ky, current_kz, current_weight;
  int current_size;
Francois Gygi's avatar
Francois Gygi committed
45
46
  int read_from_gfdata;
  FourierTransform* ft;
47
  std::vector<std::complex<double> > wftmp;
48

Francois Gygi's avatar
Francois Gygi committed
49
50
51
  void byteswap_double(size_t n, double* x);

  public:
52

Francois Gygi's avatar
Francois Gygi committed
53
54
55
56
57
  // Start of the root element in the structure being handled
  virtual void startElement(const XMLCh* const uri,const XMLCh* const localname,
      const XMLCh* const qname, const Attributes& attributes);

  // End of the root element in the structure being handled
58
  virtual void endElement(const XMLCh* const uri, const XMLCh* const localname,
59
      const XMLCh* const qname, std::string& content);
60

Francois Gygi's avatar
Francois Gygi committed
61
62
  // start a subhandler
  virtual StructureHandler* startSubHandler(const XMLCh* const uri,
63
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi's avatar
Francois Gygi committed
64
    const Attributes& attributes);
65

Francois Gygi's avatar
Francois Gygi committed
66
67
  // end a subhandler
  virtual void endSubHandler(const XMLCh* const uri,
68
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi's avatar
Francois Gygi committed
69
70
    const StructureHandler* const subHandler);

71
  WavefunctionHandler(Wavefunction& wf, DoubleMatrix& gfdata);
Francois Gygi's avatar
Francois Gygi committed
72
73
74
  ~WavefunctionHandler();
};
#endif