Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_fragmentation.cpp

    ra67d19 rbab12a  
    88#include <cstring>
    99
     10#include "World.hpp"
    1011#include "atom.hpp"
    1112#include "bond.hpp"
     
    676677  //if (FragmentationToDo) {    // we should always store the fragments again as coordination might have changed slightly without changing bond structure
    677678  // allocate memory for the pointer array and transmorph graphs into full molecular fragments
    678   BondFragments = new MoleculeListClass();
     679  BondFragments = new MoleculeListClass(World::getPointer());
    679680  int k=0;
    680681  for(Graph::iterator runner = TotalGraph.begin(); runner != TotalGraph.end(); runner++) {
     
    721722    // free memory for bond part
    722723    DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl);
    723     delete(FragmentList); // remove bond molecule from memory
     724    Free(&FragmentList); // remove bond molecule from memory
    724725    Free(&SortIndex);
    725726  } else {
     
    906907      }
    907908    } else {
    908       DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
     909      DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
    909910    }
    910911    if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
     
    929930{
    930931  atom **SonList = Calloc<atom*>(AtomCount, "molecule::StoreFragmentFromStack: **SonList");
    931   molecule *Leaf = new molecule(elemente);
     932  molecule *Leaf = World::getInstance().createMolecule();
    932933
    933934//  Log() << Verbose(1) << "Begin of StoreFragmentFromKeyset." << endl;
     
    16571658  atom *Walker = NULL;
    16581659  atom *OtherWalker = NULL;
    1659   double * const cell_size = World::get()->cell_size;
     1660  double * const cell_size = World::getInstance().getDomain();
    16601661  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    16611662  enum Shading *ColorList = NULL;
     
    16721673    // remove bonds that are beyond bonddistance
    16731674    for(int i=NDIM;i--;)
    1674       Translationvector.x[i] = 0.;
     1675      Translationvector[i] = 0.;
    16751676    // scan all bonds
    16761677    Binder = first;
     
    16791680      Binder = Binder->next;
    16801681      for (int i=NDIM;i--;) {
    1681         tmp = fabs(Binder->leftatom->x.x[i] - Binder->rightatom->x.x[i]);
     1682        tmp = fabs(Binder->leftatom->x[i] - Binder->rightatom->x[i]);
    16821683        //Log() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl;
    16831684        if (tmp > BondDistance) {
     
    16931694      // create translation vector from their periodically modified distance
    16941695      for (int i=NDIM;i--;) {
    1695         tmp = Binder->leftatom->x.x[i] - Binder->rightatom->x.x[i];
     1696        tmp = Binder->leftatom->x[i] - Binder->rightatom->x[i];
    16961697        if (fabs(tmp) > BondDistance)
    1697           Translationvector.x[i] = (tmp < 0) ? +1. : -1.;
     1698          Translationvector[i] = (tmp < 0) ? +1. : -1.;
    16981699      }
    16991700      Translationvector.MatrixMultiplication(matrix);
    17001701      //Log() << Verbose(3) << "Translation vector is ";
    1701       Translationvector.Output();
    1702       DoLog(0) && (Log() << Verbose(0) << endl);
     1702      Log() << Verbose(0) << Translationvector <<  endl;
    17031703      // apply to all atoms of first component via BFS
    17041704      for (int i=AtomCount;i--;)
     
    17091709        //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;
    17101710        ColorList[Walker->nr] = black;    // mark as explored
    1711         Walker->x.AddVector(&Translationvector); // translate
     1711        Walker->x += Translationvector; // translate
    17121712        for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    17131713          if ((*Runner) != Binder) {
Note: See TracChangeset for help on using the changeset viewer.