00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _util_misc_grid_h
00024 #define _util_misc_grid_h
00025
00026 #ifdef __GNUC__
00027 #pragma interface
00028 #endif
00029
00030 #include <chemistry/molecule/molecule.h>
00031 #include <util/class/class.h>
00032 #include <util/misc/runnable.h>
00033 #include <util/misc/units.h>
00034
00035
00036 namespace sc {
00037
00040 class Grid: public DescribedClass {
00041 public:
00042 int numx;
00043 int numy;
00044 int numz;
00045 SCVector3 origin;
00046 SCVector3 axisx;
00047 SCVector3 axisy;
00048 SCVector3 axisz;
00049 Ref<Units> unit;
00080 Grid(const Ref<KeyVal> &);
00081 };
00082
00085 class WriteGrid: public Runnable {
00086 private:
00087 void wf_mpqc(std::ostream &out);
00088 void wf_gaussian_cube(std::ostream &out);
00089 void wf_vtk2(std::ostream &out);
00090 void wf_mpqc_raw(std::ostream &out);
00091 protected:
00092 std::string filename_;
00093 Ref<Grid> grid_;
00094 std::string format_;
00095 void (WriteGrid::*write_format_)(std::ostream &out);
00098 virtual void initialize() = 0;
00103 virtual void label(char* buffer) = 0;
00105 virtual Ref<Molecule> get_molecule() = 0;
00107 virtual double calculate_value(SCVector3 point) = 0;
00108 public:
00132 WriteGrid(const Ref<KeyVal> &);
00134 void run();
00135 };
00136
00137 }
00138
00139 #endif
00140
00141
00142
00143
00144