Changeset 6bc86c for src


Ignore:
Timestamp:
Oct 10, 2011, 2:27:05 PM (13 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:
e611dc
Parents:
38f991
git-author:
Frederik Heber <heber@…> (09/05/11 17:24:31)
git-committer:
Frederik Heber <heber@…> (10/10/11 14:27:05)
Message:

Implemented specific AtomRemoved(),AtomInserted() for Pdb and Tremolo parsers.

Location:
src/Parser
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/PdbParser.cpp

    r38f991 r6bc86c  
    285285}
    286286
     287/** Add default info, when new atom is added to World.
     288 *
     289 * @param id of atom
     290 */
     291void PdbParser::AtomInserted(atomId_t id)
     292{
     293  //LOG(3, "PdbParser::AtomInserted() - notified of atom " << id << "'s insertion.");
     294  ASSERT(!isPresentadditionalAtomData(id),
     295      "PdbParser::AtomInserted() - additionalAtomData already present for newly added atom "
     296      +toString(id)+".");
     297  // don't insert here as this is our check whether we are in the first time step
     298  //additionalAtomData.insert( std::make_pair(id, defaultAdditionalData) );
     299  //SerialSet.insert(id);
     300}
     301
     302/** Remove additional AtomData info, when atom has been removed from World.
     303 *
     304 * @param id of atom
     305 */
     306void PdbParser::AtomRemoved(atomId_t id)
     307{
     308  //LOG(3, "PdbParser::AtomRemoved() - notified of atom " << id << "'s removal.");
     309  std::map<size_t, PdbAtomInfoContainer>::iterator iter = additionalAtomData.find(id);
     310  // as we do not insert AtomData on AtomInserted, we cannot be assured of its presence
     311//  ASSERT(iter != additionalAtomData.end(),
     312//      "PdbParser::AtomRemoved() - additionalAtomData is not present for atom "
     313//      +toString(id)+" to remove.");
     314  if (iter != additionalAtomData.end()) {
     315    ConvertTo<size_t> toSize_t;
     316    SerialSet.erase(toSize_t((iter->second).get<std::string>(PdbKey::serial)));
     317    additionalAtomData.erase(iter);
     318  }
     319}
     320
     321
    287322/** Checks whether there is an entry for the given atom's \a _id.
    288323 *
     
    563598  bool FirstTimestep = isPresentadditionalAtomData(newAtom->getId()) ? false : true;
    564599  ASSERT((FirstTimestep && (_step == 0)) || (!FirstTimestep && (_step !=0)),
    565       "PdbParser::readAtomDataLine() - logig mismatch between FirstTimestep and step == 0.");
     600      "PdbParser::readAtomDataLine() - additionalAtomData present though atom is newly parsed.");
    566601  if (FirstTimestep) {
    567602    LOG(3,"INFO: Parsing new atom.");
  • src/Parser/PdbParser.hpp

    r38f991 r6bc86c  
    3333  bool operator==(const PdbParser& b) const;
    3434  void printAtomInfo(const atom *newAtom) const;
     35
     36protected:
     37  void AtomInserted(atomId_t);
     38  void AtomRemoved(atomId_t);
    3539
    3640private:
  • src/Parser/TremoloParser.cpp

    r38f991 r6bc86c  
    163163    saveLine(file, *atomIt);
    164164  }
     165}
     166
     167/** Add default info, when new atom is added to World.
     168 *
     169 * @param id of atom
     170 */
     171void TremoloParser::AtomInserted(atomId_t id)
     172{
     173  std::map<int, TremoloAtomInfoContainer>::iterator iter = additionalAtomData.find(id);
     174  ASSERT(iter == additionalAtomData.end(),
     175      "TremoloParser::AtomInserted() - additionalAtomData already present for newly added atom "
     176      +toString(id)+".");
     177  // don't add entry, as this gives a default resSeq of 0 not the molecule id
     178  // additionalAtomData.insert( std::make_pair(id, TremoloAtomInfoContainer()) );
     179}
     180
     181/** Remove additional AtomData info, when atom has been removed from World.
     182 *
     183 * @param id of atom
     184 */
     185void TremoloParser::AtomRemoved(atomId_t id)
     186{
     187  std::map<int, TremoloAtomInfoContainer>::iterator iter = additionalAtomData.find(id);
     188  // as we do not insert AtomData on AtomInserted, we cannot be assured of its presence
     189//  ASSERT(iter != additionalAtomData.end(),
     190//      "TremoloParser::AtomRemoved() - additionalAtomData is not present for atom "
     191//      +toString(id)+" to remove.");
     192  if (iter != additionalAtomData.end())
     193    additionalAtomData.erase(iter);
    165194}
    166195
  • src/Parser/TremoloParser.hpp

    r38f991 r6bc86c  
    3838  void createKnownTypesByIdentity();
    3939  void setAtomData(const std::string &atomdata_string);
     40
     41protected:
     42  void AtomInserted(atomId_t);
     43  void AtomRemoved(atomId_t);
    4044
    4145private:
Note: See TracChangeset for help on using the changeset viewer.