Changeset f3dc4c


Ignore:
Timestamp:
Aug 18, 2008, 8:27:34 AM (16 years ago)
Author:
Frederik Heber <heber@…>
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:
8f019c
Parents:
9e5a04d
Message:

Time analysis is back in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analyzer.cpp

    r9e5a04d rf3dc4c  
    2929  ForceMatrix Shielding;
    3030  ForceMatrix ShieldingPAS;
    31   MatrixContainer Time;
     31  EnergyMatrix Time;
    3232  EnergyMatrix EnergyFragments;
    3333  EnergyMatrix HcorrectionFragments;
     
    5151  bool Hcorrected = true;
    5252  double norm;
     53  int counter;
    5354 
    5455  cout << "ANOVA Analyzer" << endl;
     
    8283 
    8384  // ------------- Parse through all Fragment subdirs --------
    84   if (!Energy.ParseMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
    85   Hcorrected = Hcorrection.ParseMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
    86   if (!Force.ParseMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
    87   if (!Time.ParseMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
     85  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
     86  Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
     87  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
     88  if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
    8889  if (periode != NULL) { // also look for PAS values
    89     if (!Shielding.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    90     if (!ShieldingPAS.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     90    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
     91    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
    9192  }
    9293
     
    111112 
    112113  // ---------- Parse fragment files created by 'joiner' into an array -------------
    113   if (!EnergyFragments.ParseMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
    114   if (Hcorrected) HcorrectionFragments.ParseMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
    115   if (!ForceFragments.ParseMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
     114  if (!EnergyFragments.ParseFragmentMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
     115  if (Hcorrected) HcorrectionFragments.ParseFragmentMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
     116  if (!ForceFragments.ParseFragmentMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
    116117  if (periode != NULL) { // also look for PAS values
    117     if (!ShieldingFragments.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    118     if (!ShieldingPASFragments.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     118    if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
     119    if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
    119120  }
    120121
     
    160161 
    161162  output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl;
    162   Time.SetLastMatrix(0., 0);
    163   for (int BondOrder=KeySet.Order;BondOrder--;)
    164     for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
    165       for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
    166         for(int k=Time.ColumnCounter;k--;) {
    167           Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
    168         }
    169163  for(int j=0;j<Time.RowCounter[Time.MatrixCounter];j++) {
    170     for(int k=0;k<Time.ColumnCounter;k++)
     164    for(int k=0;k<Time.ColumnCounter;k++) {
    171165      output << scientific << Time.Matrix[ Time.MatrixCounter ][j][k] << "\t";
     166    }
    172167    output << endl;
    173168  }
    174169  output << endl;
    175170  output.close();
     171  for(int k=0;k<Time.ColumnCounter;k++)
     172    Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k] = Time.Matrix[ Time.MatrixCounter ][Time.RowCounter[Time.MatrixCounter]-1][k];
    176173
    177174  // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++
     
    182179
    183180  // +++++++++++++++++++++++++++++++++++++++ Plotting Simtime vs Bond Order
     181  // +++++++++++++++++++++++++++++++++++++++ Plotting Delta Simtime vs Bond Order
    184182  if (!OpenOutputFile(output, argv[3], "SimTime-Order.dat" )) return false;
    185   Time.SetLastMatrix(0., 0);
     183  if (!OpenOutputFile(output2, argv[3], "DeltaSimTime-Order.dat" )) return false;
     184  for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
     185    for(int k=Time.ColumnCounter;k--;) {
     186      Time.Matrix[ Time.MatrixCounter ][j][k] = 0.;
     187    }
     188  counter = 0;
    186189  output << "#Order\tFrag.No.\t" << Time.Header << endl;
     190  output2 << "#Order\tFrag.No.\t" << Time.Header << endl;
    187191  for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
    188192    for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
     
    191195          Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
    192196        }
    193     output << BondOrder+1 << "\t" << KeySet.FragmentsPerOrder[BondOrder];
    194     for(int k=0;k<Time.ColumnCounter;k++)
    195       output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][1][k];
    196     output << endl;
     197    counter += KeySet.FragmentsPerOrder[BondOrder];
     198    output << BondOrder+1 << "\t" << counter;
     199    output2 << BondOrder+1 << "\t" << counter;
     200    for(int k=0;k<Time.ColumnCounter;k++) {
     201      output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
     202      if (fabs(Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k]) > MYEPSILON)
     203        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k] / Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k];
     204      else
     205        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
     206    }
     207    output << endl;
     208    output2 << endl;
    197209  }
    198210  output.close();
     211  output2.close();
     212
    199213
    200214  // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM
Note: See TracChangeset for help on using the changeset viewer.