Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/WorldAction/RepeatBoxAction.cpp

    rda3024 rac2724  
    1313#include "molecule.hpp"
    1414#include "vector.hpp"
     15#include "Matrix.hpp"
    1516#include "verbose.hpp"
    1617#include "World.hpp"
     18#include "Box.hpp"
    1719
    1820#include <iostream>
     
    4648  MoleculeListClass *molecules = World::getInstance().getMolecules();
    4749
    48   dialog->queryVector(NAME, &Repeater, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
     50  dialog->queryVector(NAME, &Repeater, false, MapOfActions::getInstance().getDescription(NAME));
    4951  //dialog->queryMolecule("molecule-by-id", &mol,MapOfActions::getInstance().getDescription("molecule-by-id"));
    5052  vector<molecule *> AllMolecules;
     
    5961  if(dialog->display()) {
    6062    (cout << "Repeating box " << Repeater << " times for (x,y,z) axis." << endl);
    61     double * const cell_size = World::getInstance().getDomain();
    62     double *M = ReturnFullMatrixforSymmetric(cell_size);
     63    Matrix M = World::getInstance().getDomain().getM();
     64    Matrix newM = M;
    6365    Vector x,y;
    6466    int n[NDIM];
     67    Matrix repMat;
    6568    for (int axis = 0; axis < NDIM; axis++) {
    6669      Repeater[axis] = floor(Repeater[axis]);
     
    6972        Repeater[axis] = 1;
    7073      }
    71       cell_size[(abs(axis+1) == 2) ? 2 : ((abs(axis+2) == 3) ? 5 : 0)] *= Repeater[axis];
     74      repMat.at(axis,axis) = Repeater[axis];
    7275    }
     76    newM *= repMat;
     77    World::getInstance().setDomain(newM);
    7378
    7479    molecule *newmol = NULL;
     
    98103                DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    99104              x = y;
    100               x.MatrixMultiplication(M);
     105              x *= M;
    101106              newmol = World::getInstance().createMolecule();
    102107              molecules->insert(newmol);
     
    118123      }
    119124    }
    120     delete(M);
    121125    delete dialog;
    122126    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.