WavefunctionHandler.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 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 committed
33 34 35
  Wavefunction& wf_;
  DoubleMatrix& gfdata_;
  UnitCell uc;
36
  UnitCell ruc;
Francois Gygi committed
37
  double ecut;
38
  int nx_, ny_, nz_;
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;
  int& current_gfdata_pos_;
43
  std::vector<double> dmat_;
Francois Gygi committed
44 45
  double current_kx, current_ky, current_kz, current_weight;
  int current_size;
Francois Gygi committed
46 47
  int read_from_gfdata;
  FourierTransform* ft;
48
  std::vector<std::complex<double> > wftmp;
49

Francois Gygi committed
50 51 52
  void byteswap_double(size_t n, double* x);

  public:
53

Francois Gygi committed
54 55 56 57 58
  // 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
59
  virtual void endElement(const XMLCh* const uri, const XMLCh* const localname,
60
      const XMLCh* const qname, std::string& content);
61

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

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

72 73
  WavefunctionHandler(Wavefunction& wf, DoubleMatrix& gfdata,
    int& current_gfdata_pos);
Francois Gygi committed
74 75 76
  ~WavefunctionHandler();
};
#endif