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