Changeset 531f27


Ignore:
Timestamp:
Apr 6, 2012, 11:45:30 AM (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:
23fd43
Parents:
80ca29
git-author:
Frederik Heber <heber@…> (04/05/12 08:53:23)
git-committer:
Frederik Heber <heber@…> (04/06/12 11:45:30)
Message:

Added SaveSelectedAtomsAsExtTypesAction that creates a tremolo-specific .exttypes file.

  • the functionality is implemented in TremoloParser.
  • it is required to perform a save on the atoms before such that ids are correct.
  • the actions tells whether ids are valid or not.
  • also added regression test Parser/Tremolo-Exttypes.
Files:
7 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/GlobalListOfActions.hpp

    r80ca29 r531f27  
    4545        (ParserSetTremoloAtomdata) \
    4646        (ParserParseTremoloPotentials) \
     47        (ParserSaveSelectedAtomsAsExtTypes) \
    4748        (ParserSetParserParameters) \
    4849        (ParserSetOutputFormats) \
  • src/Actions/Makefile.am

    r80ca29 r531f27  
    261261PARSERACTIONSOURCE = \
    262262  Actions/ParserAction/ParseTremoloPotentialsAction.cpp \
     263  Actions/ParserAction/SaveSelectedAtomsAsExtTypesAction.cpp \
    263264  Actions/ParserAction/SetParserParametersAction.cpp \
    264265  Actions/ParserAction/SetOutputFormatsAction.cpp \
     
    266267PARSERACTIONHEADER = \
    267268  Actions/ParserAction/ParseTremoloPotentialsAction.hpp \
     269  Actions/ParserAction/SaveSelectedAtomsAsExtTypesAction.hpp \
    268270  Actions/ParserAction/SetParserParametersAction.hpp \
    269271  Actions/ParserAction/SetOutputFormatsAction.hpp \
     
    271273PARSERACTIONDEFS = \
    272274  Actions/ParserAction/ParseTremoloPotentialsAction.def \
     275  Actions/ParserAction/SaveSelectedAtomsAsExtTypesAction.def \
    273276  Actions/ParserAction/SetParserParametersAction.def \
    274277  Actions/ParserAction/SetOutputFormatsAction.def \
  • src/Parser/TremoloParser.cpp

    r80ca29 r531f27  
    521521}
    522522
     523bool FormatParser< tremolo >::saveAtomsInExttypes(std::ostream &output, const std::vector<atom*> &atoms, const int id) const
     524{
     525  bool status = true;
     526  // parse the file
     527  for (std::vector<atom *>::const_iterator iter = atoms.begin();
     528      iter != atoms.end(); ++iter) {
     529    const int atomicid = getLocalId((*iter)->getId());
     530    if (atomicid == -1)
     531      status = false;
     532    output << atomicid << "\t" << id << std::endl;
     533  }
     534
     535  return status;
     536}
     537
    523538/**
    524539 * Reads neighbor information for one atom from the input.
  • src/Parser/TremoloParser.hpp

    r80ca29 r531f27  
    7171  }
    7272
     73  /** Save given \a atoms in tremolo's exttypes file
     74   *
     75   * \note You should have stored the atoms beforehand to give them unique
     76   * and sensible ids.
     77   *
     78   * @param output output stream
     79   * @param atoms vector of atoms whose ids to store
     80   * @param id id to given this exttypes group
     81   * @return true - all atomic ids are valid, false - one id was not set (-1)
     82   */
     83  bool saveAtomsInExttypes(std::ostream &output, const std::vector<atom*> &atoms, const int id) const;
     84
    7385protected:
    7486  void AtomInserted(atomId_t);
  • tests/Python/AllActions/options.dat

    r80ca29 r531f27  
    6565end-step        "1"
    6666fastparsing     "1"
     67filename        "test.exttypes"
    6768fill-molecule   "filler.xyz"
    6869fill-void       "hydrogen.xyz"
     
    135136save-bonds      "test.bond"
    136137save-selected-atoms     "testsave.xyz"
     138save-selected-atoms-as-exttypes "test.exttypes"
    137139save-selected-molecules "testsave.xyz"
    138140save-temperature        "test.ekin"
  • tests/regression/Makefile.am

    r80ca29 r531f27  
    134134        $(srcdir)/Parser/Tremolo/testsuite-parser-tremolo-load-multiply.at \
    135135        $(srcdir)/Parser/Tremolo/testsuite-parser-tremolo-save.at \
     136        $(srcdir)/Parser/Tremolo-Exttypes/testsuite-parser-tremolo-save-selected-atoms-as-exttypes.at \
    136137        $(srcdir)/Parser/Tremolo-Potentials/testsuite-parser-tremolo-potentials.at \
    137138        $(srcdir)/Parser/Tremolo-Potentials/testsuite-parser-tremolo-potentials-load.at \
  • tests/regression/Parser/testsuite-parser.at

    r80ca29 r531f27  
    5858m4_include([Parser/Tremolo-SetAtomdata/testsuite-parser-tremolo-setatomdata.at])
    5959
     60# writing and exttypes file
     61m4_include([Parser/Tremolo-Exttypes/testsuite-parser-tremolo-save-selected-atoms-as-exttypes.at])
     62
    6063# parsing xyz
    6164m4_include([Parser/Xyz/testsuite-parser-xyz-empty.at])
Note: See TracChangeset for help on using the changeset viewer.