Changes in src/builder.cpp [f66195:7ea9e6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
-
Property mode
changed from
100644
to100755
rf66195 r7ea9e6 50 50 using namespace std; 51 51 52 #include "analysis_correlation.hpp" 52 53 #include "atom.hpp" 53 54 #include "bond.hpp" 55 #include "bondgraph.hpp" 54 56 #include "boundary.hpp" 55 57 #include "config.hpp" … … 253 255 } while ((j != -1) && (i<128)); 254 256 if (i >= 2) { 255 first->x.LSQdistance( atoms, i);257 first->x.LSQdistance((const Vector **)atoms, i); 256 258 257 259 first->x.Output((ofstream *)&cout); … … 591 593 { 592 594 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 593 LinkedCell LCList(mol, 10.);594 595 class Tesselation *TesselStruct = NULL; 595 FindConvexBorder((ofstream *)&cout, mol, &LCList, NULL); 596 const LinkedCell *LCList = NULL; 597 LCList = new LinkedCell(mol, 10.); 598 FindConvexBorder((ofstream *)&cout, mol, TesselStruct, LCList, NULL); 596 599 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, configuration); 597 cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl; 600 cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\ 601 delete(LCList); 598 602 delete(TesselStruct); 599 603 } … … 719 723 cin >> factor[2]; 720 724 valid = true; 721 mol->Scale( &factor);725 mol->Scale((const double ** const)&factor); 722 726 delete[](factor); 723 727 } … … 837 841 } 838 842 if (mol->first->next != mol->last) // if connect matrix is present already, redo it 839 mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance, configuration->GetIsAngstroem() );843 mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 840 844 // free memory 841 845 delete[](Elements); … … 893 897 cin >> bonddistance; 894 898 start = clock(); 895 mol->CreateAdjacencyList((ofstream *)&cout, bonddistance, configuration->GetIsAngstroem()); 896 mol->CreateListOfBondsPerAtom((ofstream *)&cout); 899 mol->CreateAdjacencyList((ofstream *)&cout, bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 897 900 end = clock(); 898 901 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; … … 1247 1250 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1248 1251 int N = molecules->ListOfMolecules.size(); 1249 int *src = new int (N);1252 int *src = new int[N]; 1250 1253 N=0; 1251 1254 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { … … 1254 1257 } 1255 1258 molecules->SimpleMultiAdd(mol, src, N); 1256 delete (src);1259 delete[](src); 1257 1260 1258 1261 // ... and translate back … … 1354 1357 int argptr; 1355 1358 molecule *mol = NULL; 1359 string BondGraphFileName(""); 1356 1360 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1357 1361 … … 1375 1379 cout << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl; 1376 1380 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 1381 cout << "\t-C\tPair Correlation analysis." << endl; 1377 1382 cout << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl; 1378 1383 cout << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl; … … 1380 1385 cout << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl; 1381 1386 cout << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl; 1387 cout << "\t-g <file>\tParses a bond length table from the given file." << endl; 1382 1388 cout << "\t-h/-H/-?\tGive this help screen." << endl; 1383 1389 cout << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl; … … 1416 1422 } 1417 1423 break; 1424 case 'g': 1425 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1426 cerr << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl; 1427 } else { 1428 BondGraphFileName = argv[argptr]; 1429 cout << "Using " << BondGraphFileName << " as bond length table." << endl; 1430 argptr+=1; 1431 } 1432 break; 1418 1433 case 'n': 1419 1434 cout << "I won't parse trajectories." << endl; … … 1428 1443 } while (argptr < argc); 1429 1444 1430 // 2. Parse the element database1445 // 3a. Parse the element database 1431 1446 if (periode->LoadPeriodentafel(configuration.databasepath)) { 1432 1447 cout << Verbose(0) << "Element list loaded successfully." << endl; … … 1436 1451 return 1; 1437 1452 } 1438 // 3 . Find config file name and parse if possible1453 // 3b. Find config file name and parse if possible, also BondGraphFileName 1439 1454 if (argv[1][0] != '-') { 1440 1455 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place 1441 mol = new molecule(periode);1442 mol->ActiveFlag = true;1443 molecules->insert(mol);1444 1445 1456 cout << Verbose(0) << "Config file given." << endl; 1446 1457 test.open(argv[1], ios::in); … … 1461 1472 ConfigFileName = argv[1]; 1462 1473 cout << Verbose(1) << "Specified config file found, parsing ... "; 1463 switch (configuration.TestSyntax(ConfigFileName, periode , mol)) {1474 switch (configuration.TestSyntax(ConfigFileName, periode)) { 1464 1475 case 1: 1465 1476 cout << "new syntax." << endl; 1466 configuration.Load(ConfigFileName, periode, mol);1477 configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules); 1467 1478 configPresent = present; 1468 1479 break; 1469 1480 case 0: 1470 1481 cout << "old syntax." << endl; 1471 configuration.LoadOld(ConfigFileName, periode, mol);1482 configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules); 1472 1483 configPresent = present; 1473 1484 break; … … 1479 1490 } else 1480 1491 configPresent = absent; 1492 // set mol to first active molecule 1493 if (molecules->ListOfMolecules.size() != 0) { 1494 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1495 if ((*ListRunner)->ActiveFlag) { 1496 mol = *ListRunner; 1497 break; 1498 } 1499 } 1500 if (mol == NULL) { 1501 mol = new molecule(periode); 1502 mol->ActiveFlag = true; 1503 molecules->insert(mol); 1504 } 1505 1481 1506 // 4. parse again through options, now for those depending on elements db and config presence 1482 1507 argptr = 1; … … 1505 1530 case 'a': 1506 1531 if (ExitFlag == 0) ExitFlag = 1; 1507 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) ) {1532 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) { 1508 1533 ExitFlag = 255; 1509 1534 cerr << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl; … … 1549 1574 int *MinimumRingSize = new int[mol->AtomCount]; 1550 1575 atom ***ListOfLocalAtoms = NULL; 1551 int FragmentCounter = 0;1552 1576 class StackClass<bond *> *BackEdgeStack = NULL; 1553 1577 class StackClass<bond *> *LocalBackEdgeStack = NULL; 1554 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem()); 1555 mol->CreateListOfBondsPerAtom((ofstream *)&cout); 1578 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 1556 1579 Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack); 1557 1580 if (Subgraphs != NULL) { 1558 Subgraphs->next->FillBondStructureFromReference((ofstream *)&cout, mol, (FragmentCounter = 0), ListOfLocalAtoms, false); // we want to keep the created ListOfLocalAtoms1581 int FragmentCounter = 0; 1559 1582 while (Subgraphs->next != NULL) { 1560 1583 Subgraphs = Subgraphs->next; 1584 Subgraphs->FillBondStructureFromReference((ofstream *)&cout, mol, FragmentCounter, ListOfLocalAtoms, false); // we want to keep the created ListOfLocalAtoms 1561 1585 LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount); 1562 Subgraphs->Leaf->PickLocalBackEdges((ofstream *)&cout, ListOfLocalAtoms[FragmentCounter ++], BackEdgeStack, LocalBackEdgeStack);1563 Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, BackEdgeStack, MinimumRingSize);1586 Subgraphs->Leaf->PickLocalBackEdges((ofstream *)&cout, ListOfLocalAtoms[FragmentCounter], BackEdgeStack, LocalBackEdgeStack); 1587 Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, LocalBackEdgeStack, MinimumRingSize); 1564 1588 delete(LocalBackEdgeStack); 1565 1589 delete(Subgraphs->previous); 1590 FragmentCounter++; 1566 1591 } 1567 1592 delete(Subgraphs); 1568 1593 for (int i=0;i<FragmentCounter;i++) 1569 Free(&ListOfLocalAtoms[ FragmentCounter]);1594 Free(&ListOfLocalAtoms[i]); 1570 1595 Free(&ListOfLocalAtoms); 1571 1596 } … … 1574 1599 } 1575 1600 //argptr+=1; 1601 break; 1602 case 'C': 1603 if (ExitFlag == 0) ExitFlag = 1; 1604 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr][0] == '-') || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-')) { 1605 ExitFlag = 255; 1606 cerr << "Not enough or invalid arguments given for pair correlation analysis: -C <Z> <output> <bin output>" << endl; 1607 } else { 1608 SaveFlag = false; 1609 ofstream output(argv[argptr+1]); 1610 ofstream binoutput(argv[argptr+2]); 1611 const double radius = 5.; 1612 1613 // get the boundary 1614 class molecule *Boundary = NULL; 1615 class Tesselation *TesselStruct = NULL; 1616 const LinkedCell *LCList = NULL; 1617 // find biggest molecule 1618 int counter = 0; 1619 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1620 if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) { 1621 Boundary = *BigFinder; 1622 } 1623 counter++; 1624 } 1625 bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives"); 1626 counter = 0; 1627 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1628 Actives[counter] = (*BigFinder)->ActiveFlag; 1629 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true; 1630 } 1631 LCList = new LinkedCell(Boundary, 2.*radius); 1632 element *elemental = periode->FindElement((const int) atoi(argv[argptr])); 1633 FindNonConvexBorder((ofstream *)&cout, Boundary, TesselStruct, LCList, radius, NULL); 1634 int ranges[NDIM] = {1,1,1}; 1635 CorrelationToSurfaceMap *surfacemap = PeriodicCorrelationToSurface( (ofstream *)&cout, molecules, elemental, TesselStruct, LCList, ranges ); 1636 BinPairMap *binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 0. ); 1637 OutputCorrelation ( &binoutput, binmap ); 1638 output.close(); 1639 binoutput.close(); 1640 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) 1641 (*BigFinder)->ActiveFlag = Actives[counter]; 1642 Free(&Actives); 1643 delete(LCList); 1644 delete(TesselStruct); 1645 argptr+=3; 1646 } 1576 1647 break; 1577 1648 case 'E': … … 1634 1705 cout << "Parsing bonds from " << argv[argptr] << "." << endl; 1635 1706 ifstream *input = new ifstream(argv[argptr]); 1636 mol->CreateAdjacencyList 2((ofstream *)&cout, input);1707 mol->CreateAdjacencyListFromDbondFile((ofstream *)&cout, input); 1637 1708 input->close(); 1638 1709 argptr+=1; … … 1645 1716 cerr << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl; 1646 1717 } else { 1647 class Tesselation T; 1718 class Tesselation *T = NULL; 1719 const LinkedCell *LCList = NULL; 1648 1720 string filename(argv[argptr+1]); 1649 1721 filename.append(".csv"); … … 1651 1723 cout << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl; 1652 1724 start = clock(); 1653 L inkedCell LCList(mol, atof(argv[argptr])*2.);1654 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, atof(argv[argptr]), argv[argptr+1]);1655 //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());1725 LCList = new LinkedCell(mol, atof(argv[argptr])*2.); 1726 FindNonConvexBorder((ofstream *)&cout, mol, T, LCList, atof(argv[argptr]), argv[argptr+1]); 1727 //FindDistributionOfEllipsoids((ofstream *)&cout, T, &LCList, N, number, filename.c_str()); 1656 1728 end = clock(); 1657 1729 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; 1730 delete(LCList); 1658 1731 argptr+=2; 1659 1732 } … … 1735 1808 case 't': 1736 1809 if (ExitFlag == 0) ExitFlag = 1; 1737 if ((argptr+2 >= argc) || ( argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1810 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1738 1811 ExitFlag = 255; 1739 1812 cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl; … … 1750 1823 case 'T': 1751 1824 if (ExitFlag == 0) ExitFlag = 1; 1752 if ((argptr+2 >= argc) || ( argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1825 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1753 1826 ExitFlag = 255; 1754 1827 cerr << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl; … … 1765 1838 case 's': 1766 1839 if (ExitFlag == 0) ExitFlag = 1; 1767 if ((argptr >= argc) || ( argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) ) {1840 if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1768 1841 ExitFlag = 255; 1769 cerr << "Not enough or invalid arguments given for scaling: -s <factor /[factor_x]> [factor_y] [factor_z]" << endl;1842 cerr << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl; 1770 1843 } else { 1771 1844 SaveFlag = true; … … 1774 1847 factor = new double[NDIM]; 1775 1848 factor[0] = atof(argv[argptr]); 1776 if ((argptr < argc) && (IsValidNumber(argv[argptr]))) 1777 argptr++; 1778 factor[1] = atof(argv[argptr]); 1779 if ((argptr < argc) && (IsValidNumber(argv[argptr]))) 1780 argptr++; 1781 factor[2] = atof(argv[argptr]); 1782 mol->Scale(&factor); 1849 factor[1] = atof(argv[argptr+1]); 1850 factor[2] = atof(argv[argptr+2]); 1851 mol->Scale((const double ** const)&factor); 1783 1852 for (int i=0;i<NDIM;i++) { 1784 1853 j += i+1; … … 1787 1856 } 1788 1857 delete[](factor); 1789 argptr+= 1;1858 argptr+=3; 1790 1859 } 1791 1860 break; … … 1879 1948 cout << Verbose(0) << "Creating connection matrix..." << endl; 1880 1949 start = clock(); 1881 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]), configuration.GetIsAngstroem() );1950 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 1882 1951 cout << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl; 1883 1952 if (mol->first->next != mol->last) { … … 1909 1978 cerr << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl; 1910 1979 } else { 1980 class Tesselation *TesselStruct = NULL; 1981 const LinkedCell *LCList = NULL; 1911 1982 cout << Verbose(0) << "Evaluating volume of the convex envelope."; 1912 1983 cout << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl; 1913 1984 cout << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl; 1914 L inkedCell LCList(mol, 10.);1915 //FindConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]);1916 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, 5., argv[argptr+1]);1917 // RemoveAllBoundaryPoints((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);1918 double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);1919 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, mol->TesselStruct, &configuration);1985 LCList = new LinkedCell(mol, 10.); 1986 //FindConvexBorder((ofstream *)&cout, mol, LCList, argv[argptr]); 1987 FindNonConvexBorder((ofstream *)&cout, mol, TesselStruct, LCList, 5., argv[argptr+1]); 1988 // RemoveAllBoundaryPoints((ofstream *)&cout, TesselStruct, mol, argv[argptr]); 1989 double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, TesselStruct, mol, argv[argptr]); 1990 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, &configuration); 1920 1991 cout << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl; 1921 1992 cout << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl; 1993 delete(TesselStruct); 1994 delete(LCList); 1922 1995 argptr+=2; 1923 1996 } … … 2043 2116 MoleculeListClass *molecules = new MoleculeListClass; // list of all molecules 2044 2117 molecule *mol = NULL; 2045 config configuration;2118 config *configuration = new config; 2046 2119 char choice; // menu choice char 2047 2120 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 2053 2126 2054 2127 // =========================== PARSE COMMAND LINE OPTIONS ==================================== 2055 j = ParseCommandLineOptions(argc, argv, molecules, periode, configuration, ConfigFileName);2128 j = ParseCommandLineOptions(argc, argv, molecules, periode, *configuration, ConfigFileName); 2056 2129 switch(j) { 2057 2130 case 255: // something went wrong 2131 case 2: // just for -f option 2132 case 1: // just for -v and -h options 2058 2133 delete(molecules); // also free's all molecules contained 2059 2134 delete(periode); 2135 delete(configuration); 2060 2136 cout << Verbose(0) << "Maximum of allocated memory: " 2061 2137 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2062 2138 cout << Verbose(0) << "Remaining non-freed memory: " 2063 2139 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2064 return j; 2065 break; 2066 case 1: // just for -v and -h options 2067 delete(molecules); // also free's all molecules contained 2068 delete(periode); 2069 cout << Verbose(0) << "Maximum of allocated memory: " 2070 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2071 cout << Verbose(0) << "Remaining non-freed memory: " 2072 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2073 return 0; 2074 break; 2075 case 2: // just for -f option 2076 delete(molecules); // also free's all molecules contained 2077 delete(periode); 2078 cout << Verbose(0) << "Maximum of allocated memory: " 2079 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2080 cout << Verbose(0) << "Remaining non-freed memory: " 2081 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2082 return 2; 2083 break; 2140 MemoryUsageObserver::getInstance()->purgeInstance(); 2141 return (j == 1 ? 0 : j); 2084 2142 default: 2085 2143 break; … … 2096 2154 } 2097 2155 } 2156 mol->ActiveFlag = true; 2098 2157 molecules->insert(mol); 2099 2158 } … … 2135 2194 2136 2195 case 'c': // edit each field of the configuration 2137 configuration .Edit();2196 configuration->Edit(); 2138 2197 break; 2139 2198 … … 2143 2202 2144 2203 case 'g': // manipulate molecules 2145 ManipulateMolecules(periode, molecules, &configuration);2204 ManipulateMolecules(periode, molecules, configuration); 2146 2205 break; 2147 2206 … … 2151 2210 2152 2211 case 'm': // manipulate atoms 2153 ManipulateAtoms(periode, molecules, &configuration);2212 ManipulateAtoms(periode, molecules, configuration); 2154 2213 break; 2155 2214 … … 2158 2217 2159 2218 case 's': // save to config file 2160 SaveConfig(ConfigFileName, &configuration, periode, molecules);2219 SaveConfig(ConfigFileName, configuration, periode, molecules); 2161 2220 break; 2162 2221 … … 2171 2230 2172 2231 // save element data base 2173 if (periode->StorePeriodentafel(configuration .databasepath)) //ElementsFileName2232 if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName 2174 2233 cout << Verbose(0) << "Saving of elements.db successful." << endl; 2175 2234 else … … 2178 2237 delete(molecules); // also free's all molecules contained 2179 2238 delete(periode); 2239 delete(configuration); 2180 2240 2181 2241 cout << Verbose(0) << "Maximum of allocated memory: " … … 2183 2243 cout << Verbose(0) << "Remaining non-freed memory: " 2184 2244 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2245 MemoryUsageObserver::purgeInstance(); 2185 2246 2186 2247 return (0); -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.