Changeset aa5702 for src


Ignore:
Timestamp:
Sep 28, 2008, 5:55:04 PM (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:
ba4432
Parents:
62f793
Message:

corrected molecule::VerletForceIntegration() and analyzer creates data and plot file for shielding values

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/analyzer.cpp

    r62f793 raa5702  
    116116  if (!ForceFragments.ParseFragmentMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
    117117  if (periode != NULL) { // also look for PAS values
    118     if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    119     if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     118    if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingFragmentSuffix, 1, 0)) return 1;
     119    if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASFragmentSuffix, 1, 0)) return 1;
    120120  }
    121121
     
    211211  output2.close();
    212212
    213 
     213  // +++++++++++++++++++++++++++++++++++++++ Plotting shieldings
     214  if (periode != NULL) { // also look for PAS values
     215    if (!OpenOutputFile(output, argv[3], "ShieldingPAS-Atom.dat" )) return false;
     216    output << "#" << ShieldingPAS.Header << endl;
     217    for(int j=0;j<ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter];j++) {
     218      for(int k=0;k<ShieldingPAS.ColumnCounter;k++)
     219        output << scientific << ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k]*(((k>1) && (k<6))? 1.e6 : 1.) << "\t";
     220      output << endl;
     221    }
     222    output << endl << endl; // another two newlines to partition the data
     223    for(int j=0;j<ShieldingPASFragments.RowCounter[ShieldingPASFragments.MatrixCounter];j++) {
     224      for(int k=0;k<ShieldingPASFragments.ColumnCounter;k++)
     225        output << scientific << ShieldingPASFragments.Matrix[ ShieldingPASFragments.MatrixCounter ][j][k]*(((k>1) && (k<6))? 1.e6 : 1.) << "\t";
     226      output << endl;
     227    }
     228    output << endl;
     229  }
     230  output.close();
     231
     232 
    214233  // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM
    215234  if (!CreateDataDeltaEnergyOrder(Energy, EnergyFragments, KeySet, argv[3], "DeltaEnergies-Order", "Plot of error between approximated and full energies energies versus the Bond Order", datum)) return 1;
     
    359378  if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MaxForces-FragmentOrder", 5, "below", "y", "set boxwidth 0.2", 1, 1, "bond order", "maximum of approximated forces [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with boxes fillcolor", BoxesForcePlotLine)) return 1;
    360379 
     380  // +++++++++++++++++++++++++++++++=Ploting approximated and true shielding for each atom
     381  if (periode != NULL) { // also look for PAS values
     382    if(!OpenOutputFile(output, argv[3], "ShieldingPAS-Atom.pyx")) return 1;
     383    CreatePlotHeader(output, "ShieldingPAS-Atom", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "chemical shielding value [ppm]");
     384    output << "plot \\" << endl; 
     385    output << "'ShieldingPAS-Atom.dat' index 0 title 'DFT' using 2:6 with linespoints, \\" << endl;
     386    output << "'ShieldingPAS-Atom.dat' index 1 title 'BOSSANOVA' using 2:6 with linespoints" << endl;
     387    output.close(); 
     388  }
     389
    361390  // create Makefile
    362391  if(!OpenOutputFile(output, argv[3], "Makefile")) return 1;
  • src/config.cpp

    r62f793 raa5702  
    6363  UseAddGramSch=1;
    6464  Seed=1;
    65  
    6665  MaxOuterStep=0;
    67   Deltat=1;
     66  Deltat=0.01;
    6867  OutVisStep=10;
    6968  OutSrcStep=5;
  • src/molecules.cpp

    r62f793 raa5702  
    14931493  string token;
    14941494  stringstream item;
    1495   double a, IonMass, Vector[NDIM], ConstrainedPotentialEnergy, ActualTemp = 0.;
     1495  double a, IonMass, Vector[NDIM], ConstrainedPotentialEnergy, ActualTemp;
    14961496  ForceMatrix Force;
    14971497
     
    15351535    while (walker->next != end) { // go through every atom of this element
    15361536      walker = walker->next;
    1537       a = configuration.Deltat*0.5/walker->type->mass;        // (F+F_old)/2m = a and thus: v = (F+F_old)/2m * t = (F + F_old) * a
     1537      //a = configuration.Deltat*0.5/walker->type->mass;        // (F+F_old)/2m = a and thus: v = (F+F_old)/2m * t = (F + F_old) * a
    15381538      // check size of vectors
    15391539      if (Trajectories[walker].R.size() <= (unsigned int)(MDSteps)) {
     
    15461546      // Update R (and F)
    15471547      for (int d=0; d<NDIM; d++) {
    1548         Trajectories[walker].F.at(MDSteps).x[d] = -Force.Matrix[0][AtomNo][d+5]*(configuration.GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);
     1548        Trajectories[walker].F.at(MDSteps).x[d] = -Force.Matrix[0][walker->nr][d+5]*(configuration.GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);
    15491549        Trajectories[walker].R.at(MDSteps).x[d] = Trajectories[walker].R.at(MDSteps-1).x[d];
    1550         Trajectories[walker].R.at(MDSteps).x[d] += configuration.Deltat*(Trajectories[walker].U.at(MDSteps-1).x[d]);
    1551         Trajectories[walker].R.at(MDSteps).x[d] += configuration.Deltat*a*(Trajectories[walker].F.at(MDSteps).x[d]);     // F = m * a and s = 0.5 * F/m * t^2 = F * a * t
     1550        Trajectories[walker].R.at(MDSteps).x[d] += configuration.Deltat*(Trajectories[walker].U.at(MDSteps-1).x[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
     1551        Trajectories[walker].R.at(MDSteps).x[d] += 0.5*configuration.Deltat*configuration.Deltat*(Trajectories[walker].F.at(MDSteps).x[d]/walker->type->mass);     // F = m * a and s = 0.5 * F/m * t^2 = F * a * t
    15521552      }
    15531553      // Update U
    15541554      for (int d=0; d<NDIM; d++) {
    15551555        Trajectories[walker].U.at(MDSteps).x[d] = Trajectories[walker].U.at(MDSteps-1).x[d];
    1556         Trajectories[walker].U.at(MDSteps).x[d] += a * (Trajectories[walker].F.at(MDSteps).x[d]+Trajectories[walker].F.at(MDSteps-1).x[d]);
     1556        Trajectories[walker].U.at(MDSteps).x[d] += configuration.Deltat * (Trajectories[walker].F.at(MDSteps).x[d]+Trajectories[walker].F.at(MDSteps-1).x[d]/walker->type->mass); // v = F/m * t
    15571557      }
    15581558//      out << "Integrated position&velocity of step " << (MDSteps) << ": (";
     
    15781578    }
    15791579  }
     1580  for(int d=0;d<NDIM;d++)
     1581    Vector[d] /= IonMass;
     1582  ActualTemp = 0.;
    15801583  walker = start;
    15811584  while (walker->next != end) { // go through every atom of this element
    15821585    walker = walker->next;
    15831586    for(int d=0;d<NDIM;d++) {
    1584       Trajectories[walker].U.at(MDSteps).x[d] -= Vector[d]*walker->type->mass/IonMass;
     1587      Trajectories[walker].U.at(MDSteps).x[d] -= Vector[d];
    15851588      ActualTemp += 0.5 * walker->type->mass * Trajectories[walker].U.at(MDSteps).x[d] * Trajectories[walker].U.at(MDSteps).x[d];
    15861589    }
Note: See TracChangeset for help on using the changeset viewer.