Changes in src/molecule_fragmentation.cpp [a67d19:bab12a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_fragmentation.cpp
ra67d19 rbab12a 8 8 #include <cstring> 9 9 10 #include "World.hpp" 10 11 #include "atom.hpp" 11 12 #include "bond.hpp" … … 676 677 //if (FragmentationToDo) { // we should always store the fragments again as coordination might have changed slightly without changing bond structure 677 678 // allocate memory for the pointer array and transmorph graphs into full molecular fragments 678 BondFragments = new MoleculeListClass( );679 BondFragments = new MoleculeListClass(World::getPointer()); 679 680 int k=0; 680 681 for(Graph::iterator runner = TotalGraph.begin(); runner != TotalGraph.end(); runner++) { … … 721 722 // free memory for bond part 722 723 DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl); 723 delete(FragmentList); // remove bond molecule from memory724 Free(&FragmentList); // remove bond molecule from memory 724 725 Free(&SortIndex); 725 726 } else { … … 906 907 } 907 908 } else { 908 DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner-> Name << " has father " << FatherOfRunner->Name<< " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);909 DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl); 909 910 } 910 911 if ((LonelyFlag) && (Leaf->AtomCount > 1)) { … … 929 930 { 930 931 atom **SonList = Calloc<atom*>(AtomCount, "molecule::StoreFragmentFromStack: **SonList"); 931 molecule *Leaf = new molecule(elemente);932 molecule *Leaf = World::getInstance().createMolecule(); 932 933 933 934 // Log() << Verbose(1) << "Begin of StoreFragmentFromKeyset." << endl; … … 1657 1658 atom *Walker = NULL; 1658 1659 atom *OtherWalker = NULL; 1659 double * const cell_size = World::get ()->cell_size;1660 double * const cell_size = World::getInstance().getDomain(); 1660 1661 double *matrix = ReturnFullMatrixforSymmetric(cell_size); 1661 1662 enum Shading *ColorList = NULL; … … 1672 1673 // remove bonds that are beyond bonddistance 1673 1674 for(int i=NDIM;i--;) 1674 Translationvector .x[i] = 0.;1675 Translationvector[i] = 0.; 1675 1676 // scan all bonds 1676 1677 Binder = first; … … 1679 1680 Binder = Binder->next; 1680 1681 for (int i=NDIM;i--;) { 1681 tmp = fabs(Binder->leftatom->x .x[i] - Binder->rightatom->x.x[i]);1682 tmp = fabs(Binder->leftatom->x[i] - Binder->rightatom->x[i]); 1682 1683 //Log() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl; 1683 1684 if (tmp > BondDistance) { … … 1693 1694 // create translation vector from their periodically modified distance 1694 1695 for (int i=NDIM;i--;) { 1695 tmp = Binder->leftatom->x .x[i] - Binder->rightatom->x.x[i];1696 tmp = Binder->leftatom->x[i] - Binder->rightatom->x[i]; 1696 1697 if (fabs(tmp) > BondDistance) 1697 Translationvector .x[i] = (tmp < 0) ? +1. : -1.;1698 Translationvector[i] = (tmp < 0) ? +1. : -1.; 1698 1699 } 1699 1700 Translationvector.MatrixMultiplication(matrix); 1700 1701 //Log() << Verbose(3) << "Translation vector is "; 1701 Translationvector.Output(); 1702 DoLog(0) && (Log() << Verbose(0) << endl); 1702 Log() << Verbose(0) << Translationvector << endl; 1703 1703 // apply to all atoms of first component via BFS 1704 1704 for (int i=AtomCount;i--;) … … 1709 1709 //Log() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl; 1710 1710 ColorList[Walker->nr] = black; // mark as explored 1711 Walker->x .AddVector(&Translationvector); // translate1711 Walker->x += Translationvector; // translate 1712 1712 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1713 1713 if ((*Runner) != Binder) {
Note:
See TracChangeset
for help on using the changeset viewer.