4
// Copyright (C) 2004 Edward Valeev
6
// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
9
// This file is part of the SC Toolkit.
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)
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.
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.
25
// The U.S. Government is granted a limited license as per AL 91-7.
32
#ifndef _chemistry_qc_mbptr12_transformfactory_h
33
#define _chemistry_qc_mbptr12_transformfactory_h
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>
46
class TwoBodyMOIntsTransform;
48
/** MOIntsTransformFactory is a factory that produces MOIntsTransform objects. */
50
class MOIntsTransformFactory : virtual public SavableState {
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 };
59
Ref<MolecularEnergy> top_mole_; // Top-level molecular energy to enable checkpointing
61
Ref<Integral> integral_;
66
Ref<MOIndexSpace> space1_;
67
Ref<MOIndexSpace> space2_;
68
Ref<MOIndexSpace> space3_;
69
Ref<MOIndexSpace> space4_;
73
double print_percent_;
75
StoreMethod ints_method_;
76
std::string file_prefix_;
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();
86
void save_data_state(StateOut&);
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);
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; }
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_; }
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;
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);
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);
135
#include <chemistry/qc/mbptr12/transform_tbint.h>
141
// c-file-style: "CLJ"