Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

mpqcin.h

00001 
00002 #ifndef _mpqcin_h
00003 #define _mpqcin_h
00004 
00005 #include <iostream>
00006 
00007 #include <util/keyval/keyval.h>
00008 #include <chemistry/molecule/molecule.h>
00009 
00010 class MPQCInFlexLexer;
00011 
00012 namespace sc {
00013 
00014 class IPV2;
00015 
00016 template <class T>
00017 class MPQCInDatum {
00018     int set_;
00019     T val_;
00020   public:
00021     MPQCInDatum(const T&v): val_(v), set_(0) {}
00022     const T &operator =(const T&v) { set_ = 1; val_ = v; return val_; }
00023     void reset(const T &val) { set_ = 0; val_ = val; }
00024     int set() const { return set_; }
00025     T val() const { return val_; }
00026 };
00027 
00028 class MPQCIn {
00029     MPQCInFlexLexer *lexer_;
00030     Ref<Molecule> mol_;
00031     MPQCInDatum<int> gradient_;
00032     MPQCInDatum<int> frequencies_;
00033     MPQCInDatum<int> optimize_;
00034     MPQCInDatum<int> mult_;
00035     MPQCInDatum<int> redund_coor_;
00036     MPQCInDatum<int> opt_type_;
00037     MPQCInDatum<int> restart_;
00038     MPQCInDatum<int> checkpoint_;
00039     MPQCInDatum<int> charge_;
00040     MPQCInDatum<int> atom_charge_;
00041     MPQCInDatum<int> molecule_bohr_;
00042     MPQCInDatum<char *> basis_;
00043     MPQCInDatum<char *> method_;
00044     MPQCInDatum<char *> method_xc_;
00045     MPQCInDatum<char *> method_grid_;
00046     MPQCInDatum<char *> symmetry_;
00047     MPQCInDatum<Arrayint *> alpha_;
00048     MPQCInDatum<Arrayint *> beta_;
00049     MPQCInDatum<Arrayint *> docc_;
00050     MPQCInDatum<Arrayint *> socc_;
00051     MPQCInDatum<Arrayint *> frozen_docc_;
00052     MPQCInDatum<Arrayint *> frozen_uocc_;
00053 
00054     int nirrep_;
00055 
00056     void write_energy_object(std::ostream&, const char *keyword,
00057                              const char *method,
00058                              const char *basis, int coor);
00059     void write_basis_object(std::ostream&, const char *keyword,
00060                             const char *basis);
00061     void write_vector(std::ostream &ostrs,
00062                       const char *keyvalname,
00063                       const char *name,
00064                       MPQCInDatum<Arrayint *>&vec,
00065                       int require_nirrep);
00066 
00067     static int checking_;
00068   public:
00069     MPQCIn();
00070     ~MPQCIn();
00071 
00072     char *parse_string(const char *s);
00073     int check_string(const char *s);
00074 
00075     int ylex();
00076     int yparse();
00077     void error(const char* s);
00078     void error2(const char* s, const char* s2);
00079     void yerror(const char* s);
00080     void yerror2(const char* s, const char *);
00081 
00082     void begin_molecule();
00083     void end_molecule();
00084     void add_atom(char *, char *, char *, char *);
00085     void set_charge(char *);
00086     void set_method(char *);
00087     void set_basis(char *);
00088     void set_multiplicity(char *);
00089     void set_optimize(int);
00090     void set_opt_type(int);
00091     void set_atom_charge(char *);
00092     void set_molecule_unit(char *);
00093     void set_method_xc(char *);
00094     void set_method_grid(char *);
00095     void set_symmetry(char *);
00096     void set_redund_coor(int);
00097     void set_gradient(int);
00098     void set_frequencies(int);
00099     void set_restart(int);
00100     void set_checkpoint(int);
00101     void set_molecule_bohr(int);
00102     void set_docc(Arrayint *);
00103     void set_socc(Arrayint *);
00104     void set_alpha(Arrayint *);
00105     void set_beta(Arrayint *);
00106     void set_frozen_docc(Arrayint *);
00107     void set_frozen_uocc(Arrayint *);
00108     Arrayint *make_nnivec(Arrayint *, char *);
00109 
00110     static int checking() { return checking_; }
00111 };
00112 
00113 }
00114 
00115 #endif

Generated at Fri Jan 10 08:14:09 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.