ergo
|
00001 /* Ergo, version 3.2, a program for linear scaling electronic structure 00002 * calculations. 00003 * Copyright (C) 2012 Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek. 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 * 00018 * Primary academic reference: 00019 * KohnâSham Density Functional Theory Electronic Structure Calculations 00020 * with Linearly Scaling Computational Time and Memory Usage, 00021 * Elias Rudberg, Emanuel H. Rubensson, and Pawel Salek, 00022 * J. Chem. Theory Comput. 7, 340 (2011), 00023 * <http://dx.doi.org/10.1021/ct100611z> 00024 * 00025 * For further information about Ergo, see <http://www.ergoscf.org>. 00026 */ 00027 00028 #ifndef SCFHEADER 00029 #define SCFHEADER 00030 00031 #include <string.h> 00032 00033 #include "molecule.h" 00034 #include "basisinfo.h" 00035 #include "integrals_2el.h" 00036 #include "matrix_typedefs.h" 00037 00038 00039 namespace SCF { 00040 00041 static const int DISTURB_ELEMENT_MAX_COUNT = 60; 00042 00043 struct Options { 00044 std::string calculation_identifier; 00045 std::string method_and_basis_set; 00046 Vector3D electric_field; 00047 ergo_real electronic_temperature; 00048 ergo_real sparse_threshold_for_S; 00049 ergo_real sparse_threshold_for_Z; 00050 ergo_real convergence_threshold; 00051 ergo_real step_length_giveup; 00052 ergo_real step_length_start; 00053 ergo_real puri_eig_acc_factor_for_guess; 00054 ergo_real purification_conv_limit; 00055 ergo_real purification_eigvalue_err_limit; 00056 ergo_real purification_subspace_err_limit; 00057 ergo_real gap_expected_lower_bound; 00058 mat::normType purification_truncation_norm; 00059 ergo_real subspace_factor_fock; 00060 ergo_real subspace_factor_dens; 00061 int use_artificial_subspace_disturbances; 00062 int no_of_threads_for_V; 00063 int purification_maxmul; 00064 int purification_create_m_files; 00065 int purification_ignore_failure; 00066 int purification_use_rand_perturbation_for_alleigsint; 00067 int use_dft; 00068 int use_simple_starting_guess; 00069 int use_diag_guess_from_file; 00070 int write_diag_dens_to_file; 00071 ergo_real starting_guess_disturbance; 00072 int sg_disturb_specific_elements; 00073 int disturbedElementIndexVector[DISTURB_ELEMENT_MAX_COUNT]; 00074 ergo_real shift_using_prev_density_matrix; 00075 int skip_H_core; 00076 int use_simple_dense_H_core; 00077 int break_on_energy_increase; 00078 int force_restricted; 00079 int force_unrestricted; 00080 int spin_flip_atom_count; 00081 int starting_guess_spin_diff; 00082 int max_no_of_diis_matrices; 00083 int max_restart_count; 00084 int no_of_impr_req_for_diis; 00085 int use_diis_always; 00086 int do_f_thresh_verification; 00087 int do_comparison_to_simple_purification; 00088 int output_statistics_mfiles; 00089 int do_sparsity_investigation; 00090 int do_sparsity_investigation_reppuri; 00091 int sparsity_plots_resolution_r; 00092 int sparsity_plots_resolution_m; 00093 int do_electron_dynamics; 00094 int no_of_careful_first_scf_steps; 00095 int do_report_density_diff; 00096 ergo_real error_maxabs_for_diis; 00097 int min_number_of_iterations; 00098 int max_number_of_iterations; 00099 int output_density_at_every_step; 00100 int output_csr_matrices_for_gao; 00101 int output_density_images; 00102 int output_density_images_only; 00103 int write_guess_density_only; 00104 ergo_real output_density_images_boxwidth; 00105 int image_view_axis; 00106 int save_final_potential; 00107 int use_diagonalization; 00108 int use_diag_on_error; 00109 int use_diag_on_error_guess; 00110 int write_overlap_matrix; 00111 int save_full_matrices_for_matlab; 00112 int analyze_result_after_scf; 00113 int do_acc_scan_J; 00114 int do_acc_scan_K; 00115 int do_acc_scan_Vxc; 00116 int scan_do_invcholfactor_transf; 00117 int scan_no_of_steps; 00118 ergo_real scan_start_thresh; 00119 ergo_real scan_step_factor; 00120 int create_mtx_file_S; 00121 int create_mtx_files_F; 00122 int create_mtx_files_D; 00123 int create_mtx_files_dipole; 00124 int create_basis_func_coord_file; 00125 int output_homo_and_lumo_eigenvectors; 00126 int output_mulliken_pop; 00128 Options() : calculation_identifier("N/A"), 00129 method_and_basis_set("N/A"), 00130 electric_field(0,0,0), 00131 electronic_temperature(0), 00132 sparse_threshold_for_S(1e-9), 00133 sparse_threshold_for_Z(1e-8), 00134 convergence_threshold(2e-7), 00135 step_length_giveup(0.00005), 00136 step_length_start(0.4), 00137 puri_eig_acc_factor_for_guess(1e-2), 00138 purification_conv_limit(0.1), 00139 purification_eigvalue_err_limit(1e-8), 00140 purification_subspace_err_limit(1e-6), 00141 gap_expected_lower_bound(0.05), 00142 purification_truncation_norm(mat::euclNorm), 00143 subspace_factor_fock(0.1), 00144 subspace_factor_dens(0.1), 00145 use_artificial_subspace_disturbances(0), 00146 no_of_threads_for_V(1), 00147 purification_maxmul(100), 00148 purification_create_m_files(0), 00149 purification_ignore_failure(0), 00150 purification_use_rand_perturbation_for_alleigsint(0), 00151 use_dft(0), 00152 use_simple_starting_guess(0), 00153 use_diag_guess_from_file(0), 00154 write_diag_dens_to_file(0), 00155 starting_guess_disturbance(0.0), 00156 sg_disturb_specific_elements(0), 00157 shift_using_prev_density_matrix(0.0), 00158 skip_H_core(0), 00159 use_simple_dense_H_core(0), 00160 break_on_energy_increase(0), 00161 force_restricted(0), 00162 force_unrestricted(0), 00163 spin_flip_atom_count(0), 00164 starting_guess_spin_diff(0), 00165 max_no_of_diis_matrices(10), 00166 max_restart_count(2), 00167 no_of_impr_req_for_diis(4), 00168 use_diis_always(0), 00169 do_f_thresh_verification(0), 00170 do_comparison_to_simple_purification(0), 00171 output_statistics_mfiles(0), 00172 do_sparsity_investigation(0), 00173 do_sparsity_investigation_reppuri(0), 00174 sparsity_plots_resolution_r(100), 00175 sparsity_plots_resolution_m(100), 00176 do_electron_dynamics(0), 00177 no_of_careful_first_scf_steps(0), 00178 do_report_density_diff(1), 00179 error_maxabs_for_diis(0.5), 00180 min_number_of_iterations(), 00181 max_number_of_iterations(), 00182 output_density_at_every_step(1), 00183 output_csr_matrices_for_gao(0), 00184 output_density_images(0), 00185 output_density_images_only(0), 00186 write_guess_density_only(0), 00187 output_density_images_boxwidth(0.5), 00188 image_view_axis(), 00189 save_final_potential(0), 00190 use_diagonalization(0), 00191 use_diag_on_error(1), 00192 use_diag_on_error_guess(1), 00193 write_overlap_matrix(0), 00194 save_full_matrices_for_matlab(0), 00195 analyze_result_after_scf(0), 00196 do_acc_scan_J(0), 00197 do_acc_scan_K(0), 00198 do_acc_scan_Vxc(0), 00199 scan_do_invcholfactor_transf(1), 00200 scan_no_of_steps(16), 00201 scan_start_thresh(1e-9), 00202 scan_step_factor(sqrt((ergo_real)10)), 00203 create_mtx_file_S(0), 00204 create_mtx_files_F(0), 00205 create_mtx_files_D(0), 00206 create_mtx_files_dipole(0), 00207 create_basis_func_coord_file(0), 00208 output_homo_and_lumo_eigenvectors(0), 00209 output_mulliken_pop(0) 00210 { 00211 memset(disturbedElementIndexVector, 0, 00212 sizeof(disturbedElementIndexVector)); 00213 } 00214 }; 00215 00219 struct MatOptions { 00220 mat::SizesAndBlocks size_block_info; 00221 std::vector<int> permutationHML; 00222 std::vector<int> inversePermutationHML; 00223 ergo_real sparse_threshold; 00225 ergo_real threshold_inch; 00226 int sparse_matrix_block_size; 00227 int sparse_matrix_block_factor_3; 00228 int sparse_matrix_block_factor_2; 00229 int sparse_matrix_block_factor_1; 00230 int threads; 00231 int parallelLevel; 00232 00233 MatOptions() : 00234 sparse_threshold(1e-8), 00235 threshold_inch(0), 00236 sparse_matrix_block_size(32), 00237 sparse_matrix_block_factor_3(8), 00238 sparse_matrix_block_factor_2(8), 00239 sparse_matrix_block_factor_1(32), 00240 threads(1), 00241 parallelLevel(1) 00242 {}; 00243 ~MatOptions() { 00244 } 00247 void prepare(const BasisInfoStruct& basisInfo); 00248 }; 00249 00250 struct OutputOptions { 00251 OutputOptions() 00252 {} 00253 00254 }; 00255 00256 } /* end of SCF name space */ 00257 00258 00259 00260 #endif