Ignore:
Timestamp:
Jul 10, 2009, 9:01:40 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
c95b69
Parents:
598f76
git-author:
Frederik Heber <heber@…> (07/10/09 20:21:12)
git-committer:
Frederik Heber <heber@…> (07/10/09 21:01:40)
Message:

new class ConfigFileBuffer and new overloaded function ParseForParaneter() based on this buffer

  • the problem is that we need to use molecuilder for the periodic translating of atoms in a xzy file. However, molecuilder resorts them per element. This destroty the id mapping needed for the DBOND file. The storing was corrected, but also the loading relies on this order.
  • To solve this, we have to pull off quite something: Parse file into buffer, resort the Ion_Type ones (via a map only), load atoms and then put them into the molecule in the original order!
  • Hence, in config::Load we also have a LinearList (map<int, atom*>) in order to add the atoms after the scanning in their original order into the molecule.
  • class ConfigFileBuffer parses a config file line-wise into a buffer and allows for resorting (via a map) of lines containing key_word Ion_Type.
  • BUGFIX: molecule::Output...() were writing the wrong elements, as they were numbered during the output and not before in ascending order! (I.e. if the first atom is Si, but there is also H present, then this Si would become Ion_Type1_1 instead of Ion_Type2_1, because the elements are still sorted by their Z value, hence Ion_Type1 is H!)

This is basically tested and seems to work properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.hpp

    r598f76 r88b936  
    392392};
    393393
     394class ConfigFileBuffer {
     395  public:
     396    char **buffer;
     397    int *LineMapping;
     398    int CurrentLine;
     399    int NoLines;
     400
     401    ConfigFileBuffer();
     402    ConfigFileBuffer(char *filename);
     403    ~ConfigFileBuffer();
     404
     405    void InitMapping();
     406    void MapIonTypesInBuffer(int NoAtoms);
     407};
     408
     409
    394410/** The config file.
    395411 * The class contains all parameters that control a dft run also functions to load and save.
     
    469485
    470486        int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);
     487        int ParseForParameter(int verbose, struct ConfigFileBuffer *FileBuffer, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);
    471488
    472489        public:
Note: See TracChangeset for help on using the changeset viewer.