Ignore:
Timestamp:
May 7, 2016, 7:03:56 AM (9 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_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)
Message:

FIX: Particle's member variables are now public and fixes to stream functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/Particles/Particle.cpp

    r75237f rfd5440  
    8282std::string Particle::findFreeName(
    8383    const periodentafel &_periode,
    84     const atomicNumber_t &_number) const
     84    const atomicNumber_t &_number)
    8585{
    8686  const element *e = _periode.FindElement(_number);
     
    9292  std::string returnname;
    9393  while(!FoundFlag) {
    94     returnname = e->getSymbol()+toString(index);
     94    returnname = e->getSymbol()+toString(index++);
    9595    FoundFlag = !ParticleRegistry::getInstance().isPresentByName(returnname);
    9696  }
     
    133133  ost << ",\tfree=" << dof;
    134134  ost << ",\tcharge=" << charge;
    135   ost << std::endl;
     135  ost << ";";
    136136}
    137137
     
    159159  const size_t colonpos = linestring.find(":");
    160160  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")))
    162162    throw SerializablePotentialMissingValueException()
    163163        << SerializablePotentialKey(std::string("particle"));
     
    166166  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
    167167  boost::char_separator<char> pairsep(",\t ;");
    168   boost::char_separator<char> keyvaluesep("=");
    169168  std::string remainderstring(linestring.substr(colonpos+1));
    170169  tokenizer tokens(remainderstring, pairsep); //skip colon
     
    174173    tok_iter != tokens.end(); ++tok_iter) {
    175174    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);
    180178
    181179    const size_t index = lookupParameterName(key);
     180
     181    if (equalitypos == std::string::npos)
     182      throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key);
    182183
    183184    switch((parameters_t)index) {
     
    210211      break;
    211212    default:
    212       ASSERT(0, "Particle::stream_from() - unknown index "
    213           +toString(index)+".");
     213      throw SerializablePotentialMissingValueException() << SerializablePotentialKey(key);
    214214      break;
    215215    }
Note: See TracChangeset for help on using the changeset viewer.