Changeset 943d02


Ignore:
Timestamp:
Apr 23, 2008, 5:33:51 PM (17 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:
d3a46d
Parents:
14de469
Message:

molecuilder reads and stored ion velocities

Class atom has new variables velocity vector v and integer FixedIon. These are parse during config:load(), and stored via atom:Output() (but only if norm of v is above MYEPSILON), values are copied to son atoms/nodes in AddCopyAtom and AddHydrogenAtom (there: no fancy splitting of the vector as done with the InBondVector)

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/atom.cpp

    r14de469 r943d02  
    2020  type = NULL;
    2121  sort = NULL;
     22  FixedIon = 0;
    2223  nr = -1;
    2324  GraphNr = -1;
     
    5960  if (out != NULL) {
    6061    *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t"  << fixed << setprecision(9) << showpoint;
    61     *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2] << "\t";
    62     *out << "\t" << "0\t# Number in molecule " << nr << endl;
     62    *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];
     63    *out << "\t" << FixedIon;
     64    if (v.Norm() > MYEPSILON)
     65      *out << "\t" << scientific << setprecision(6) << v.x[0] << "\t" << v.x[1] << "\t" << v.x[2] << "\t";
     66    *out << " # Number in molecule " << nr << endl;
    6367    return true;
    6468  } else
  • src/config.cpp

    r14de469 r943d02  
    604604      ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], repetition,critical);
    605605      ParseForParameter(verbose,file, keyword, 0, 3, 1, double_type, &neues->x.x[2], repetition,critical);
     606      ParseForParameter(verbose,file, keyword, 0, 4, 1, int_type, &neues->FixedIon, repetition,critical);
     607      if(!ParseForParameter(verbose,file, keyword, 0, 5, 1, double_type, &neues->v.x[0], repetition,optional))
     608        neues->v.x[0] = 0.;
     609      if(!ParseForParameter(verbose,file, keyword, 0, 6, 1, double_type, &neues->v.x[1], repetition,optional))
     610        neues->v.x[1] = 0.;
     611      if(!ParseForParameter(verbose,file, keyword, 0, 7, 1, double_type, &neues->v.x[2], repetition,optional))
     612        neues->v.x[2] = 0.;
    606613      neues->type = elementhash[i]; // find element type
    607614      mol->AddAtom(neues);
  • src/molecules.cpp

    r14de469 r943d02  
    120120        walker->type = pointer->type;   // copy element of atom
    121121        walker->x.CopyVector(&pointer->x); // copy coordination
     122    walker->v.CopyVector(&pointer->v); // copy velocity
     123    walker->FixedIon = pointer->FixedIon;
    122124    walker->sort = &walker->nr;
    123125    walker->nr = last_atom++;  // increase number within molecule
     
    231233      FirstOtherAtom = new atom();    // new atom
    232234      FirstOtherAtom->type = elemente->FindElement(1);  // element is Hydrogen
     235      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     236      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
    233237      if (TopReplacement->type->Z == 1) { // neither rescale nor replace if it's already hydrogen
    234238        FirstOtherAtom->father = TopReplacement;
     
    288292      FirstOtherAtom->type = elemente->FindElement(1);
    289293      SecondOtherAtom->type = elemente->FindElement(1);
     294      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     295      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
     296      SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     297      SecondOtherAtom->FixedIon = TopReplacement->FixedIon;
    290298      FirstOtherAtom->father = NULL;  // we are just an added hydrogen with no father
    291299      SecondOtherAtom->father = NULL;  //  we are just an added hydrogen with no father
     
    340348      SecondOtherAtom->type = elemente->FindElement(1);
    341349      ThirdOtherAtom->type = elemente->FindElement(1);
     350      FirstOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     351      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
     352      SecondOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     353      SecondOtherAtom->FixedIon = TopReplacement->FixedIon;
     354      ThirdOtherAtom->v.CopyVector(&TopReplacement->v); // copy velocity
     355      ThirdOtherAtom->FixedIon = TopReplacement->FixedIon;
    342356      FirstOtherAtom->father = NULL;  //  we are just an added hydrogen with no father
    343357      SecondOtherAtom->father = NULL;  //  we are just an added hydrogen with no father
  • src/molecules.hpp

    r14de469 r943d02  
    345345class atom {
    346346  public:
    347     vector x;    //!< coordinate array of atom, giving position within cell
     347    vector x;       //!< coordinate array of atom, giving position within cell
     348    vector v;       //!< velocity array of atom
    348349    element *type;  //!< pointing to element
    349350    atom *previous; //!< previous atom in molecule list
     
    352353    atom *Ancestor; //!< "Father" in Depth-First-Search
    353354    char *Name;                 //!< unique name used during many-body bond-order fragmentation
     355    int FixedIon;   //!< config variable that states whether forces act on the ion or not
    354356    int *sort;      //!< sort criteria
    355357    int nr;         //!< continuous, unique number
Note: See TracChangeset for help on using the changeset viewer.