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