Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    • Property mode changed from 100644 to 100755
    rf66195 r7ea9e6  
    5050using namespace std;
    5151
     52#include "analysis_correlation.hpp"
    5253#include "atom.hpp"
    5354#include "bond.hpp"
     55#include "bondgraph.hpp"
    5456#include "boundary.hpp"
    5557#include "config.hpp"
     
    253255        } while ((j != -1) && (i<128));
    254256        if (i >= 2) {
    255           first->x.LSQdistance(atoms, i);
     257          first->x.LSQdistance((const Vector **)atoms, i);
    256258
    257259          first->x.Output((ofstream *)&cout);
     
    591593      {
    592594        cout << Verbose(0) << "Evaluating volume of the convex envelope.";
    593         LinkedCell LCList(mol, 10.);
    594595        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);
    596599        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);
    598602        delete(TesselStruct);
    599603      }
     
    719723       cin >> factor[2];
    720724       valid = true;
    721        mol->Scale(&factor);
     725       mol->Scale((const double ** const)&factor);
    722726       delete[](factor);
    723727      }
     
    837841          }
    838842          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);
    840844          // free memory
    841845          delete[](Elements);
     
    893897          cin >> bonddistance;
    894898          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);
    897900          end = clock();
    898901          cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     
    12471250  // translate each to its center and merge all molecules in MoleculeListClass into this molecule
    12481251  int N = molecules->ListOfMolecules.size();
    1249   int *src = new int(N);
     1252  int *src = new int[N];
    12501253  N=0;
    12511254  for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) {
     
    12541257  }
    12551258  molecules->SimpleMultiAdd(mol, src, N);
    1256   delete(src);
     1259  delete[](src);
    12571260
    12581261  // ... and translate back
     
    13541357  int argptr;
    13551358  molecule *mol = NULL;
     1359  string BondGraphFileName("");
    13561360  strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
    13571361
     
    13751379            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;
    13761380            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;
    13771382            cout << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;
    13781383            cout << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;
     
    13801385            cout << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    13811386            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;
    13821388            cout << "\t-h/-H/-?\tGive this help screen." << endl;
    13831389            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;
     
    14161422            }
    14171423            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;
    14181433          case 'n':
    14191434            cout << "I won't parse trajectories." << endl;
     
    14281443    } while (argptr < argc);
    14291444
    1430     // 2. Parse the element database
     1445    // 3a. Parse the element database
    14311446    if (periode->LoadPeriodentafel(configuration.databasepath)) {
    14321447      cout << Verbose(0) << "Element list loaded successfully." << endl;
     
    14361451      return 1;
    14371452    }
    1438     // 3. Find config file name and parse if possible
     1453    // 3b. Find config file name and parse if possible, also BondGraphFileName
    14391454    if (argv[1][0] != '-') {
    14401455      // 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 
    14451456      cout << Verbose(0) << "Config file given." << endl;
    14461457      test.open(argv[1], ios::in);
     
    14611472        ConfigFileName = argv[1];
    14621473        cout << Verbose(1) << "Specified config file found, parsing ... ";
    1463         switch (configuration.TestSyntax(ConfigFileName, periode, mol)) {
     1474        switch (configuration.TestSyntax(ConfigFileName, periode)) {
    14641475          case 1:
    14651476            cout << "new syntax." << endl;
    1466             configuration.Load(ConfigFileName, periode, mol);
     1477            configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules);
    14671478            configPresent = present;
    14681479            break;
    14691480          case 0:
    14701481            cout << "old syntax." << endl;
    1471             configuration.LoadOld(ConfigFileName, periode, mol);
     1482            configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules);
    14721483            configPresent = present;
    14731484            break;
     
    14791490    } else
    14801491      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
    14811506    // 4. parse again through options, now for those depending on elements db and config presence
    14821507    argptr = 1;
     
    15051530            case 'a':
    15061531              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]))) {
    15081533                ExitFlag = 255;
    15091534                cerr << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl;
     
    15491574                int *MinimumRingSize = new int[mol->AtomCount];
    15501575                atom ***ListOfLocalAtoms = NULL;
    1551                 int FragmentCounter = 0;
    15521576                class StackClass<bond *> *BackEdgeStack = NULL;
    15531577                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);
    15561579                Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack);
    15571580                if (Subgraphs != NULL) {
    1558                   Subgraphs->next->FillBondStructureFromReference((ofstream *)&cout, mol, (FragmentCounter = 0), ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
     1581                  int FragmentCounter = 0;
    15591582                  while (Subgraphs->next != NULL) {
    15601583                    Subgraphs = Subgraphs->next;
     1584                    Subgraphs->FillBondStructureFromReference((ofstream *)&cout, mol, FragmentCounter, ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
    15611585                    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);
    15641588                    delete(LocalBackEdgeStack);
    15651589                    delete(Subgraphs->previous);
     1590                    FragmentCounter++;
    15661591                  }
    15671592                  delete(Subgraphs);
    15681593                  for (int i=0;i<FragmentCounter;i++)
    1569                     Free(&ListOfLocalAtoms[FragmentCounter]);
     1594                    Free(&ListOfLocalAtoms[i]);
    15701595                  Free(&ListOfLocalAtoms);
    15711596                }
     
    15741599              }
    15751600              //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              }
    15761647              break;
    15771648            case 'E':
     
    16341705                cout << "Parsing bonds from " << argv[argptr] << "." << endl;
    16351706                ifstream *input = new ifstream(argv[argptr]);
    1636                 mol->CreateAdjacencyList2((ofstream *)&cout, input);
     1707                mol->CreateAdjacencyListFromDbondFile((ofstream *)&cout, input);
    16371708                input->close();
    16381709                argptr+=1;
     
    16451716                cerr << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl;
    16461717              } else {
    1647                 class Tesselation T;
     1718                class Tesselation *T = NULL;
     1719                const LinkedCell *LCList = NULL;
    16481720                string filename(argv[argptr+1]);
    16491721                filename.append(".csv");
     
    16511723                cout << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl;
    16521724                start = clock();
    1653                 LinkedCell 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());
    16561728                end = clock();
    16571729                cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
     1730                delete(LCList);
    16581731                argptr+=2;
    16591732              }
     
    17351808            case 't':
    17361809              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])) ) {
    17381811                ExitFlag = 255;
    17391812                cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;
     
    17501823            case 'T':
    17511824              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])) ) {
    17531826                ExitFlag = 255;
    17541827                cerr << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;
     
    17651838            case 's':
    17661839              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])) ) {
    17681841                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;
    17701843              } else {
    17711844                SaveFlag = true;
     
    17741847                factor = new double[NDIM];
    17751848                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);
    17831852                for (int i=0;i<NDIM;i++) {
    17841853                  j += i+1;
     
    17871856                }
    17881857                delete[](factor);
    1789                 argptr+=1;
     1858                argptr+=3;
    17901859              }
    17911860              break;
     
    18791948                cout << Verbose(0) << "Creating connection matrix..." << endl;
    18801949                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);
    18821951                cout << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;
    18831952                if (mol->first->next != mol->last) {
     
    19091978                cerr << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl;
    19101979              } else {
     1980                class Tesselation *TesselStruct = NULL;
     1981                const LinkedCell *LCList = NULL;
    19111982                cout << Verbose(0) << "Evaluating volume of the convex envelope.";
    19121983                cout << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl;
    19131984                cout << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl;
    1914                 LinkedCell 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);
    19201991                cout << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    19211992                cout << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     1993                delete(TesselStruct);
     1994                delete(LCList);
    19221995                argptr+=2;
    19231996              }
     
    20432116  MoleculeListClass *molecules = new MoleculeListClass;  // list of all molecules
    20442117  molecule *mol = NULL;
    2045   config configuration;
     2118  config *configuration = new config;
    20462119  char choice;  // menu choice char
    20472120  Vector x,y,z,n;  // coordinates for absolute point in cell volume
     
    20532126
    20542127  // =========================== PARSE COMMAND LINE OPTIONS ====================================
    2055   j = ParseCommandLineOptions(argc, argv, molecules, periode, configuration, ConfigFileName);
     2128  j = ParseCommandLineOptions(argc, argv, molecules, periode, *configuration, ConfigFileName);
    20562129  switch(j) {
    20572130    case 255:  // something went wrong
     2131    case 2:  // just for -f option
     2132    case 1:  // just for -v and -h options
    20582133      delete(molecules); // also free's all molecules contained
    20592134      delete(periode);
     2135      delete(configuration);
    20602136      cout << Verbose(0) <<  "Maximum of allocated memory: "
    20612137        << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
    20622138      cout << Verbose(0) <<  "Remaining non-freed memory: "
    20632139        << 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);
    20842142    default:
    20852143      break;
     
    20962154      }
    20972155    }
     2156    mol->ActiveFlag = true;
    20982157    molecules->insert(mol);
    20992158  }
     
    21352194
    21362195      case 'c': // edit each field of the configuration
    2137        configuration.Edit();
     2196       configuration->Edit();
    21382197       break;
    21392198
     
    21432202
    21442203      case 'g': // manipulate molecules
    2145         ManipulateMolecules(periode, molecules, &configuration);
     2204        ManipulateMolecules(periode, molecules, configuration);
    21462205        break;
    21472206
     
    21512210
    21522211      case 'm': // manipulate atoms
    2153         ManipulateAtoms(periode, molecules, &configuration);
     2212        ManipulateAtoms(periode, molecules, configuration);
    21542213        break;
    21552214
     
    21582217
    21592218      case 's': // save to config file
    2160         SaveConfig(ConfigFileName, &configuration, periode, molecules);
     2219        SaveConfig(ConfigFileName, configuration, periode, molecules);
    21612220        break;
    21622221
     
    21712230
    21722231  // save element data base
    2173   if (periode->StorePeriodentafel(configuration.databasepath)) //ElementsFileName
     2232  if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName
    21742233    cout << Verbose(0) << "Saving of elements.db successful." << endl;
    21752234  else
     
    21782237  delete(molecules); // also free's all molecules contained
    21792238  delete(periode);
     2239  delete(configuration);
    21802240
    21812241  cout << Verbose(0) <<  "Maximum of allocated memory: "
     
    21832243  cout << Verbose(0) <<  "Remaining non-freed memory: "
    21842244    << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
     2245  MemoryUsageObserver::purgeInstance();
    21852246
    21862247  return (0);
Note: See TracChangeset for help on using the changeset viewer.