Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/moleculelist.cpp

    r35b698 r84c494  
    2424#include "periodentafel.hpp"
    2525#include "Helpers/Assert.hpp"
     26#include "Matrix.hpp"
     27#include "Box.hpp"
    2628
    2729#include "Helpers/Assert.hpp"
     
    631633  int FragmentCounter = 0;
    632634  ofstream output;
    633   double cell_size_backup[6];
    634   double * const cell_size = World::getInstance().getDomain();
    635 
    636   // backup cell_size
    637   for (int i=0;i<6;i++)
    638     cell_size_backup[i] = cell_size[i];
     635  Matrix cell_size = World::getInstance().getDomain().getM();
     636  Matrix cell_size_backup = cell_size;
     637
    639638  // store the fragments as config and as xyz
    640639  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
     
    674673    (*ListRunner)->CenterEdge(&BoxDimension);
    675674    (*ListRunner)->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary
    676     int j = -1;
    677675    for (int k = 0; k < NDIM; k++) {
    678       j += k + 1;
    679676      BoxDimension[k] = 2.5 * (World::getInstance().getConfig()->GetIsAngstroem() ? 1. : 1. / AtomicLengthToAngstroem);
    680       cell_size[j] = BoxDimension[k] * 2.;
    681     }
     677      cell_size.at(k,k) = BoxDimension[k] * 2.;
     678    }
     679    World::getInstance().setDomain(cell_size);
    682680    (*ListRunner)->Translate(&BoxDimension);
    683681
     
    725723
    726724  // restore cell_size
    727   for (int i=0;i<6;i++)
    728     cell_size[i] = cell_size_backup[i];
     725  World::getInstance().setDomain(cell_size_backup);
    729726
    730727  return result;
     
    887884  // center at set box dimensions
    888885  mol->CenterEdge(&center);
    889   World::getInstance().getDomain()[0] = center[0];
    890   World::getInstance().getDomain()[1] = 0;
    891   World::getInstance().getDomain()[2] = center[1];
    892   World::getInstance().getDomain()[3] = 0;
    893   World::getInstance().getDomain()[4] = 0;
    894   World::getInstance().getDomain()[5] = center[2];
     886  Matrix domain;
     887  for(int i =0;i<NDIM;++i)
     888    domain.at(i,i) = center[i];
     889  World::getInstance().setDomain(domain);
    895890  insert(mol);
    896891}
Note: See TracChangeset for help on using the changeset viewer.