ergo
Main Page
Namespaces
Classes
Files
File List
File Members
scf.h
Go to the documentation of this file.
1
/* Ergo, version 3.2, a program for linear scaling electronic structure
2
* calculations.
3
* Copyright (C) 2012 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek.
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*
18
* Primary academic reference:
19
* KohnâSham Density Functional Theory Electronic Structure Calculations
20
* with Linearly Scaling Computational Time and Memory Usage,
21
* Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek,
22
* J. Chem. Theory Comput. 7, 340 (2011),
23
* <http://dx.doi.org/10.1021/ct100611z>
24
*
25
* For further information about Ergo, see <http://www.ergoscf.org>.
26
*/
27
28
#ifndef SCFHEADER
29
#define SCFHEADER
30
31
#include <string.h>
32
33
#include "
molecule.h
"
34
#include "
basisinfo.h
"
35
#include "
integrals_2el.h
"
36
#include "
matrix_typedefs.h
"
37
38
39
namespace
SCF {
40
41
static
const
int
DISTURB_ELEMENT_MAX_COUNT
= 60;
42
43
struct
Options
{
44
std::string
calculation_identifier
;
45
std::string
method_and_basis_set
;
46
Vector3D
electric_field
;
47
ergo_real
electronic_temperature
;
48
ergo_real
sparse_threshold_for_S
;
49
ergo_real
sparse_threshold_for_Z
;
50
ergo_real
convergence_threshold
;
51
ergo_real
step_length_giveup
;
52
ergo_real
step_length_start
;
53
ergo_real
puri_eig_acc_factor_for_guess
;
54
ergo_real
purification_conv_limit
;
55
ergo_real
purification_eigvalue_err_limit
;
56
ergo_real
purification_subspace_err_limit
;
57
ergo_real
gap_expected_lower_bound
;
58
mat::normType
purification_truncation_norm
;
59
ergo_real
subspace_factor_fock
;
60
ergo_real
subspace_factor_dens
;
61
int
use_artificial_subspace_disturbances
;
62
int
no_of_threads_for_V
;
63
int
purification_maxmul
;
64
int
purification_create_m_files
;
65
int
purification_ignore_failure
;
66
int
purification_use_rand_perturbation_for_alleigsint
;
67
int
use_dft
;
68
int
use_simple_starting_guess
;
69
int
use_diag_guess_from_file
;
70
int
write_diag_dens_to_file
;
71
ergo_real
starting_guess_disturbance
;
72
int
sg_disturb_specific_elements
;
73
int
disturbedElementIndexVector
[
DISTURB_ELEMENT_MAX_COUNT
];
74
ergo_real
shift_using_prev_density_matrix
;
75
int
skip_H_core
;
76
int
use_simple_dense_H_core
;
77
int
break_on_energy_increase
;
78
int
force_restricted
;
79
int
force_unrestricted
;
80
int
spin_flip_atom_count
;
81
int
starting_guess_spin_diff
;
82
int
max_no_of_diis_matrices
;
83
int
max_restart_count
;
84
int
no_of_impr_req_for_diis
;
85
int
use_diis_always
;
86
int
do_f_thresh_verification
;
87
int
do_comparison_to_simple_purification
;
88
int
output_statistics_mfiles
;
89
int
do_sparsity_investigation
;
90
int
do_sparsity_investigation_reppuri
;
91
int
sparsity_plots_resolution_r
;
92
int
sparsity_plots_resolution_m
;
93
int
do_electron_dynamics
;
94
int
no_of_careful_first_scf_steps
;
95
int
do_report_density_diff
;
96
ergo_real
error_maxabs_for_diis
;
97
int
min_number_of_iterations
;
98
int
max_number_of_iterations
;
99
int
output_density_at_every_step
;
100
int
output_csr_matrices_for_gao
;
101
int
output_density_images
;
102
int
output_density_images_only
;
103
int
write_guess_density_only
;
104
ergo_real
output_density_images_boxwidth
;
105
int
image_view_axis
;
106
int
save_final_potential
;
107
int
use_diagonalization
;
108
int
use_diag_on_error
;
109
int
use_diag_on_error_guess
;
110
int
write_overlap_matrix
;
111
int
save_full_matrices_for_matlab
;
112
int
analyze_result_after_scf
;
113
int
do_acc_scan_J
;
114
int
do_acc_scan_K
;
115
int
do_acc_scan_Vxc
;
116
int
scan_do_invcholfactor_transf
;
117
int
scan_no_of_steps
;
118
ergo_real
scan_start_thresh
;
119
ergo_real
scan_step_factor
;
120
int
create_mtx_file_S
;
121
int
create_mtx_files_F
;
122
int
create_mtx_files_D
;
123
int
create_mtx_files_dipole
;
124
int
create_basis_func_coord_file
;
125
int
output_homo_and_lumo_eigenvectors
;
126
int
output_mulliken_pop
;
128
Options
() :
calculation_identifier
(
"N/A"
),
129
method_and_basis_set
(
"N/A"
),
130
electric_field
(0,0,0),
131
electronic_temperature
(0),
132
sparse_threshold_for_S
(1e-9),
133
sparse_threshold_for_Z
(1e-8),
134
convergence_threshold
(2e-7),
135
step_length_giveup
(0.00005),
136
step_length_start
(0.4),
137
puri_eig_acc_factor_for_guess
(1e-2),
138
purification_conv_limit
(0.1),
139
purification_eigvalue_err_limit
(1e-8),
140
purification_subspace_err_limit
(1e-6),
141
gap_expected_lower_bound
(0.05),
142
purification_truncation_norm
(mat::
euclNorm
),
143
subspace_factor_fock
(0.1),
144
subspace_factor_dens
(0.1),
145
use_artificial_subspace_disturbances
(0),
146
no_of_threads_for_V
(1),
147
purification_maxmul
(100),
148
purification_create_m_files
(0),
149
purification_ignore_failure
(0),
150
purification_use_rand_perturbation_for_alleigsint
(0),
151
use_dft
(0),
152
use_simple_starting_guess
(0),
153
use_diag_guess_from_file
(0),
154
write_diag_dens_to_file
(0),
155
starting_guess_disturbance
(0.0),
156
sg_disturb_specific_elements
(0),
157
shift_using_prev_density_matrix
(0.0),
158
skip_H_core
(0),
159
use_simple_dense_H_core
(0),
160
break_on_energy_increase
(0),
161
force_restricted
(0),
162
force_unrestricted
(0),
163
spin_flip_atom_count
(0),
164
starting_guess_spin_diff
(0),
165
max_no_of_diis_matrices
(10),
166
max_restart_count
(2),
167
no_of_impr_req_for_diis
(4),
168
use_diis_always
(0),
169
do_f_thresh_verification
(0),
170
do_comparison_to_simple_purification
(0),
171
output_statistics_mfiles
(0),
172
do_sparsity_investigation
(0),
173
do_sparsity_investigation_reppuri
(0),
174
sparsity_plots_resolution_r
(100),
175
sparsity_plots_resolution_m
(100),
176
do_electron_dynamics
(0),
177
no_of_careful_first_scf_steps
(0),
178
do_report_density_diff
(1),
179
error_maxabs_for_diis
(0.5),
180
min_number_of_iterations
(),
181
max_number_of_iterations
(),
182
output_density_at_every_step
(1),
183
output_csr_matrices_for_gao
(0),
184
output_density_images
(0),
185
output_density_images_only
(0),
186
write_guess_density_only
(0),
187
output_density_images_boxwidth
(0.5),
188
image_view_axis
(),
189
save_final_potential
(0),
190
use_diagonalization
(0),
191
use_diag_on_error
(1),
192
use_diag_on_error_guess
(1),
193
write_overlap_matrix
(0),
194
save_full_matrices_for_matlab
(0),
195
analyze_result_after_scf
(0),
196
do_acc_scan_J
(0),
197
do_acc_scan_K
(0),
198
do_acc_scan_Vxc
(0),
199
scan_do_invcholfactor_transf
(1),
200
scan_no_of_steps
(16),
201
scan_start_thresh
(1e-9),
202
scan_step_factor
(sqrt((
ergo_real
)10)),
203
create_mtx_file_S
(0),
204
create_mtx_files_F
(0),
205
create_mtx_files_D
(0),
206
create_mtx_files_dipole
(0),
207
create_basis_func_coord_file
(0),
208
output_homo_and_lumo_eigenvectors
(0),
209
output_mulliken_pop
(0)
210
{
211
memset(
disturbedElementIndexVector
, 0,
212
sizeof
(
disturbedElementIndexVector
));
213
}
214
};
215
219
struct
MatOptions
{
220
mat::SizesAndBlocks
size_block_info
;
221
std::vector<int>
permutationHML
;
222
std::vector<int>
inversePermutationHML
;
223
ergo_real
sparse_threshold
;
225
ergo_real
threshold_inch
;
226
int
sparse_matrix_block_size
;
227
int
sparse_matrix_block_factor_3
;
228
int
sparse_matrix_block_factor_2
;
229
int
sparse_matrix_block_factor_1
;
230
int
threads
;
231
int
parallelLevel
;
232
233
MatOptions
() :
234
sparse_threshold
(1e-8),
235
threshold_inch
(0),
236
sparse_matrix_block_size
(32),
237
sparse_matrix_block_factor_3
(8),
238
sparse_matrix_block_factor_2
(8),
239
sparse_matrix_block_factor_1
(32),
240
threads
(1),
241
parallelLevel
(1)
242
{};
243
~MatOptions
() {
244
}
247
void
prepare
(
const
BasisInfoStruct
& basisInfo);
248
};
249
250
struct
OutputOptions
{
251
OutputOptions
()
252
{}
253
254
};
255
256
}
/* end of SCF name space */
257
258
259
260
#endif
source
scf
scf.h
Generated on Fri Feb 15 2013 23:35:36 for ergo by
1.8.3.1