Ignore:
Timestamp:
May 2, 2010, 4:47:18 PM (15 years ago)
Author:
Saskia Metzler <metzler@…>
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:
b9b604
Parents:
4415da
Message:

Tremolo format parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TremoloParser.hpp

    r4415da rb8d4a3  
    1313
    1414/**
    15  * Holds tremolo-specific information which is not store in the atom class.
     15 * Known keys for the ATOMDATA line.
    1616 */
    17 class TremoloAtomInfoContainer {
     17class TremoloKey {
    1818public:
    19   TremoloAtomInfoContainer();
    20   std::string F;
    21   std::string stress;
    22   std::string imprData;
    23   std::string GroupMeasureTypeNo;
    24   std::string extType;
    25   std::string name;
    26   std::string resName;
    27   std::string chainID;
    28   std::string resSeq;
    29   std::string occupancy;
    30   std::string tempFactor;
    31   std::string segID;
    32   std::string Charge;
    33   std::string charge;
    34   std::string GrpTypeNo;
    35 };
    36 
    37 /**
    38  * Loads a tremolo file into the World and saves the World as a tremolo file.
    39  */
    40 class TremoloParser:public FormatParser
    41 {
    42 public:
    43   TremoloParser();
    44   ~TremoloParser();
    45   void load(std::istream* file);
    46   void save(std::ostream* file);
    47 
    48 private:
    49   void readAtomDataLine(string line);
    50   void parseAtomDataKeysLine(string line, int offset);
    51 
    52   /**
    53    * Known keys for the ATOMDATA line.
    54    */
    5519  enum atomDataKey {
    5620    noKey,
     
    7438    Charge,
    7539    charge,
    76     GrpTypeNo
     40    GrpTypeNo,
     41    torsion
    7742  };
     43};
     44
     45/**
     46 * Holds tremolo-specific information which is not store in the atom class.
     47 */
     48class TremoloAtomInfoContainer {
     49public:
     50  TremoloAtomInfoContainer();
     51  void set(TremoloKey::atomDataKey key, std::string value);
     52  std::string get(TremoloKey::atomDataKey key);
     53  std::string F;
     54  std::string stress;
     55  std::string imprData;
     56  std::string GroupMeasureTypeNo;
     57  std::string extType;
     58  std::string name;
     59  std::string resName;
     60  std::string chainID;
     61  std::string resSeq;
     62  std::string occupancy;
     63  std::string tempFactor;
     64  std::string segID;
     65  std::string Charge;
     66  std::string charge;
     67  std::string GrpTypeNo;
     68  std::string torsion;
     69  std::vector<int> neighbors;
     70};
     71
     72/**
     73 * Loads a tremolo file into the World and saves the World as a tremolo file.
     74 */
     75class TremoloParser : public FormatParser
     76{
     77public:
     78  TremoloParser();
     79  ~TremoloParser();
     80  void load(std::istream* file);
     81  void save(std::ostream* file);
     82  void setFieldsForSave(std::string atomDataLine);
     83
     84
     85private:
     86  void readAtomDataLine(string line);
     87  void parseAtomDataKeysLine(string line, int offset);
     88  void readNeighbors(std::stringstream* line, int numberOfNeighbors, int atomId);
     89  void processNeighborInformation();
     90  void adaptImprData();
     91  void adaptTorsion();
     92  std::string adaptIdDependentDataString(std::string data);
     93  bool isUsedField(std::string fieldName);
     94  void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom);
     95  void saveLine(std::ostream* file, atom* currentAtom);
    7896
    7997  /**
    8098   * Map to associate the known keys with numbers.
    8199   */
    82   std::map<std::string, atomDataKey> knownKeys;
     100  std::map<std::string, TremoloKey::atomDataKey> knownKeys;
    83101
    84102  /**
     
    91109   * file.
    92110   */
    93   std::map<int, TremoloAtomInfoContainer> moreData;
     111  std::map<int, TremoloAtomInfoContainer> additionalAtomData;
     112
     113  /**
     114   * Default additional atom data.
     115   */
     116  TremoloAtomInfoContainer defaultAdditionalData;
     117
     118  /**
     119   * Maps original atom IDs received from the parsed file to atom IDs in the
     120   * world.
     121   */
     122  std::map<int, int> atomIdMap;
    94123};
    95124
Note: See TracChangeset for help on using the changeset viewer.