WfDyn.h 1.76 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
// WfDyn.h
//
////////////////////////////////////////////////////////////////////////////////
Francois Gygi committed
18
// $Id: WfDyn.h,v 1.9 2009-09-08 05:38:31 fgygi Exp $
Francois Gygi committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

#ifndef WFDYN_H
#define WFDYN_H

#include<iostream>
#include<iomanip>
#include<sstream>
#include<stdlib.h>

#include "Sample.h"
#include "Wavefunction.h"
#include "SlaterDet.h"

class WfDyn : public Var
{
  Sample *s;

  public:

38
  const char *name ( void ) const { return "wf_dyn"; };
Francois Gygi committed
39 40 41 42 43 44 45 46 47

  int set ( int argc, char **argv )
  {
    if ( argc != 2 )
    {
      if ( ui->onpe0() )
      cout << " wf_dyn takes only one value" << endl;
      return 1;
    }
48

Francois Gygi committed
49
    string v = argv[1];
50
    if ( !( v == "LOCKED" || v == "SD" || v == "PSD" ||
Francois Gygi committed
51
            v == "PSDA" || v == "JD" || v == "MD" ) )
Francois Gygi committed
52 53
    {
      if ( ui->onpe0() )
Francois Gygi committed
54
        cout << " wf_dyn must be in [LOCKED,SD,PSD,PSDA,JD,MD]" << endl;
Francois Gygi committed
55 56 57 58
      return 1;
    }

    s->ctrl.wf_dyn = v;
59

Francois Gygi committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    return 0;
  }

  string print (void) const
  {
     ostringstream st;
     st.setf(ios::left,ios::adjustfield);
     st << setw(10) << name() << " = ";
     st.setf(ios::right,ios::adjustfield);
     st << setw(10) << s->ctrl.wf_dyn;
     return st.str();
  }

  WfDyn(Sample *sample) : s(sample) { s->ctrl.wf_dyn = "SD"; };
};
#endif