Changeset 056e70 for src/Parser


Ignore:
Timestamp:
Feb 24, 2011, 5:56:03 PM (14 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:
6b020f
Parents:
6625c3
Message:

Suffixed getters and setters for AtomInfo trajecories with AtStep.

  • AtomInfo:: getters are now const members
  • added lots of ASSERTS to getters with time step to assure no out-of-bounds access.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TremoloParser.cpp

    r6625c3 r056e70  
    313313  ConvertTo<double> toDouble;
    314314  ConvertTo<int> toInt;
     315  Vector tempVector;
    315316
    316317  // setup tokenizer, splitting up white-spaced entries
     
    327328    currentField = knownKeys[keyName];
    328329    const string word = *tok_iter;
    329     //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with remaining data " << word << std::endl);
     330    DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with remaining data " << word << std::endl);
    330331    switch (currentField) {
    331332      case TremoloKey::x :
     
    333334        for (int i=0;i<NDIM;i++) {
    334335          ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for x["+toString(i)+"]!");
    335           //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     336          DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    336337          newAtom->set(i, toDouble(*tok_iter));
    337338          tok_iter++;
     
    342343        for (int i=0;i<NDIM;i++) {
    343344          ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for u["+toString(i)+"]!");
    344           //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    345           newAtom->getAtomicVelocity()[i] = toDouble(*tok_iter);
     345          DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     346          tempVector[i] = toDouble(*tok_iter);
    346347          tok_iter++;
    347348        }
     349        newAtom->setAtomicVelocity(tempVector);
    348350        break;
    349351      case TremoloKey::Type :
    350352      {
    351353        ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for "+keyName+"!");
    352         DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     354        DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    353355        std::string element(knownTypes[(*tok_iter)]);
    354356        // put type name into container for later use
    355357        atomInfo->set(currentField, *tok_iter);
    356         DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes." << std::endl);
     358        DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes." << std::endl);
    357359        tok_iter++;
    358360        newAtom->setType(World::getInstance().getPeriode()->FindElement(element));
     
    362364      case TremoloKey::Id :
    363365        ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for "+keyName+"!");
    364         //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     366        DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    365367        atomIdMap[toInt(*tok_iter)] = newAtom->getId();
    366368        tok_iter++;
     
    369371        for (int i=0;i<atoi(it->substr(it->find("=") + 1, 1).c_str());i++) {
    370372          ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for "+keyName+"!");
    371           //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     373          DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    372374          lineStream << *tok_iter << "\t";
    373375          tok_iter++;
     
    378380      default :
    379381        ASSERT(tok_iter != tokens.end(), "TremoloParser::readAtomDataLine() - no value for "+keyName+"!");
    380         //DoLog(1) && (Log() << Verbose(1) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
     382        DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);
    381383        atomInfo->set(currentField, *tok_iter);
    382384        tok_iter++;
     
    403405    // 0 is used to fill empty neighbor positions in the tremolo file.
    404406    if (neighborId > 0) {
    405 //      DoLog(1) && (Log() << Verbose(1)
    406 //          << "Atom with global id " << atomId
    407 //          << " has neighbour with serial " << neighborId
    408 //          << std::endl);
     407      DoLog(4) && (Log() << Verbose(4)
     408          << "Atom with global id " << atomId
     409          << " has neighbour with serial " << neighborId
     410          << std::endl);
    409411      additionalAtomData[atomId].neighbors.push_back(neighborId);
    410412    }
Note: See TracChangeset for help on using the changeset viewer.