MPQC  2.3.1
transform_factory.h
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 
50 class MOIntsTransformFactory : virtual public SavableState {
51 
52 public:
53 
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 
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);
85 
86  void save_data_state(StateOut&);
87 
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 
93  void set_top_mole(const Ref<MolecularEnergy>& top_mole) { top_mole_ = top_mole; }
95  void set_ints_method(const StoreMethod method) { ints_method_ = method; }
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 
104  Ref<Integral> integral() const { return integral_; };
106  const StoreMethod ints_method() const { return ints_method_; }
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 
115  Ref<MOIndexSpace> space1() const;
117  Ref<MOIndexSpace> space2() const;
119  Ref<MOIndexSpace> space3() const;
121  Ref<MOIndexSpace> space4() const;
122 
125  Ref<TwoBodyMOIntsTransform> twobody_transform_13(const std::string& id);
126 
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 
sc::MOIntsTransformFactory::set_file_prefix
void set_file_prefix(const std::string &prefix)
Sets the name of the file to hold the integrals.
Definition: transform_factory.h:97
sc::MOIntsTransformFactory
MOIntsTransformFactory is a factory that produces MOIntsTransform objects.
Definition: transform_factory.h:50
sc::MOIntsTransformFactory::ints_method
const StoreMethod ints_method() const
Returns the method of storing transformed MO integrals.
Definition: transform_factory.h:106
sc::Ref
A template class that maintains references counts.
Definition: ref.h:332
sc::MOIntsTransformFactory::file_prefix
const std::string file_prefix() const
Sets the name of the file to hold the integrals.
Definition: transform_factory.h:108
sc::StateIn
Restores objects that derive from SavableState.
Definition: statein.h:70
sc::MOIntsTransformFactory::set_top_mole
void set_top_mole(const Ref< MolecularEnergy > &top_mole)
Specifies the top-level MolecularEnergy object to use for checkpointing.
Definition: transform_factory.h:93
sc::StateOut
Serializes objects that derive from SavableState.
Definition: stateout.h:61
sc::MOIntsTransformFactory::StoreMethod
StoreMethod
Describes the method of storing transformed MO integrals.
Definition: transform_factory.h:55
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:46
sc::MOIntsTransformFactory::integral
Ref< Integral > integral() const
Returns the Integral factory.
Definition: transform_factory.h:104
sc::MOIntsTransformFactory::set_ints_method
void set_ints_method(const StoreMethod method)
Sets the method of storing transformed MO integrals. Default method is mem_posix.
Definition: transform_factory.h:95

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.