Changeset fd5440 for src/Potentials/Particles/Particle.cpp
- Timestamp:
- May 7, 2016, 7:03:56 AM (9 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_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:
- fdfc52
- Parents:
- 75237f
- git-author:
- Frederik Heber <heber@…> (02/28/16 14:35:39)
- git-committer:
- Frederik Heber <heber@…> (05/07/16 07:03:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Particles/Particle.cpp
r75237f rfd5440 82 82 std::string Particle::findFreeName( 83 83 const periodentafel &_periode, 84 const atomicNumber_t &_number) const84 const atomicNumber_t &_number) 85 85 { 86 86 const element *e = _periode.FindElement(_number); … … 92 92 std::string returnname; 93 93 while(!FoundFlag) { 94 returnname = e->getSymbol()+toString(index );94 returnname = e->getSymbol()+toString(index++); 95 95 FoundFlag = !ParticleRegistry::getInstance().isPresentByName(returnname); 96 96 } … … 133 133 ost << ",\tfree=" << dof; 134 134 ost << ",\tcharge=" << charge; 135 ost << std::endl;135 ost << ";"; 136 136 } 137 137 … … 159 159 const size_t colonpos = linestring.find(":"); 160 160 if ((strBegin == std::string::npos) || (colonpos == std::string::npos) || 161 (linestring.substr(strBegin, colonpos- 1) != std::string("particle")))161 (linestring.substr(strBegin, colonpos-strBegin) != std::string("particle"))) 162 162 throw SerializablePotentialMissingValueException() 163 163 << SerializablePotentialKey(std::string("particle")); … … 166 166 typedef boost::tokenizer<boost::char_separator<char> > tokenizer; 167 167 boost::char_separator<char> pairsep(",\t ;"); 168 boost::char_separator<char> keyvaluesep("=");169 168 std::string remainderstring(linestring.substr(colonpos+1)); 170 169 tokenizer tokens(remainderstring, pairsep); //skip colon … … 174 173 tok_iter != tokens.end(); ++tok_iter) { 175 174 const std::string &keyvalue = *tok_iter; 176 tokenizer keyvaluetoken(keyvalue, keyvaluesep); 177 tokenizer::iterator keyvalue_iter = keyvaluetoken.begin(); 178 const std::string &key = *keyvalue_iter; 179 const std::string &value = *keyvalue_iter; 175 const size_t equalitypos = keyvalue.find("="); 176 const std::string key = keyvalue.substr(0,equalitypos); 177 const std::string value = keyvalue.substr(equalitypos+1); 180 178 181 179 const size_t index = lookupParameterName(key); 180 181 if (equalitypos == std::string::npos) 182 throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key); 182 183 183 184 switch((parameters_t)index) { … … 210 211 break; 211 212 default: 212 ASSERT(0, "Particle::stream_from() - unknown index " 213 +toString(index)+"."); 213 throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key); 214 214 break; 215 215 }
Note:
See TracChangeset
for help on using the changeset viewer.