Ignore:
File:
1 edited

Legend:

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

    rac2724 rda3024  
    1313#include "molecule.hpp"
    1414#include "vector.hpp"
    15 #include "Matrix.hpp"
    1615#include "verbose.hpp"
    1716#include "World.hpp"
    18 #include "Box.hpp"
    1917
    2018#include <iostream>
     
    4846  MoleculeListClass *molecules = World::getInstance().getMolecules();
    4947
    50   dialog->queryVector(NAME, &Repeater, false, MapOfActions::getInstance().getDescription(NAME));
     48  dialog->queryVector(NAME, &Repeater, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
    5149  //dialog->queryMolecule("molecule-by-id", &mol,MapOfActions::getInstance().getDescription("molecule-by-id"));
    5250  vector<molecule *> AllMolecules;
     
    6159  if(dialog->display()) {
    6260    (cout << "Repeating box " << Repeater << " times for (x,y,z) axis." << endl);
    63     Matrix M = World::getInstance().getDomain().getM();
    64     Matrix newM = M;
     61    double * const cell_size = World::getInstance().getDomain();
     62    double *M = ReturnFullMatrixforSymmetric(cell_size);
    6563    Vector x,y;
    6664    int n[NDIM];
    67     Matrix repMat;
    6865    for (int axis = 0; axis < NDIM; axis++) {
    6966      Repeater[axis] = floor(Repeater[axis]);
     
    7269        Repeater[axis] = 1;
    7370      }
    74       repMat.at(axis,axis) = Repeater[axis];
     71      cell_size[(abs(axis+1) == 2) ? 2 : ((abs(axis+2) == 3) ? 5 : 0)] *= Repeater[axis];
    7572    }
    76     newM *= repMat;
    77     World::getInstance().setDomain(newM);
    7873
    7974    molecule *newmol = NULL;
     
    10398                DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl);
    10499              x = y;
    105               x *= M;
     100              x.MatrixMultiplication(M);
    106101              newmol = World::getInstance().createMolecule();
    107102              molecules->insert(newmol);
     
    123118      }
    124119    }
     120    delete(M);
    125121    delete dialog;
    126122    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.