- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/RepeatBoxAction.cpp
rac2724 rda3024 13 13 #include "molecule.hpp" 14 14 #include "vector.hpp" 15 #include "Matrix.hpp"16 15 #include "verbose.hpp" 17 16 #include "World.hpp" 18 #include "Box.hpp"19 17 20 18 #include <iostream> … … 48 46 MoleculeListClass *molecules = World::getInstance().getMolecules(); 49 47 50 dialog->queryVector(NAME, &Repeater, false, MapOfActions::getInstance().getDescription(NAME));48 dialog->queryVector(NAME, &Repeater, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME)); 51 49 //dialog->queryMolecule("molecule-by-id", &mol,MapOfActions::getInstance().getDescription("molecule-by-id")); 52 50 vector<molecule *> AllMolecules; … … 61 59 if(dialog->display()) { 62 60 (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); 65 63 Vector x,y; 66 64 int n[NDIM]; 67 Matrix repMat;68 65 for (int axis = 0; axis < NDIM; axis++) { 69 66 Repeater[axis] = floor(Repeater[axis]); … … 72 69 Repeater[axis] = 1; 73 70 } 74 repMat.at(axis,axis)= Repeater[axis];71 cell_size[(abs(axis+1) == 2) ? 2 : ((abs(axis+2) == 3) ? 5 : 0)] *= Repeater[axis]; 75 72 } 76 newM *= repMat;77 World::getInstance().setDomain(newM);78 73 79 74 molecule *newmol = NULL; … … 103 98 DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl); 104 99 x = y; 105 x *= M;100 x.MatrixMultiplication(M); 106 101 newmol = World::getInstance().createMolecule(); 107 102 molecules->insert(newmol); … … 123 118 } 124 119 } 120 delete(M); 125 121 delete dialog; 126 122 return Action::success;
Note:
See TracChangeset
for help on using the changeset viewer.