# transform_factory.h

    00001 //
    00002 // transform_factory.h
    00003 //
    00004 // Copyright (C) 2004 Edward Valeev
    00005 //
    00006 // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
    00007 // Maintainer: EV
    00008 //
    00009 // This file is part of the SC Toolkit.
    00010 //
    00011 // The SC Toolkit is free software; you can redistribute it and/or modify
    00012 // it under the terms of the GNU Library General Public License as published by
    00013 // the Free Software Foundation; either version 2, or (at your option)
    00014 // any later version.
    00015 //
    00016 // The SC Toolkit is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00019 // GNU Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public License
    00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
    00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00024 //
    00025 // The U.S. Government is granted a limited license as per AL 91-7.
    00026 //
    00027
    00028 #ifdef __GNUG__
    00029 #pragma interface
    00030 #endif
    00031
    00032 #ifndef _chemistry_qc_mbptr12_transformfactory_h
    00033 #define _chemistry_qc_mbptr12_transformfactory_h
    00034
    00035 #include <string>
    00036 #include <util/ref/ref.h>
    00037 #include <util/group/memory.h>
    00038 #include <chemistry/molecule/energy.h>
    00039 #include <chemistry/qc/basis/integral.h>
    00040 #include <chemistry/qc/mbptr12/moindexspace.h>
    00041
    00042 using namespace std;
    00043
    00044 namespace sc {
    00045
    00046 class TwoBodyMOIntsTransform;
    00047
    00050 class MOIntsTransformFactory : virtual public SavableState {
    00051
    00052 public:
    00053
    00055   enum StoreMethod { mem_posix = 0, posix = 1, mem_mpi = 2, mpi = 3, mem_only = 4 };
    00056
    00057 private:
    00058
    00059   Ref<MolecularEnergy> top_mole_;   // Top-level molecular energy to enable checkpointing
    00060
    00061   Ref<Integral> integral_;
    00062   Ref<MessageGrp> msg_;
    00063   Ref<MemoryGrp> mem_;
    00064   Ref<ThreadGrp> thr_;
    00065
    00066   Ref<MOIndexSpace> space1_;
    00067   Ref<MOIndexSpace> space2_;
    00068   Ref<MOIndexSpace> space3_;
    00069   Ref<MOIndexSpace> space4_;
    00070
    00071   size_t memory_;
    00072   bool dynamic_;
    00073   double print_percent_;
    00074   int debug_;
    00075   StoreMethod ints_method_;
    00076   std::string file_prefix_;
    00077
    00078 public:
    00079
    00080   MOIntsTransformFactory(StateIn&);
    00081   MOIntsTransformFactory(const Ref<Integral>& integral,
    00082                          const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2 = 0,
    00083                          const Ref<MOIndexSpace>& space3 = 0, const Ref<MOIndexSpace>& space4 = 0);
    00084   ~MOIntsTransformFactory();
    00085
    00086   void save_data_state(StateOut&);
    00087
    00089   void set_spaces(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2 = 0,
    00090                   const Ref<MOIndexSpace>& space3 = 0, const Ref<MOIndexSpace>& space4 = 0);
    00091
    00093   void set_top_mole(const Ref<MolecularEnergy>& top_mole) { top_mole_ = top_mole; }
    00095   void set_ints_method(const StoreMethod method) { ints_method_ = method; }
    00097   void set_file_prefix(const std::string& prefix) { file_prefix_ = prefix; }
    00098   void set_debug(int debug) { debug_ = debug; }
    00099   void set_dynamic(bool dynamic) { dynamic_ = dynamic; }
    00100   void set_print_percent(double print_percent) { print_percent_ = print_percent; }
    00101   void set_memory(size_t nbytes) { memory_ = nbytes; }
    00102
    00104   Ref<Integral> integral() const { return integral_; };
    00106   const StoreMethod ints_method() const { return ints_method_; }
    00108   const std::string file_prefix() const { return file_prefix_; }
    00109   const int debug() const { return debug_; }
    00110   const bool dynamic() const { return dynamic_; }
    00111   const double print_percent() const { return print_percent_; }
    00112   const size_t memory() const { return memory_; }
    00113
    00115   Ref<MOIndexSpace> space1() const;
    00117   Ref<MOIndexSpace> space2() const;
    00119   Ref<MOIndexSpace> space3() const;
    00121   Ref<MOIndexSpace> space4() const;
    00122
    00125   Ref<TwoBodyMOIntsTransform> twobody_transform_13(const std::string& id);
    00126
    00129   Ref<TwoBodyMOIntsTransform> twobody_transform_12(const std::string& id);
    00130
    00131 };
    00132
    00133 }
    00134
    00135 #include <chemistry/qc/mbptr12/transform_tbint.h>
    00136
    00137 #endif
    00138
    00139 // Local Variables:
    00140 // mode: c++
    00141 // c-file-style: "CLJ"
    00142 // End:
    00143
    00144