Changeset d392067 for src/bin/mpqc
- Timestamp:
- Jul 10, 2012, 1:15:51 PM (13 years ago)
- Children:
- bab0b1
- Parents:
- ad2befa
- git-author:
- Frederik Heber <heber@…> (07/06/12 20:03:47)
- git-committer:
- Frederik Heber <heber@…> (07/10/12 13:15:51)
- File:
-
- 1 edited
-
src/bin/mpqc/mpqc.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/bin/mpqc/mpqc.cc
rad2befa rd392067 919 919 } 920 920 921 /** Performs gradient calculation. 922 * 923 * \param mole molecular energy object 924 */ 925 void performGradientCalculation( 926 Ref<MolecularEnergy> &mole 927 ) 928 { 929 mole->do_gradient(1); 930 ExEnv::out0() << endl << indent 931 << scprintf("Value of the MolecularEnergy: %15.10f", 932 mole->energy()) 933 << endl; 934 if (mole->value_result().actual_accuracy() 935 > mole->value_result().desired_accuracy()) { 936 ExEnv::out0() << indent 937 << "WARNING: desired accuracy not achieved in energy" << endl; 938 } 939 ExEnv::out0() << endl; 940 // Use result_noupdate since the energy might not have converged 941 // to the desired accuracy in which case grabbing the result will 942 // start up the calculation again. However the gradient might 943 // not have been computed (if we are restarting and the gradient 944 // isn't in the save file for example). 945 RefSCVector grad; 946 if (mole->gradient_result().computed()) { 947 grad = mole->gradient_result().result_noupdate(); 948 } 949 else { 950 grad = mole->gradient(); 951 } 952 if (grad.nonnull()) { 953 grad.print("Gradient of the MolecularEnergy:"); 954 if (mole->gradient_result().actual_accuracy() 955 > mole->gradient_result().desired_accuracy()) { 956 ExEnv::out0() << indent 957 << "WARNING: desired accuracy not achieved in gradient" << endl; 958 } 959 } 960 } 961 921 962 int 922 963 try_main(int argc, char *argv[]) … … 1037 1078 << " by default for molecular integrals evaluation" << endl << endl; 1038 1079 1039 // c heck for a molecular energy and optimizer1080 // create some filenames for molecule, checkpoint, basename of output 1040 1081 const char *basename = SCFormIO::default_basename(); 1041 1082 KeyValValueString molnamedef(basename); … … 1145 1186 1146 1187 } else if (do_grad && mole->gradient_implemented()) { 1147 mole->do_gradient(1); 1148 ExEnv::out0() << endl << indent 1149 << scprintf("Value of the MolecularEnergy: %15.10f", 1150 mole->energy()) 1151 << endl; 1152 if (mole->value_result().actual_accuracy() 1153 > mole->value_result().desired_accuracy()) { 1154 ExEnv::out0() << indent 1155 << "WARNING: desired accuracy not achieved in energy" << endl; 1156 } 1157 ExEnv::out0() << endl; 1158 // Use result_noupdate since the energy might not have converged 1159 // to the desired accuracy in which case grabbing the result will 1160 // start up the calculation again. However the gradient might 1161 // not have been computed (if we are restarting and the gradient 1162 // isn't in the save file for example). 1163 RefSCVector grad; 1164 if (mole->gradient_result().computed()) { 1165 grad = mole->gradient_result().result_noupdate(); 1166 } 1167 else { 1168 grad = mole->gradient(); 1169 } 1170 if (grad.nonnull()) { 1171 grad.print("Gradient of the MolecularEnergy:"); 1172 if (mole->gradient_result().actual_accuracy() 1173 > mole->gradient_result().desired_accuracy()) { 1174 ExEnv::out0() << indent 1175 << "WARNING: desired accuracy not achieved in gradient" << endl; 1176 } 1177 } 1188 1189 performGradientCalculation(mole); 1190 1178 1191 } else if (do_energy && mole->value_implemented()) { 1179 1192 ExEnv::out0() << endl << indent … … 1184 1197 } 1185 1198 1199 // stop timing of calculations 1186 1200 if (tim.nonnull()) tim->exit("calc"); 1187 1201
Note:
See TracChangeset
for help on using the changeset viewer.
