Changeset eeec8f for src/datacreator.cpp
- Timestamp:
- Oct 19, 2008, 1:57:23 PM (16 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 84fc91
- Parents:
- f731ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/datacreator.cpp
rf731ae reeec8f 63 63 cout << msg << endl; 64 64 output << "# " << msg << ", created on " << datum; 65 output << "#Order\tFrag.No.\t" << Fragments.Header << endl;65 output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 66 66 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 67 67 for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;) { … … 96 96 cout << msg << endl; 97 97 output << "# " << msg << ", created on " << datum; 98 output << "#Order\tFrag.No.\t" << Fragments.Header << endl;98 output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 99 99 Fragments.SetLastMatrix(Energy.Matrix[Energy.MatrixCounter],0); 100 100 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { … … 133 133 cout << msg << endl; 134 134 output << "# " << msg << ", created on " << datum; 135 output << "# Order\tFrag.No.\t" << Fragments.Header << endl;135 output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 136 136 Fragments.SetLastMatrix(0.,0); 137 137 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { … … 165 165 cout << msg << endl; 166 166 output << "# " << msg << ", created on " << datum; 167 output << "# Order\tFrag.No.\t" << Fragments.Header << endl;167 output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 168 168 Fragments.SetLastMatrix(Force.Matrix[Force.MatrixCounter],0); 169 169 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { … … 198 198 cout << msg << endl; 199 199 output << "# " << msg << ", created on " << datum; 200 output << "# AtomNo\t" << Fragments.Header << endl;200 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 201 201 Fragments.SetLastMatrix(Force.Matrix[Force.MatrixCounter], 0); 202 202 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { … … 244 244 cout << msg << endl; 245 245 output << "# " << msg << ", created on " << datum; 246 output << "# AtomNo\t" << Fragments.Header << endl;246 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 247 247 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 248 248 //cout << "Current order is " << BondOrder << "." << endl; … … 262 262 }; 263 263 264 265 /** Plot hessian error vs. vs atom vs. order. 266 * \param &Hessian HessianMatrix containing reference values (in MatrixCounter matrix) 267 * \param &Fragments HessianMatrix class containing matrix values 268 * \param KeySet KeySetContainer class holding bond KeySetContainer::Order 269 * \param *prefix prefix in filename (without ending) 270 * \param *msg message to be place in first line as a comment 271 * \param *datum current date and time 272 * \return true if file was written successfully 273 */ 274 bool CreateDataDeltaHessianOrderPerAtom(class HessianMatrix &Hessian, class HessianMatrix &Fragments, class KeySetsContainer &KeySet, char *dir, char *prefix, char *msg, char *datum) 275 { 276 stringstream filename; 277 ofstream output; 278 double norm = 0.; 279 280 filename << prefix << ".dat"; 281 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 282 cout << msg << endl; 283 output << "# " << msg << ", created on " << datum; 284 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; 285 Fragments.SetLastMatrix(Hessian.Matrix[Hessian.MatrixCounter], 0); 286 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 287 //cout << "Current order is " << BondOrder << "." << endl; 288 Fragments.SumSubHessians(Fragments, KeySet, BondOrder, -1.); 289 // errors per atom 290 output << endl << "#Order\t" << BondOrder+1 << endl; 291 for(int j=0;j<Fragments.RowCounter[ Fragments.MatrixCounter ];j++) { 292 output << Fragments.Indices[Fragments.MatrixCounter][j] << "\t"; 293 for (int l=0;l<Fragments.ColumnCounter[ Fragments.MatrixCounter ];l++) { 294 output << scientific << Fragments.Matrix[Fragments.MatrixCounter][ j ][l] << "\t"; 295 } 296 output << endl; 297 } 298 output << endl; 299 } 300 output.close(); 301 return true; 302 }; 303 304 /** Plot hessian error vs. vs atom vs. order. 305 * \param &Fragments HessianMatrix class containing matrix values 306 * \param KeySet KeySetContainer class holding bond KeySetContainer::Order 307 * \param *prefix prefix in filename (without ending) 308 * \param *msg message to be place in first line as a comment 309 * \param *datum current date and time 310 * \return true if file was written successfully 311 */ 312 bool CreateDataHessianOrderPerAtom(class HessianMatrix &Fragments, class KeySetsContainer &KeySet, char *dir, char *prefix, char *msg, char *datum) 313 { 314 stringstream filename; 315 ofstream output; 316 317 filename << prefix << ".dat"; 318 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 319 cout << msg << endl; 320 output << "# " << msg << ", created on " << datum; 321 output << "# AtomNo\t" << Fragments.Header[ Fragments.MatrixCounter ] << endl; 322 Fragments.SetLastMatrix(0., 0); 323 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 324 //cout << "Current order is " << BondOrder << "." << endl; 325 Fragments.SumSubHessians(Fragments, KeySet, BondOrder, 1.); 326 // errors per atom 327 output << endl << "#Order\t" << BondOrder+1 << endl; 328 for(int j=0;j<Fragments.RowCounter[ Fragments.MatrixCounter ];j++) { 329 output << Fragments.Indices[Fragments.MatrixCounter][j] << "\t"; 330 for (int l=0;l<Fragments.ColumnCounter[ Fragments.MatrixCounter ];l++) 331 output << scientific << Fragments.Matrix[Fragments.MatrixCounter][ j ][l] << "\t"; 332 output << endl; 333 } 334 output << endl; 335 } 336 output.close(); 337 return true; 338 }; 339 264 340 /** Plot matrix vs. fragment. 265 341 */ … … 273 349 cout << msg << endl; 274 350 output << "# " << msg << ", created on " << datum << endl; 275 output << "#Order\tFrag.No.\t" << Fragment.Header << endl;351 output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl; 276 352 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 277 353 for(int i=0;i<KeySet.FragmentsPerOrder[BondOrder];i++) { … … 338 414 cout << msg << endl; 339 415 output << "# " << msg << ", created on " << datum; 340 output << "#Order\tFrag.No.\t" << Fragment.Header << endl;416 output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl; 341 417 // max 342 418 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { … … 538 614 void AbsEnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses) 539 615 { 540 stringstream line(Energy.Header );616 stringstream line(Energy.Header[ Energy.MatrixCounter ]); 541 617 string token; 542 618 … … 562 638 void EnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses) 563 639 { 564 stringstream line(Energy.Header );640 stringstream line(Energy.Header[Energy.MatrixCounter]); 565 641 string token; 566 642 … … 586 662 void ForceMagnitudePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 587 663 { 588 stringstream line(Force.Header );664 stringstream line(Force.Header[Force.MatrixCounter]); 589 665 string token; 590 666 … … 617 693 void AbsFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 618 694 { 619 stringstream line(Force.Header );695 stringstream line(Force.Header[Force.MatrixCounter]); 620 696 string token; 621 697 … … 648 724 void BoxesForcePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 649 725 { 650 stringstream line(Force.Header );726 stringstream line(Force.Header[Force.MatrixCounter]); 651 727 char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"}; 652 728 string token; … … 680 756 void BoxesFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 681 757 { 682 stringstream line(Force.Header );758 stringstream line(Force.Header[Force.MatrixCounter]); 683 759 char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"}; 684 760 string token;
Note:
See TracChangeset
for help on using the changeset viewer.