SCF_restricted.h

Go to the documentation of this file.
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 SCF_RESTRICTED_HEADER
00029 #define SCF_RESTRICTED_HEADER
00030 
00031 #include "SCF_general.h"
00032 
00033 
00034 class SCF_restricted : public SCF_general
00035 {
00036  public:  
00037 
00038   // Constructor
00039   SCF_restricted(const Molecule& molecule_,
00040                  const Molecule& extraCharges_,
00041                  const BasisInfoStruct & basisInfo_, 
00042                  const BasisInfoStruct & basisInfoDensFit_,
00043                  const IntegralInfo& integralInfo_,
00044                  const char* guessDmatFileNamePtr,
00045                  const JK::Params& J_K_paramsPtr,
00046                  const Dft::GridParams& gridParams_,
00047                  const SCF::Options& scfopts,
00048                  const SCF::MatOptions& matOpts,
00049                  ergo_real threshold_integrals_1el_input);
00050 
00051   // Destructor
00052   ~SCF_restricted();
00053 
00054  private:
00055   void initialize_matrices();
00056   void check_params();
00057   void get_starting_guess_density();
00058   void initialize_homo_lumo_limits();
00059   void write_matrices_to_file();
00060   void get_2e_part_and_energy();
00061   void output_sparsity_S_F_D(SCF_statistics & stats);
00062   void calculate_energy();
00063   void get_FDSminusSDF();
00064   void get_error_measure();
00065   void add_to_DIIS_list();
00066   void update_best_fock_so_far();
00067   void combine_old_fock_matrices(ergo_real stepLength);
00068   void use_diis_to_get_new_fock_matrix();
00069   void clear_diis_list();
00070   void clear_error_matrices();
00071   void save_current_fock_as_fprev();
00072   void get_new_density_matrix();
00073   void write_density_to_file();
00074   void save_final_potential();
00075   void add_random_disturbance_to_starting_guess();
00076   void output_density_images();
00077   void output_csr_matrices_for_gao();
00078   void do_electron_dynamics();
00079   void write_diag_dens_to_file();
00080   void report_final_results();
00081   void save_density_as_prevdens();
00082   void update_subspace_diff();
00083   void disturb_fock_matrix(ergo_real subspaceError);
00084   void disturb_dens_matrix(ergo_real subspaceError);
00085   void do_spin_flip(int atomCount);
00086   void disturb_dens_matrix_exact(ergo_real subspaceError);
00087   void save_full_matrices_for_matlab();
00088   void report_density_difference();
00089   void create_mtx_files_F(int const scfIter);
00090   void create_mtx_files_D(int const scfIter);
00091   void create_homo_eigvec_file() const;
00092   void create_lumo_eigvec_file() const;
00093   void create_gabedit_file() const;
00094   void compute_dipole_moment();
00095   void do_mulliken_pop_stuff();
00096 
00097   void get_non_ort_err_mat_normalized_in_ort_basis(symmMatrix & randomMatrix, int transform_with_S_also);
00098   void transform_with_S(symmMatrix & A);
00099   void transform_with_invChol(symmMatrix & A);
00100   
00101   void disturb_dens_matrix_exact_try(const symmMatrix & randomMatrix,
00102                                      const symmMatrix & orgDensMatrix,
00103                                      ergo_real disturbanceFactor,
00104                                      ergo_real & resultSinTheta,
00105                                      symmMatrix & resultDensMatrix);
00106 
00107   symmMatrix densityMatrix;
00108   symmMatrix FockMatrix;
00109   symmMatrix Fprev;
00110   symmMatrix Dprev;
00111   symmMatrix F_ort_prev; // Used by purification
00112   symmMatrix bestFockMatrixSoFar;
00113   symmMatrix bestFockMatrixSoFar2;
00114   normalMatrix ErrorMatrix;
00115   // The following three matrices are only used when doing sparsity investigation, otherwise they are empty
00116   symmMatrix J_matrix;
00117   symmMatrix K_matrix;
00118   symmMatrix Fxc_matrix;
00119 
00120   generalVector eigVecLUMO;
00121   generalVector eigVecHOMO;
00122 
00123 
00124   intervalType homoInterval_F_ort_prev;
00125   intervalType lumoInterval_F_ort_prev;
00126   intervalType homoInterval_Fprev;
00127   intervalType lumoInterval_Fprev;
00128 
00129 };
00130 
00131 
00132 
00133 
00134 
00135 #endif

Generated on 21 Nov 2012 for ergo by  doxygen 1.6.1