Changeset b1d8092 for src/builder.cpp


Ignore:
Timestamp:
Feb 17, 2010, 11:15:27 AM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
326a43b
Parents:
7ba324 (diff), 354859 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'StructureRefactoring' into QT4Refactoring

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/unittests/Makefile.am

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    r7ba324 rb1d8092  
    7676#include "Actions/MethodAction.hpp"
    7777#include "Actions/small_actions.hpp"
     78#include "World.hpp"
    7879#include "version.h"
    7980
     
    21662167/********************************************** Main routine **************************************/
    21672168
     2169void cleanUp(config *configuration){
     2170  World::destroy();
     2171  delete(configuration);
     2172  Log() << Verbose(0) <<  "Maximum of allocated memory: "
     2173    << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
     2174  Log() << Verbose(0) <<  "Remaining non-freed memory: "
     2175    << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
     2176  MemoryUsageObserver::purgeInstance();
     2177  logger::purgeInstance();
     2178  errorLogger::purgeInstance();
     2179  UIFactory::purgeInstance();
     2180  ActionRegistry::purgeRegistry();
     2181}
     2182
    21682183int main(int argc, char **argv)
    21692184{
    2170   periodentafel *periode = new periodentafel;
    2171     MoleculeListClass *molecules = new MoleculeListClass;
    21722185    molecule *mol = NULL;
    21732186    config *configuration = new config;
     
    21802193    setVerbosity(0);
    21812194    /* structure of ParseCommandLineOptions will be refactored later */
    2182     j = ParseCommandLineOptions(argc, argv, molecules, periode, *configuration, ConfigFileName);
     2195    j = ParseCommandLineOptions(argc, argv,  World::get()->getMolecules(), World::get()->getPeriode(), *configuration, ConfigFileName);
    21832196    switch (j){
    21842197        case 255:
    21852198        case 2:
    21862199        case 1:
    2187             delete (molecules);
    2188             delete (periode);
    2189             delete (configuration);
    2190             Log() << Verbose(0) << "Maximum of allocated memory: " << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
    2191             Log() << Verbose(0) << "Remaining non-freed memory: " << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
    2192             MemoryUsageObserver::getInstance()->purgeInstance();
    2193             logger::purgeInstance();
    2194             errorLogger::purgeInstance();
     2200            cleanUp(configuration);
    21952201            return (j == 1 ? 0 : j);
    21962202        default:
    21972203            break;
    21982204    }
    2199     if(molecules->ListOfMolecules.size() == 0){
    2200         mol = new molecule(periode);
     2205    if(World::get()->numMolecules() == 0){
     2206        mol = World::get()->createMolecule();
    22012207        if(mol->cell_size[0] == 0.){
    22022208            Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
     
    22062212            }
    22072213        }
    2208 
    22092214        mol->ActiveFlag = true;
    2210         molecules->insert(mol);
    22112215    }
    22122216
     
    22242228      UIFactory::makeUserInterface(UIFactory::Text);
    22252229#endif
    2226       MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters,molecules, configuration, periode, ConfigFileName);
     2230      MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters,World::get()->getMolecules(), configuration, World::get()->getPeriode(), ConfigFileName);
    22272231      mainWindow->display();
    22282232
     
    22302234    }
    22312235
    2232     if(periode->StorePeriodentafel(configuration->databasepath))
     2236    if(World::get()->getPeriode()->StorePeriodentafel(configuration->databasepath))
    22332237        Log() << Verbose(0) << "Saving of elements.db successful." << endl;
    22342238
     
    22362240        Log() << Verbose(0) << "Saving of elements.db failed." << endl;
    22372241
    2238     delete (molecules);
    2239     delete(periode);
    2240   delete(configuration);
    2241 
    2242 
    2243 
    2244   Log() << Verbose(0) <<  "Maximum of allocated memory: "
    2245     << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
    2246   Log() << Verbose(0) <<  "Remaining non-freed memory: "
    2247     << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
    2248   MemoryUsageObserver::purgeInstance();
    2249   logger::purgeInstance();
    2250   errorLogger::purgeInstance();
    2251   UIFactory::purgeInstance();
    2252   ActionRegistry::purgeRegistry();
     2242  cleanUp(configuration);
    22532243  return (0);
    22542244}
Note: See TracChangeset for help on using the changeset viewer.