Changeset bce72c
- Timestamp:
- Feb 24, 2011, 4:30:56 PM (14 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:
- 54b42e
- Parents:
- c864a8
- git-author:
- Frederik Heber <heber@…> (02/07/11 18:35:30)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 16:30:56)
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AtomicInfo.cpp
rc864a8 rbce72c 35 35 Position(_atom.getPosition()), 36 36 Type(_atom.getType()), 37 Velocity(_atom. AtomicVelocity),37 Velocity(_atom.getAtomicVelocity()), 38 38 Father(_atom.father), 39 39 Mol(_atom.getMolecule()), … … 51 51 _atom.father = const_cast<atom *>(Father); // TODO: Actually, atom::father should be const atom *! 52 52 _atom.setMolecule(const_cast<molecule *>(Mol)); // this is ok, mol is const within AtomicInfo, but not outside (atoms need to register) 53 _atom. AtomicVelocity = Velocity;53 _atom.setAtomicVelocity(Velocity); 54 54 if (_atom.getId() == Id) 55 55 return true; -
src/Parser/PcpParser.cpp
rc864a8 rbce72c 558 558 *file << (*AtomRunner)->at(0) << "\t" << (*AtomRunner)->at(1) << "\t" << (*AtomRunner)->at(2); 559 559 *file << "\t" << (*AtomRunner)->FixedIon; 560 if ((*AtomRunner)-> AtomicVelocity.Norm() > MYEPSILON)561 *file << "\t" << scientific << setprecision(6) << (*AtomRunner)-> AtomicVelocity[0] << "\t" << (*AtomRunner)->AtomicVelocity[1] << "\t" << (*AtomRunner)->AtomicVelocity[2] << "\t";560 if ((*AtomRunner)->getAtomicVelocity().Norm() > MYEPSILON) 561 *file << "\t" << scientific << setprecision(6) << (*AtomRunner)->getAtomicVelocity()[0] << "\t" << (*AtomRunner)->getAtomicVelocity()[1] << "\t" << (*AtomRunner)->getAtomicVelocity()[2] << "\t"; 562 562 *file << " # molecule nr " << nr++ << endl; 563 563 } -
src/Parser/TremoloParser.cpp
rc864a8 rbce72c 188 188 case TremoloKey::u : 189 189 // for the moment, assume there are always three dimensions 190 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom-> AtomicVelocity<< std::endl);191 *file << currentAtom-> AtomicVelocity[0] << "\t";192 *file << currentAtom-> AtomicVelocity[1] << "\t";193 *file << currentAtom-> AtomicVelocity[2] << "\t";190 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity() << std::endl); 191 *file << currentAtom->getAtomicVelocity()[0] << "\t"; 192 *file << currentAtom->getAtomicVelocity()[1] << "\t"; 193 *file << currentAtom->getAtomicVelocity()[2] << "\t"; 194 194 break; 195 195 case TremoloKey::Type : … … 343 343 ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for u["+toString(i)+"]!"); 344 344 //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl); 345 newAtom-> AtomicVelocity[i] = toDouble(*tok_iter);345 newAtom->getAtomicVelocity()[i] = toDouble(*tok_iter); 346 346 tok_iter++; 347 347 } -
src/Parser/unittests/ParserTremoloUnitTest.cpp
rc864a8 rbce72c 151 151 input << Tremolo_velocity; 152 152 testParser->load(&input); 153 CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))-> AtomicVelocity[0] == 3.0);153 CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->getAtomicVelocity()[0] == 3.0); 154 154 input.clear(); 155 155 } -
src/atom.cpp
rc864a8 rbce72c 54 54 setType(pointer->getType()); // copy element of atom 55 55 setPosition(pointer->getPosition()); // copy coordination 56 AtomicVelocity = pointer->AtomicVelocity; // copy velocity56 setAtomicVelocity(pointer->getAtomicVelocity()); // copy velocity 57 57 FixedIon = pointer->FixedIon; 58 58 }; … … 153 153 *out << at(0) << "\t" << at(1) << "\t" << at(2); 154 154 *out << "\t" << FixedIon; 155 if ( AtomicVelocity.Norm() > MYEPSILON)156 *out << "\t" << scientific << setprecision(6) << AtomicVelocity[0] << "\t" << AtomicVelocity[1] << "\t" << AtomicVelocity[2] << "\t";155 if (getAtomicVelocity().Norm() > MYEPSILON) 156 *out << "\t" << scientific << setprecision(6) << getAtomicVelocity()[0] << "\t" << getAtomicVelocity()[1] << "\t" << getAtomicVelocity()[2] << "\t"; 157 157 if (comment != NULL) 158 158 *out << " # " << comment << endl; … … 180 180 *out << at(0) << "\t" << at(1) << "\t" << at(2); 181 181 *out << "\t" << FixedIon; 182 if ( AtomicVelocity.Norm() > MYEPSILON)183 *out << "\t" << scientific << setprecision(6) << AtomicVelocity[0] << "\t" << AtomicVelocity[1] << "\t" << AtomicVelocity[2] << "\t";182 if (getAtomicVelocity().Norm() > MYEPSILON) 183 *out << "\t" << scientific << setprecision(6) << getAtomicVelocity()[0] << "\t" << getAtomicVelocity()[1] << "\t" << getAtomicVelocity()[2] << "\t"; 184 184 if (comment != NULL) 185 185 *out << " # " << comment << endl; -
src/atom_atominfo.cpp
rc864a8 rbce72c 83 83 } 84 84 85 Vector& AtomInfo::getAtomicVelocity() 86 { 87 return AtomicVelocity; 88 } 89 90 const Vector& AtomInfo::getAtomicVelocity() const 91 { 92 return AtomicVelocity; 93 } 94 95 void AtomInfo::setAtomicVelocity(const Vector &_newvelocity) 96 { 97 AtomicVelocity = _newvelocity; 98 } 99 100 const Vector& AtomInfo::getAtomicForce() const 101 { 102 return AtomicForce; 103 } 104 105 void AtomInfo::setAtomicForce(const Vector &_newforce) 106 { 107 AtomicForce = _newforce; 108 } 109 85 110 void AtomInfo::setPosition(const Vector& _vector) 86 111 { -
src/atom_atominfo.hpp
rc864a8 rbce72c 33 33 34 34 public: 35 Vector AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell36 Vector AtomicForce; //!< Force vector of atom, giving last force within cell37 38 35 AtomInfo(); 39 36 AtomInfo(const AtomInfo &_atom); … … 41 38 virtual ~AtomInfo(); 42 39 40 /** Getter for AtomicElement. 41 * 42 * @return constant reference to AtomicElement 43 */ 43 44 const element *getType() const; 44 void setType(const element *); 45 void setType(const int); 45 /** Setter for AtomicElement. 46 * 47 * @param _type new element by pointer to set 48 */ 49 void setType(const element *_type); 50 /** Setter for AtomicElement. 51 * 52 * @param _typenr new element by index to set 53 */ 54 void setType(const int _typenr); 55 56 /** Getter for AtomicVelocity. 57 * 58 * @return constant reference to AtomicVelocity 59 */ 60 Vector& getAtomicVelocity(); 61 /** Getter for AtomicVelocity. 62 * 63 * @return constant reference to AtomicVelocity 64 */ 65 const Vector& getAtomicVelocity() const; 66 /** Setter for AtomicVelocity. 67 * 68 * @param _newvelocity new velocity to set 69 */ 70 void setAtomicVelocity(const Vector &_newvelocity); 71 72 /** Getter for AtomicForce. 73 * 74 * @return constant reference to AtomicForce 75 */ 76 const Vector& getAtomicForce() const; 77 /** Setter for AtomicForce. 78 * 79 * @param _newvelocity new force vector to set 80 */ 81 void setAtomicForce(const Vector &_newforce); 46 82 47 83 ///// manipulation of the atomic position … … 80 116 private: 81 117 Vector AtomicPosition; //!< coordinate vector of atom, giving last position within cell 118 Vector AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell 119 Vector AtomicForce; //!< Force vector of atom, giving last force within cell 120 82 121 const element *AtomicElement; //!< pointing to element 83 122 }; -
src/config.cpp
rc864a8 rbce72c 543 543 544 544 // parse velocities if present 545 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues-> AtomicVelocity[0], 1,optional))546 neues-> AtomicVelocity[0] = 0.;547 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues-> AtomicVelocity[1], 1,optional))548 neues-> AtomicVelocity[1] = 0.;549 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues-> AtomicVelocity[2], 1,optional))550 neues-> AtomicVelocity[2] = 0.;545 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->getAtomicVelocity()[0], 1,optional)) 546 neues->getAtomicVelocity()[0] = 0.; 547 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->getAtomicVelocity()[1], 1,optional)) 548 neues->getAtomicVelocity()[1] = 0.; 549 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->getAtomicVelocity()[2], 1,optional)) 550 neues->getAtomicVelocity()[2] = 0.; 551 551 for (int d=0;d<NDIM;d++) 552 neues->Trajectory.U.at(repetition)[d] = neues-> AtomicVelocity[d];552 neues->Trajectory.U.at(repetition)[d] = neues->getAtomicVelocity()[d]; 553 553 554 554 // parse forces if present … … 608 608 neues->setPosition(position); 609 609 ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &neues->FixedIon, repetition,critical); 610 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues-> AtomicVelocity[0], repetition,optional))611 neues-> AtomicVelocity[0] = 0.;612 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues-> AtomicVelocity[1], repetition,optional))613 neues-> AtomicVelocity[1] = 0.;614 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues-> AtomicVelocity[2], repetition,optional))615 neues-> AtomicVelocity[2] = 0.;610 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->getAtomicVelocity()[0], repetition,optional)) 611 neues->getAtomicVelocity()[0] = 0.; 612 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->getAtomicVelocity()[1], repetition,optional)) 613 neues->getAtomicVelocity()[1] = 0.; 614 if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->getAtomicVelocity()[2], repetition,optional)) 615 neues->getAtomicVelocity()[2] = 0.; 616 616 // here we don't care if forces are present (last in trajectories is always equal to current position) 617 617 neues->setType(elementhash[i]); // find element type -
src/molecule.cpp
rc864a8 rbce72c 364 364 FirstOtherAtom = World::getInstance().createAtom(); // new atom 365 365 FirstOtherAtom->setType(1); // element is Hydrogen 366 FirstOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity366 FirstOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 367 367 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 368 368 if (TopReplacement->getType()->getAtomicNumber() == 1) { // neither rescale nor replace if it's already hydrogen … … 429 429 FirstOtherAtom->setType(1); 430 430 SecondOtherAtom->setType(1); 431 FirstOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity431 FirstOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 432 432 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 433 SecondOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity433 SecondOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 434 434 SecondOtherAtom->FixedIon = TopReplacement->FixedIon; 435 435 FirstOtherAtom->father = NULL; // we are just an added hydrogen with no father … … 484 484 SecondOtherAtom->setType(1); 485 485 ThirdOtherAtom->setType(1); 486 FirstOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity486 FirstOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 487 487 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 488 SecondOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity488 SecondOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 489 489 SecondOtherAtom->FixedIon = TopReplacement->FixedIon; 490 ThirdOtherAtom-> AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity490 ThirdOtherAtom->setAtomicVelocity(TopReplacement->getAtomicVelocity()); // copy velocity 491 491 ThirdOtherAtom->FixedIon = TopReplacement->FixedIon; 492 492 FirstOtherAtom->father = NULL; // we are just an added hydrogen with no father
Note:
See TracChangeset
for help on using the changeset viewer.