Changes in src/moleculelist.cpp [35b698:84c494]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r35b698 r84c494 24 24 #include "periodentafel.hpp" 25 25 #include "Helpers/Assert.hpp" 26 #include "Matrix.hpp" 27 #include "Box.hpp" 26 28 27 29 #include "Helpers/Assert.hpp" … … 631 633 int FragmentCounter = 0; 632 634 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 639 638 // store the fragments as config and as xyz 640 639 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { … … 674 673 (*ListRunner)->CenterEdge(&BoxDimension); 675 674 (*ListRunner)->SetBoxDimension(&BoxDimension); // update Box of atoms by boundary 676 int j = -1;677 675 for (int k = 0; k < NDIM; k++) { 678 j += k + 1;679 676 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); 682 680 (*ListRunner)->Translate(&BoxDimension); 683 681 … … 725 723 726 724 // 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); 729 726 730 727 return result; … … 887 884 // center at set box dimensions 888 885 mol->CenterEdge(¢er); 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); 895 890 insert(mol); 896 891 }
Note:
See TracChangeset
for help on using the changeset viewer.