Changeset 63443f for molecuilder


Ignore:
Timestamp:
Jul 27, 2009, 2:22:20 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
dd69cc
Parents:
a0fb02
git-author:
Frederik Heber <heber@…> (07/27/09 14:19:12)
git-committer:
Frederik Heber <heber@…> (07/27/09 14:22:20)
Message:

BUGFIX: config::Load() added atoms in wrong order, hence resulting in wrong names.

  • config::Load() - int in LinearList should have been mapped not original one
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/config.cpp

    ra0fb02 r63443f  
    936936    map<int, atom *> AtomList[config::MaxTypes];
    937937    map<int, atom *> LinearList;
     938    atom *neues = NULL;
    938939    if (!FastParsing) {
    939940      // parse in trajectories
    940941      bool status = true;
    941       atom *neues = NULL;
    942942      while (status) {
    943943        cout << "Currently parsing MD step " << repetition << "." << endl;
     
    949949              neues = new atom();
    950950              AtomList[i][j] = neues;
    951               LinearList[FileBuffer->CurrentLine] = neues;
     951              LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
    952952              neues->type = elementhash[i]; // find element type
    953953            } else
     
    10051005        }
    10061006        repetition++;
    1007       }
    1008       // put atoms into the molecule in their original order
    1009       for(map<int, atom*>::iterator runner = LinearList.begin(); runner != LinearList.end(); ++runner) {
    1010         mol->AddAtom(runner->second);
    10111007      }
    10121008      repetition--;
     
    10261022        for(int j=0;j<No[i];j++) {
    10271023          sprintf(keyword,"%s_%i",name, j+1);
    1028           atom *neues = new atom();
     1024          if (repetition == 0) {
     1025            neues = new atom();
     1026            AtomList[i][j] = neues;
     1027            LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
     1028            neues->type = elementhash[i]; // find element type
     1029          } else
     1030            neues = AtomList[i][j];
    10291031          // then parse for each atom the coordinates as often as present
    10301032          ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &neues->x.x[0], repetition,critical);
     
    10431045        }
    10441046      }
     1047    }
     1048    // put atoms into the molecule in their original order
     1049    for(map<int, atom*>::iterator runner = LinearList.begin(); runner != LinearList.end(); ++runner) {
     1050      mol->AddAtom(runner->second);
    10451051    }
    10461052  }
Note: See TracChangeset for help on using the changeset viewer.