| 1 | //
|
|---|
| 2 | // transform_factory.h
|
|---|
| 3 | //
|
|---|
| 4 | // Copyright (C) 2004 Edward Valeev
|
|---|
| 5 | //
|
|---|
| 6 | // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
|
|---|
| 7 | // Maintainer: EV
|
|---|
| 8 | //
|
|---|
| 9 | // This file is part of the SC Toolkit.
|
|---|
| 10 | //
|
|---|
| 11 | // The SC Toolkit is free software; you can redistribute it and/or modify
|
|---|
| 12 | // it under the terms of the GNU Library General Public License as published by
|
|---|
| 13 | // the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 14 | // any later version.
|
|---|
| 15 | //
|
|---|
| 16 | // The SC Toolkit is distributed in the hope that it will be useful,
|
|---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | // GNU Library General Public License for more details.
|
|---|
| 20 | //
|
|---|
| 21 | // You should have received a copy of the GNU Library General Public License
|
|---|
| 22 | // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
|
|---|
| 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 24 | //
|
|---|
| 25 | // The U.S. Government is granted a limited license as per AL 91-7.
|
|---|
| 26 | //
|
|---|
| 27 |
|
|---|
| 28 | #ifdef __GNUG__
|
|---|
| 29 | #pragma interface
|
|---|
| 30 | #endif
|
|---|
| 31 |
|
|---|
| 32 | #ifndef _chemistry_qc_mbptr12_transformfactory_h
|
|---|
| 33 | #define _chemistry_qc_mbptr12_transformfactory_h
|
|---|
| 34 |
|
|---|
| 35 | #include <string>
|
|---|
| 36 | #include <util/ref/ref.h>
|
|---|
| 37 | #include <util/group/memory.h>
|
|---|
| 38 | #include <chemistry/molecule/energy.h>
|
|---|
| 39 | #include <chemistry/qc/basis/integral.h>
|
|---|
| 40 | #include <chemistry/qc/mbptr12/moindexspace.h>
|
|---|
| 41 |
|
|---|
| 42 | using namespace std;
|
|---|
| 43 |
|
|---|
| 44 | namespace sc {
|
|---|
| 45 |
|
|---|
| 46 | class TwoBodyMOIntsTransform;
|
|---|
| 47 |
|
|---|
| 48 | /** MOIntsTransformFactory is a factory that produces MOIntsTransform objects. */
|
|---|
| 49 |
|
|---|
| 50 | class MOIntsTransformFactory : virtual public SavableState {
|
|---|
| 51 |
|
|---|
| 52 | public:
|
|---|
| 53 |
|
|---|
| 54 | /// Describes the method of storing transformed MO integrals.
|
|---|
| 55 | enum StoreMethod { mem_posix = 0, posix = 1, mem_mpi = 2, mpi = 3, mem_only = 4 };
|
|---|
| 56 |
|
|---|
| 57 | private:
|
|---|
| 58 |
|
|---|
| 59 | Ref<MolecularEnergy> top_mole_; // Top-level molecular energy to enable checkpointing
|
|---|
| 60 |
|
|---|
| 61 | Ref<Integral> integral_;
|
|---|
| 62 | Ref<MessageGrp> msg_;
|
|---|
| 63 | Ref<MemoryGrp> mem_;
|
|---|
| 64 | Ref<ThreadGrp> thr_;
|
|---|
| 65 |
|
|---|
| 66 | Ref<MOIndexSpace> space1_;
|
|---|
| 67 | Ref<MOIndexSpace> space2_;
|
|---|
| 68 | Ref<MOIndexSpace> space3_;
|
|---|
| 69 | Ref<MOIndexSpace> space4_;
|
|---|
| 70 |
|
|---|
| 71 | size_t memory_;
|
|---|
| 72 | bool dynamic_;
|
|---|
| 73 | double print_percent_;
|
|---|
| 74 | int debug_;
|
|---|
| 75 | StoreMethod ints_method_;
|
|---|
| 76 | std::string file_prefix_;
|
|---|
| 77 |
|
|---|
| 78 | public:
|
|---|
| 79 |
|
|---|
| 80 | MOIntsTransformFactory(StateIn&);
|
|---|
| 81 | MOIntsTransformFactory(const Ref<Integral>& integral,
|
|---|
| 82 | const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2 = 0,
|
|---|
| 83 | const Ref<MOIndexSpace>& space3 = 0, const Ref<MOIndexSpace>& space4 = 0);
|
|---|
| 84 | ~MOIntsTransformFactory();
|
|---|
| 85 |
|
|---|
| 86 | void save_data_state(StateOut&);
|
|---|
| 87 |
|
|---|
| 88 | /// Sets the orbital spaces
|
|---|
| 89 | void set_spaces(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2 = 0,
|
|---|
| 90 | const Ref<MOIndexSpace>& space3 = 0, const Ref<MOIndexSpace>& space4 = 0);
|
|---|
| 91 |
|
|---|
| 92 | /// Specifies the top-level MolecularEnergy object to use for checkpointing
|
|---|
| 93 | void set_top_mole(const Ref<MolecularEnergy>& top_mole) { top_mole_ = top_mole; }
|
|---|
| 94 | /// Sets the method of storing transformed MO integrals. Default method is mem_posix.
|
|---|
| 95 | void set_ints_method(const StoreMethod method) { ints_method_ = method; }
|
|---|
| 96 | /// Sets the name of the file to hold the integrals.
|
|---|
| 97 | void set_file_prefix(const std::string& prefix) { file_prefix_ = prefix; }
|
|---|
| 98 | void set_debug(int debug) { debug_ = debug; }
|
|---|
| 99 | void set_dynamic(bool dynamic) { dynamic_ = dynamic; }
|
|---|
| 100 | void set_print_percent(double print_percent) { print_percent_ = print_percent; }
|
|---|
| 101 | void set_memory(size_t nbytes) { memory_ = nbytes; }
|
|---|
| 102 |
|
|---|
| 103 | /// Returns the Integral factory
|
|---|
| 104 | Ref<Integral> integral() const { return integral_; };
|
|---|
| 105 | /// Returns the method of storing transformed MO integrals.
|
|---|
| 106 | const StoreMethod ints_method() const { return ints_method_; }
|
|---|
| 107 | /// Sets the name of the file to hold the integrals.
|
|---|
| 108 | const std::string file_prefix() const { return file_prefix_; }
|
|---|
| 109 | const int debug() const { return debug_; }
|
|---|
| 110 | const bool dynamic() const { return dynamic_; }
|
|---|
| 111 | const double print_percent() const { return print_percent_; }
|
|---|
| 112 | const size_t memory() const { return memory_; }
|
|---|
| 113 |
|
|---|
| 114 | /// Returns MOIndexSpace object 1
|
|---|
| 115 | Ref<MOIndexSpace> space1() const;
|
|---|
| 116 | /// Returns MOIndexSpace object 2
|
|---|
| 117 | Ref<MOIndexSpace> space2() const;
|
|---|
| 118 | /// Returns MOIndexSpace object 3
|
|---|
| 119 | Ref<MOIndexSpace> space3() const;
|
|---|
| 120 | /// Returns MOIndexSpace object 4
|
|---|
| 121 | Ref<MOIndexSpace> space4() const;
|
|---|
| 122 |
|
|---|
| 123 | /** Creates an TwoBodyMOIntsTransform object that will compute (pq|rs) integrals
|
|---|
| 124 | stored in qs blocks for each pr */
|
|---|
| 125 | Ref<TwoBodyMOIntsTransform> twobody_transform_13(const std::string& id);
|
|---|
| 126 |
|
|---|
| 127 | /** Creates an TwoBodyMOIntsTransform object that will compute (pq|rs) integrals
|
|---|
| 128 | stored in rs blocks for each pq */
|
|---|
| 129 | Ref<TwoBodyMOIntsTransform> twobody_transform_12(const std::string& id);
|
|---|
| 130 |
|
|---|
| 131 | };
|
|---|
| 132 |
|
|---|
| 133 | }
|
|---|
| 134 |
|
|---|
| 135 | #include <chemistry/qc/mbptr12/transform_tbint.h>
|
|---|
| 136 |
|
|---|
| 137 | #endif
|
|---|
| 138 |
|
|---|
| 139 | // Local Variables:
|
|---|
| 140 | // mode: c++
|
|---|
| 141 | // c-file-style: "CLJ"
|
|---|
| 142 | // End:
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|