Changes in src/moleculelist.cpp [244a84:58ed4a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r244a84 r58ed4a 19 19 #include "memoryallocator.hpp" 20 20 #include "periodentafel.hpp" 21 #include "World.hpp" 21 22 22 23 /*********************************** Functions for class MoleculeListClass *************************/ … … 313 314 Tesselation *TesselStruct = NULL; 314 315 if ((srcmol == NULL) || (mol == NULL)) { 315 eLog() << Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl;316 DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl); 316 317 return false; 317 318 } … … 321 322 FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL); 322 323 if (TesselStruct == NULL) { 323 eLog() << Verbose(1) << "Could not tesselate the fixed molecule." << endl;324 DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl); 324 325 return false; 325 326 } … … 442 443 input.open(line.c_str()); 443 444 if (input == NULL) { 444 eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl;445 DoeLog(0) && (eLog()<< Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl); 445 446 performCriticalExit(); 446 447 return false; … … 638 639 int FragmentCounter = 0; 639 640 ofstream output; 640 641 double cell_size_backup[6]; 642 double * const cell_size = World::get()->cell_size; 643 644 // backup cell_size 645 for (int i=0;i<6;i++) 646 cell_size_backup[i] = cell_size[i]; 641 647 // store the fragments as config and as xyz 642 648 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { … … 646 652 strcpy(PathBackup, path); 647 653 else { 648 eLog() << Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl;654 DoeLog(0) && (eLog()<< Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl); 649 655 performCriticalExit(); 650 656 } … … 682 688 j += k + 1; 683 689 BoxDimension.x[k] = 2.5 * (configuration->GetIsAngstroem() ? 1. : 1. / AtomicLengthToAngstroem); 684 (*ListRunner)->cell_size[j] += BoxDimension.x[k] * 2.;690 cell_size[j] = BoxDimension.x[k] * 2.; 685 691 } 686 692 (*ListRunner)->Translate(&BoxDimension); … … 724 730 // printing final number 725 731 Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl; 732 733 // restore cell_size 734 for (int i=0;i<6;i++) 735 cell_size[i] = cell_size_backup[i]; 726 736 727 737 return result; … … 776 786 777 787 // 1. dissect the molecule into connected subgraphs 778 configuration->BG->ConstructBondGraph(mol); 788 if (!configuration->BG->ConstructBondGraph(mol)) { 789 delete (mol); 790 DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl); 791 return; 792 } 779 793 780 794 // 2. scan for connected subgraphs … … 783 797 Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack); 784 798 delete(BackEdgeStack); 799 if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) { 800 delete (mol); 801 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl); 802 return; 803 } 785 804 786 805 // 3. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in … … 824 843 Walker = mol->start->next; 825 844 if ((Walker->nr <0) || (Walker->nr >= mol->AtomCount)) { 826 eLog() << Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl;845 DoeLog(0) && (eLog()<< Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl); 827 846 performCriticalExit(); 828 847 } … … 833 852 molecules[FragmentCounter-1]->AddAtom(Walker); // counting starts at 1 834 853 } else { 835 eLog() << Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl;854 DoeLog(0) && (eLog()<< Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl); 836 855 performCriticalExit(); 837 856 }
Note:
See TracChangeset
for help on using the changeset viewer.