Changes in / [a7b761b:1024cb]


Ignore:
Files:
213 added
35 deleted
75 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    ra7b761b r1024cb  
    2828# Boost libraries
    2929AX_BOOST_BASE([1.33.1])
    30 #AX_BOOST_PROGRAM_OPTIONS
     30AX_BOOST_PROGRAM_OPTIONS
    3131#AX_BOOST_FOREACH
    3232#AX_BOOST_FILESYSTEM
     
    9393
    9494# test suite
    95 AC_CONFIG_TESTDIR(tests)
    96 AC_CONFIG_FILES([tests/atlocal tests/Makefile])
    97 AC_CONFIG_FILES([tests/Tesselations/Makefile tests/Tesselations/defs])
    98 AC_CONFIG_FILES([tests/molecuilder], [chmod +x tests/molecuilder])
    99 AC_CONFIG_FILES([doc/molecuilder.xml])
    100 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile src/unittests/Makefile])
     95AC_CONFIG_TESTDIR(tests/regression)
     96AC_CONFIG_FILES([
     97        tests/Makefile
     98        tests/regression/atlocal
     99        tests/regression/Makefile])
     100AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
     101AC_CONFIG_FILES([
     102        tests/Tesselations/Makefile
     103        tests/Tesselations/defs])
     104AC_CONFIG_FILES([
     105        doc/molecuilder.xml])
     106AC_CONFIG_FILES([
     107        Makefile
     108        doc/Makefile
     109        src/Makefile
     110        src/Actions/Makefile
     111        src/UIElements/Makefile
     112        src/unittests/Makefile])
    101113AC_OUTPUT
  • src/Actions/ActionRegistry.cpp

    ra7b761b r1024cb  
    4343}
    4444
     45void ActionRegistry::unregisterAction(Action* action){
     46  actionMap.erase(action->getName());
     47}
     48
     49std::map<const std::string,Action*>::iterator ActionRegistry::getBeginIter()
     50{
     51  return actionMap.begin();
     52}
     53
     54std::map<const std::string,Action*>::iterator ActionRegistry::getEndIter()
     55{
     56  return actionMap.end();
     57}
     58
    4559CONSTRUCT_SINGLETON(ActionRegistry)
  • src/Actions/ActionRegistry.hpp

    ra7b761b r1024cb  
    2222  Action* getActionByName(const std::string);
    2323  void registerAction(Action*);
     24  void unregisterAction(Action*);
     25
     26  std::map<const std::string,Action*>::iterator getBeginIter();
     27  std::map<const std::string,Action*>::iterator getEndIter();
    2428
    2529private:
  • src/Legacy/oldmenu.cpp

    ra7b761b r1024cb  
    3535#include "Menu/DisplayMenuItem.hpp"
    3636#include "Menu/SubMenuItem.hpp"
     37#include "Actions/MapOfActions.hpp"
    3738#include "Actions/MethodAction.hpp"
    3839#include "Actions/ErrorAction.hpp"
     
    900901  molecule *srcmol = NULL, *destmol = NULL;
    901902  Dialog *dialog = UIFactory::getInstance().makeDialog();
    902   dialog->queryMolecule("Enter index of destination molecule: ",&destmol, molecules);
    903   dialog->queryMolecule("Enter index of source molecule to add from: ",&srcmol, molecules);
     903  dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
     904  dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    904905  if(dialog->display()) {
    905906    molecules->SimpleAdd(srcmol, destmol);
     
    914915  molecule *srcmol = NULL, *destmol = NULL;
    915916  Dialog *dialog = UIFactory::getInstance().makeDialog();
    916   dialog->queryMolecule("Enter index of matrix molecule (the variable one): ",&srcmol,molecules);
    917   dialog->queryMolecule("Enter index of molecule to merge into (the fixed one): ",&destmol,molecules);
     917  dialog->queryMolecule("molecule-by-id",&destmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
     918  dialog->queryMolecule("molecule-by-id",&srcmol, MapOfActions::getInstance().getDescription("molecule-by-id"));
    918919  if(dialog->display()) {
    919920    molecules->EmbedMerge(destmol, srcmol);
  • src/Makefile.am

    ra7b761b r1024cb  
     1# PLEASE adhere to the alphabetical ordering in this Makefile!
     2# Also indentation by a single tab
     3
     4SUBDIRS = Actions UIElements
     5
    16# this includes source files that need to be present at multiple points
    2 HELPERSOURCE =  Helpers/Assert.cpp \
    3                                 Helpers/MemDebug.cpp
     7HELPERSOURCE =  \
     8  Helpers/Assert.cpp \
     9  Helpers/MemDebug.cpp
    410                       
    5 ATOMSOURCE = atom.cpp atom_atominfo.cpp atom_bondedparticle.cpp atom_bondedparticleinfo.cpp atom_graphnode.cpp atom_graphnodeinfo.cpp atom_particleinfo.cpp atom_trajectoryparticle.cpp atom_trajectoryparticleinfo.cpp
    6 ATOMHEADER = atom.hpp atom_atominfo.hpp atom_bondedparticle.hpp atom_bondedparticleinfo.hpp atom_graphnode.hpp atom_graphnodeinfo.hpp atom_particleinfo.hpp atom_trajectoryparticle.hpp atom_trajectoryparticleinfo.hpp
    7 
    8 LINALGSOURCE = ${HELPERSOURCE} \
    9                gslmatrix.cpp \
    10                            gslvector.cpp \
    11                            linearsystemofequations.cpp \
    12                            Space.cpp \
    13                            vector.cpp
     11ATOMSOURCE = \
     12  atom.cpp \
     13  atom_atominfo.cpp \
     14  atom_bondedparticle.cpp \
     15  atom_bondedparticleinfo.cpp \
     16  atom_graphnode.cpp \
     17  atom_graphnodeinfo.cpp \
     18  atom_particleinfo.cpp \
     19  atom_trajectoryparticle.cpp \
     20  atom_trajectoryparticleinfo.cpp
     21ATOMHEADER = \
     22  atom.hpp \
     23  atom_atominfo.hpp \
     24  atom_bondedparticle.hpp \
     25  atom_bondedparticleinfo.hpp \
     26  atom_graphnode.hpp \
     27  atom_graphnodeinfo.hpp \
     28  atom_particleinfo.hpp \
     29  atom_trajectoryparticle.hpp \
     30  atom_trajectoryparticleinfo.hpp
     31
     32LINALGSOURCE = \
     33  ${HELPERSOURCE} \
     34  gslmatrix.cpp \
     35  gslvector.cpp \
     36  linearsystemofequations.cpp \
     37  Space.cpp \
     38  vector.cpp
    1439                           
    1540LINALGHEADER = gslmatrix.hpp \
    16                            gslvector.hpp \
    17                            linearsystemofequations.hpp \
    18                            Space.hpp \
    19                            vector.hpp
     41  gslvector.hpp \
     42  linearsystemofequations.hpp \
     43  Space.hpp \
     44  vector.hpp
    2045                           
    21 
    22 ANALYSISSOURCE = analysis_bonds.cpp analysis_correlation.cpp
    23 ANALYSISHEADER = analysis_bonds.hpp analysis_correlation.hpp
    24 
    25 ACTIONSSOURCE = Actions/Action.cpp \
    26                                 Actions/ActionHistory.cpp \
    27                                 Actions/ActionRegistry.cpp \
    28                                 Actions/ActionSequence.cpp \
    29                                 Actions/ErrorAction.cpp \
    30                                 Actions/MakroAction.cpp \
    31                                 Actions/ManipulateAtomsProcess.cpp \
    32                                 Actions/MethodAction.cpp \
    33                 Actions/Process.cpp \
    34                 Actions/small_actions.cpp
    35                
    36                  
    37 ACTIONSHEADER = Actions/Action.hpp \
    38                                 Actions/ActionHistory.hpp \
    39                                 Actions/ActionRegistry.hpp \
    40                                 Actions/ActionSequence.hpp \
    41                             Actions/Calculation.hpp \
    42                             Actions/Calculation_impl.hpp \
    43                             Actions/ErrorAction.hpp \
    44                             Actions/MakroAction.hpp \
    45                             Actions/ManipulateAtomsProcess.hpp \
    46                             Actions/MethodAction.hpp \
    47                             Actions/Process.hpp \
    48                             Actions/small_actions.hpp
    49                            
    50                            
    51 
    52 PATTERNSOURCE = Patterns/Observer.cpp
    53 PATTERNHEADER = Patterns/Cacheable.hpp \
    54                                 Patterns/Observer.hpp \
    55                 Patterns/Singleton.hpp
    56 
    57 VIEWSOURCE = Views/View.cpp Views/StringView.cpp Views/MethodStringView.cpp Views/StreamStringView.cpp
    58 VIEWHEADER = Views/View.hpp Views/StringView.hpp Views/MethodStringView.hpp Views/StreamStringView.hpp
    59 
    60 MENUSOURCE = Menu/Menu.cpp Menu/TextMenu.cpp Menu/MenuItem.cpp Menu/SubMenuItem.cpp Menu/ActionMenuItem.cpp Menu/SeperatorItem.cpp Menu/DisplayMenuItem.cpp
    61 MENUHEADER = Menu/Menu.hpp Menu/TextMenu.hpp Menu/MenuItem.hpp Menu/SubMenuItem.hpp Menu/ActionMenuItem.hpp Menu/SeperatorItem.hpp Menu/DisplayMenuItem.hpp
    62 
    63 UISOURCE = ${ACTIONSSOURCE} ${VIEWSOURCE} ${MENUSOURCE} UIElements/UIFactory.cpp UIElements/TextUIFactory.cpp UIElements/MainWindow.cpp UIElements/TextWindow.cpp UIElements/TextStatusIndicator.cpp UIElements/Dialog.cpp UIElements/TextDialog.cpp
    64 UIHEADER = ${ACTIONSHEADER} ${VIEWHEADER} ${MENUHEADER} UIElements/UIFactory.hpp UIElements/TextUIFactory.hpp UIElements/MainWindow.hpp UIElements/TextWindow.hpp UIElements/TextStatusIndicator.hpp UIElements/Dialog.hpp UIElements/TextDialog.hpp
     46ANALYSISSOURCE = \
     47  analysis_bonds.cpp \
     48  analysis_correlation.cpp
     49ANALYSISHEADER = \
     50  analysis_bonds.hpp \
     51  analysis_correlation.hpp
     52
     53ACTIONSSOURCE = \
     54  Actions/Action.cpp \
     55  Actions/ActionHistory.cpp \
     56  Actions/ActionRegistry.cpp \
     57  Actions/ActionSequence.cpp \
     58  Actions/ErrorAction.cpp \
     59  Actions/MakroAction.cpp \
     60  Actions/ManipulateAtomsProcess.cpp \
     61  Actions/MethodAction.cpp \
     62  Actions/Process.cpp
     63
     64ACTIONSHEADER = \
     65  ${ANALYSISACTIONHEADER} \
     66  ${ATOMACTIONHEADER} \
     67  ${CMDACTIONHEADER} \
     68  ${FRAGMENTATIONACTIONHEADER} \
     69  ${MOLECULEACTIONHEADER} \
     70  ${PARSERACTIONHEADER} \
     71  ${TESSELATIONACTIONHEADER} \
     72  ${WORLDACTIONHEADER} \
     73  Actions/Action.hpp \
     74  Actions/ActionHistory.hpp \
     75  Actions/ActionRegistry.hpp \
     76  Actions/ActionSequence.hpp \
     77  Actions/Calculation.hpp \
     78  Actions/Calculation_impl.hpp \
     79  Actions/ErrorAction.hpp \
     80  Actions/MakroAction.hpp \
     81  Actions/ManipulateAtomsProcess.hpp \
     82  Actions/MapOfActions.hpp \
     83  Actions/MethodAction.hpp \
     84  Actions/Process.hpp
     85 
     86
     87PARSERSOURCE = \
     88  Parser/ChangeTracker.cpp \
     89  Parser/FormatParser.cpp \
     90  Parser/TremoloParser.cpp \
     91  Parser/XyzParser.cpp
     92PARSERHEADER = \
     93  Parser/ChangeTracker.hpp \
     94  Parser/FormatParser.hpp \
     95  Parser/TremoloParser.hpp \
     96  Parser/XyzParser.hpp
     97
     98PATTERNSOURCE = \
     99  Patterns/Observer.cpp
     100PATTERNHEADER = \
     101  Patterns/Cacheable.hpp \
     102  Patterns/Observer.hpp \
     103  Patterns/Singleton.hpp
    65104
    66105# all these files are only used for legacy reasons while the transition is in progress
     
    71110
    72111DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \
    73                                    Descriptors/AtomIdDescriptor.cpp \
    74                                    Descriptors/AtomTypeDescriptor.cpp \
    75                                    Descriptors/MoleculeDescriptor.cpp \
    76                                    Descriptors/MoleculeIdDescriptor.cpp
     112  Descriptors/AtomIdDescriptor.cpp \
     113  Descriptors/AtomTypeDescriptor.cpp \
     114  Descriptors/MoleculeDescriptor.cpp \
     115  Descriptors/MoleculeIdDescriptor.cpp
    77116                                   
    78117
    79118DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \
    80                                    Descriptors/AtomIdDescriptor.hpp \
    81                                    Descriptors/AtomTypeDescriptor.hpp \
    82                                    Descriptors/MoleculeDescriptor.hpp \
    83                                    Descriptors/MoleculeIdDescriptor.hpp
     119  Descriptors/AtomIdDescriptor.hpp \
     120  Descriptors/AtomTypeDescriptor.hpp \
     121  Descriptors/MoleculeDescriptor.hpp \
     122  Descriptors/MoleculeIdDescriptor.hpp
    84123                                   
    85 
    86 
    87124EXCEPTIONSOURCE = Exceptions/CustomException.cpp \
    88                                   Exceptions/LinearDependenceException.cpp \
    89                                   Exceptions/MathException.cpp \
    90                                   Exceptions/ZeroVectorException.cpp
     125  Exceptions/LinearDependenceException.cpp \
     126  Exceptions/MathException.cpp \
     127  Exceptions/ZeroVectorException.cpp
    91128                                 
    92129EXCEPTIONHEADER = Exceptions/CustomException.hpp \
    93                                   Exceptions/LinearDependenceException.hpp \
    94                                   Exceptions/MathException.hpp \
    95                                   Exceptions/ZeroVectorException.hpp
    96 
    97 
    98 SOURCE = ${ANALYSISSOURCE} \
    99                  ${ATOMSOURCE} \
    100                  ${PATTERNSOURCE} \
    101                  ${UISOURCE} \
    102                  ${DESCRIPTORSOURCE} \
    103                  ${HELPERSOURCE} \
    104                  ${LEGACYSOURCE} \
    105                  ${EXCEPTIONSOURCE} \
    106                  bond.cpp \
    107                  bondgraph.cpp \
    108                  boundary.cpp \
    109                  config.cpp \
    110                  element.cpp \
    111                  ellipsoid.cpp \
    112                  errorlogger.cpp \
    113                  graph.cpp \
    114                  helpers.cpp \
    115                  Helpers/Assert.cpp \
    116                  info.cpp \
    117                  leastsquaremin.cpp \
    118                  Line.cpp \
    119                  linkedcell.cpp \
    120                  log.cpp \
    121                  logger.cpp \
    122                  memoryusageobserver.cpp \
    123                  moleculelist.cpp \
    124                  molecule.cpp \
    125                  molecule_dynamics.cpp \
    126                  molecule_fragmentation.cpp \
    127                  molecule_geometry.cpp \
    128                  molecule_graph.cpp \
    129                  molecule_pointcloud.cpp \
    130                  parser.cpp \
    131                  periodentafel.cpp \
    132                  Plane.cpp \
    133                  tesselation.cpp \
    134                  tesselationhelpers.cpp \
    135                  triangleintersectionlist.cpp \
    136                  vector.cpp \
    137                  verbose.cpp \
    138                  vector_ops.cpp \
    139                  World.cpp
     130  Exceptions/LinearDependenceException.hpp \
     131  Exceptions/MathException.hpp \
     132  Exceptions/ZeroVectorException.hpp
     133
     134SOURCE = \
     135  ${ANALYSISSOURCE} \
     136  ${ACTIONSSOURCE} \
     137  ${ATOMSOURCE} \
     138  ${PATTERNSOURCE} \
     139  ${PARSERSOURCE} \
     140  ${DESCRIPTORSOURCE} \
     141  ${HELPERSOURCE} \
     142  ${LEGACYSOURCE} \
     143  ${EXCEPTIONSOURCE} \
     144  bond.cpp \
     145  bondgraph.cpp \
     146  boundary.cpp \
     147  CommandLineParser.cpp \
     148  config.cpp \
     149  element.cpp \
     150  elements_db.cpp \
     151  ellipsoid.cpp \
     152  errorlogger.cpp \
     153  graph.cpp \
     154  helpers.cpp \
     155  info.cpp \
     156  leastsquaremin.cpp \
     157  Line.cpp \
     158  linkedcell.cpp \
     159  log.cpp \
     160  logger.cpp \
     161  moleculelist.cpp \
     162  molecule.cpp \
     163  molecule_dynamics.cpp \
     164  molecule_fragmentation.cpp \
     165  molecule_geometry.cpp \
     166  molecule_graph.cpp \
     167  molecule_pointcloud.cpp \
     168  parser.cpp \
     169  periodentafel.cpp \
     170  Plane.cpp \
     171  Space.cpp \
     172  tesselation.cpp \
     173  tesselationhelpers.cpp \
     174  triangleintersectionlist.cpp \
     175  vector.cpp \
     176  vector_ops.cpp \
     177  verbose.cpp \
     178  World.cpp
    140179
    141180HEADER = \
    142           ${ANALYSISHEADER} \
    143           ${ATOMHEADER} \
    144           ${PATTERNHEADER} \
    145           ${UIHEADER} \
    146           ${DESCRIPTORHEADER} \
    147           ${EXCEPTIONHEADER} \
    148           ${LEGACYHEADER} \
    149           bond.hpp \
    150           bondgraph.hpp \
    151           boundary.hpp \
    152           config.hpp \
    153           defs.hpp \
    154           element.hpp \
    155           ellipsoid.hpp \
    156           errorlogger.hpp \
    157           graph.hpp \
    158           helpers.hpp \
    159           info.hpp \
    160           leastsquaremin.hpp \
    161           Line.hpp \
    162           linkedcell.hpp \
    163           lists.hpp \
    164           log.hpp \
    165           logger.hpp \
    166           memoryallocator.hpp \
    167           memoryusageobserver.hpp \
    168           molecule.hpp \
    169           molecule_template.hpp \
    170           parser.hpp \
    171           periodentafel.hpp \
    172           Plane.hpp \
    173           stackclass.hpp \
    174           tesselation.hpp \
    175           tesselationhelpers.hpp \
    176           triangleintersectionlist.hpp \
    177           verbose.hpp \
    178           vector_ops.hpp \
    179           World.hpp
     181  ${ANALYSISHEADER} \
     182  ${ACTIONSHEADER} \
     183  ${ATOMHEADER} \
     184  ${PARSERHEADER} \
     185  ${PATTERNHEADER} \
     186  ${DESCRIPTORHEADER} \
     187  ${EXCEPTIONHEADER} \
     188  ${LEGACYHEADER} \
     189  bond.hpp \
     190  bondgraph.hpp \
     191  boundary.hpp \
     192  CommandLineParser.hpp \
     193  config.hpp \
     194  defs.hpp \
     195  element.hpp \
     196  elements_db.hpp \
     197  ellipsoid.hpp \
     198  errorlogger.hpp \
     199  graph.hpp \
     200  helpers.hpp \
     201  info.hpp \
     202  leastsquaremin.hpp \
     203  Line.hpp \
     204  linkedcell.hpp \
     205  lists.hpp \
     206  log.hpp \
     207  logger.hpp \
     208  molecule.hpp \
     209  molecule_template.hpp \
     210  parser.hpp \
     211  periodentafel.hpp \
     212  Plane.hpp \
     213  stackclass.hpp \
     214  tesselation.hpp \
     215  tesselationhelpers.hpp \
     216  triangleintersectionlist.hpp \
     217  verbose.hpp \
     218  vector_ops.hpp \
     219  World.hpp
     220
     221# the following files are no longer used:
     222#  memoryallocator.hpp \
     223#  memoryallocator.cpp \
     224#  memoryusageobserver.hpp \
     225#  memoryusageobserver.cpp
    180226
    181227BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
    182 INCLUDES = -I$(top_srcdir)/src/unittests
     228INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements
    183229
    184230noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a
     
    187233libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
    188234libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
    189 molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
    190235molecuilder_LDFLAGS = $(BOOST_LDFLAGS)
    191236molecuilder_SOURCES = builder.cpp
    192 molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
     237molecuilder_LDADD =  UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    193238joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
    194239joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    195240analyzer_SOURCES = analyzer.cpp datacreator.cpp parser.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp
    196241analyzer_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    197 
    198 #EXTRA_DIST = ${molecuilder_DATA}
    199242
    200243FORCE:
  • src/UIElements/Dialog.cpp

    ra7b761b r1024cb  
    88#include <cassert>
    99
    10 #include "UIElements/Dialog.hpp"
    11 
     10#include "Dialog.hpp"
     11
     12#include "atom.hpp"
     13#include "element.hpp"
     14#include "molecule.hpp"
    1215#include "vector.hpp"
    1316
     
    5154
    5255// Base class
    53 Dialog::Query::Query(string _title) :
    54     title(_title)
     56Dialog::Query::Query(string _title, string _description) :
     57    title(_title),
     58    description(_description)
    5559{}
    5660
     
    6165}
    6266
     67const std::string Dialog::Query::getDescription() const{
     68  return description;
     69}
     70// empty Queries
     71
     72Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
     73    Query(title, description)
     74{}
     75
     76Dialog::EmptyQuery::~EmptyQuery() {}
     77
     78void Dialog::EmptyQuery::setResult() {
     79}
     80
    6381// Int Queries
    6482
    65 Dialog::IntQuery::IntQuery(string title,int *_target) :
    66     Query(title), target(_target)
     83Dialog::IntQuery::IntQuery(string title,int *_target, std::string description) :
     84    Query(title, description), target(_target)
    6785{}
    6886
     
    7391}
    7492
     93// Int Queries
     94
     95Dialog::BooleanQuery::BooleanQuery(string title,bool *_target, std::string description) :
     96    Query(title, description), target(_target)
     97{}
     98
     99Dialog::BooleanQuery::~BooleanQuery() {}
     100
     101void Dialog::BooleanQuery::setResult() {
     102  *target = tmp;
     103}
     104
    75105// String Queries
    76106
    77 Dialog::StringQuery::StringQuery(string title,string *_target) :
    78     Query(title), target(_target)
     107Dialog::StringQuery::StringQuery(string title,string *_target, std::string _description) :
     108    Query(title, _description), target(_target)
    79109{}
    80110
     
    87117// Double Queries
    88118
    89 Dialog::DoubleQuery::DoubleQuery(string title,double *_target) :
    90     Query(title), target(_target)
     119Dialog::DoubleQuery::DoubleQuery(string title,double *_target, std::string _description) :
     120    Query(title, _description), target(_target)
    91121{}
    92122
     
    98128
    99129
     130// Atom Queries
     131
     132Dialog::AtomQuery::AtomQuery(string title, atom **_target, std::string _description) :
     133    Query(title, _description),
     134    tmp(0),
     135    target(_target)
     136
     137{}
     138
     139Dialog::AtomQuery::~AtomQuery() {}
     140
     141void Dialog::AtomQuery::setResult() {
     142  *target = tmp;
     143}
     144
    100145// Molecule Queries
    101146
    102 Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, MoleculeListClass *_molecules) :
    103     Query(title),
     147Dialog::MoleculeQuery::MoleculeQuery(string title, molecule **_target, std::string _description) :
     148    Query(title, _description),
    104149    tmp(0),
    105     molecules(_molecules),
    106150    target(_target)
    107151
     
    116160// Vector Queries
    117161
    118 Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check) :
    119   Query(title),
     162Dialog::VectorQuery::VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description) :
     163  Query(title, _description),
    120164  cellSize(_cellSize),
    121165  check(_check),
    122166  target(_target)
    123167{
    124 tmp = new Vector();
     168  tmp = new Vector();
    125169}
    126170
     
    134178}
    135179
     180// Box Queries
     181
     182Dialog::BoxQuery::BoxQuery(std::string title, double ** const _cellSize, std::string _description) :
     183  Query(title, _description),
     184  target(_cellSize)
     185{
     186    tmp = new double[6];
     187}
     188
     189Dialog::BoxQuery::~BoxQuery()
     190{
     191  delete[] tmp;
     192}
     193
     194void Dialog::BoxQuery::setResult() {
     195  for (int i=0;i<6;i++) {
     196    (*target)[i] = tmp[i];
     197  }
     198}
     199
    136200// Element Queries
    137 Dialog::ElementQuery::ElementQuery(std::string title, const element **_target) :
    138   Query(title),
     201Dialog::ElementQuery::ElementQuery(std::string title, const element **_target, std::string _description) :
     202  Query(title, _description),
    139203  tmp(0),
    140204  target(_target)
  • src/UIElements/Dialog.hpp

    ra7b761b r1024cb  
    1212#include<list>
    1313
    14 class MoleculeListClass;
     14class atom;
     15class element;
    1516class molecule;
    1617class Vector;
    17 class element;
    1818
    1919class Dialog
     
    2323  virtual ~Dialog();
    2424
    25   virtual void queryInt(const char *, int *)=0;
    26   virtual void queryDouble(const char*,double *)=0;
    27   virtual void queryString(const char*, std::string *)=0;
    28   virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0;
    29   virtual void queryVector(const char*,Vector *,const double *const,bool)=0;
    30   virtual void queryElement(const char*,const element **)=0;
     25  virtual void queryEmpty(const char *, std::string = "")=0;
     26  virtual void queryBoolean(const char *, bool *, std::string = "")=0;
     27  virtual void queryInt(const char *, int *, std::string = "")=0;
     28  virtual void queryDouble(const char*,double *, std::string = "")=0;
     29  virtual void queryString(const char*, std::string *, std::string = "")=0;
     30  virtual void queryAtom(const char*,atom**,std::string = "")=0;
     31  virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
     32  virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
     33  virtual void queryBox(const char*,double ** const, std::string = "")=0;
     34  virtual void queryElement(const char*,const element **, std::string = "")=0;
    3135
    3236  virtual bool display();
     
    4650  class Query {
    4751  public:
    48     Query(std::string _title);
     52    Query(std::string _title, std::string _description = "");
    4953    virtual ~Query();
    5054    virtual bool handle()=0;
     
    5256  protected:
    5357    const std::string getTitle() const;
     58    const std::string getDescription() const;
    5459  private:
    55     std::string title;
     60    std::string title;  //!< short title of the query
     61    std::string description; //!< longer description for tooltips or for help
     62  };
     63
     64  // Empty Query is just meant for showing text, such as version, help, initial message or alike
     65  class EmptyQuery : public Query {
     66  public:
     67    EmptyQuery(std::string title, std::string _description = "");
     68    virtual ~EmptyQuery();
     69    virtual bool handle()=0;
     70    virtual void setResult();
    5671  };
    5772
    5873  //Specialized classes for certain types. GUI-Types are not specialized at this time
     74  class BooleanQuery : public Query {
     75  public:
     76    BooleanQuery(std::string title,bool *_target, std::string _description = "");
     77    virtual ~BooleanQuery();
     78    virtual bool handle()=0;
     79    virtual void setResult();
     80  protected:
     81    bool tmp;
     82  private:
     83    bool *target;
     84  };
     85
    5986  class IntQuery : public Query {
    6087  public:
    61     IntQuery(std::string title,int *_target);
     88    IntQuery(std::string title,int *_target, std::string _description = "");
    6289    virtual ~IntQuery();
    6390    virtual bool handle()=0;
     
    7198  class DoubleQuery : public Query {
    7299  public:
    73     DoubleQuery(std::string title,double *_target);
     100    DoubleQuery(std::string title,double *_target, std::string _description = "");
    74101    virtual ~DoubleQuery();
    75102    virtual bool handle()=0;
     
    83110  class StringQuery : public Query {
    84111  public:
    85     StringQuery(std::string title,std::string *_target);
     112    StringQuery(std::string title,std::string *_target, std::string _description = "");
    86113    virtual ~StringQuery();
    87114    virtual bool handle()=0;
     
    93120  };
    94121
    95 
    96122  class MoleculeQuery : public Query {
    97123  public:
    98     MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
     124    MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
    99125    virtual ~MoleculeQuery();
    100126    virtual bool handle()=0;
     
    102128  protected:
    103129    molecule *tmp;
    104     MoleculeListClass *molecules;
    105130  private:
    106131    molecule **target;
    107132  };
    108133
     134  class AtomQuery : public Query {
     135  public:
     136    AtomQuery(std::string title, atom **_target, std::string _description = "");
     137    virtual ~AtomQuery();
     138    virtual bool handle()=0;
     139    virtual void setResult();
     140  protected:
     141    atom *tmp;
     142  private:
     143    atom **target;
     144  };
     145
    109146  class VectorQuery : public Query {
    110147  public:
    111       VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
     148      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
    112149      virtual ~VectorQuery();
    113150      virtual bool handle()=0;
     
    121158  };
    122159
     160  class BoxQuery : public Query {
     161  public:
     162      BoxQuery(std::string title,double ** const _cellSize, std::string _description = "");
     163      virtual ~BoxQuery();
     164      virtual bool handle()=0;
     165      virtual void setResult();
     166    protected:
     167      double *tmp;
     168    private:
     169      double **target;
     170  };
     171
    123172  class ElementQuery : public Query {
    124173  public:
    125     ElementQuery(std::string title, const element**_target);
     174    ElementQuery(std::string title, const element**_target, std::string _description = "");
    126175    virtual ~ElementQuery();
    127176    virtual bool handle()=0;
     
    140189};
    141190
     191
    142192#endif /* DIALOG_HPP_ */
  • src/UIElements/MainWindow.cpp

    ra7b761b r1024cb  
    66 */
    77
    8 #include "UIElements/MainWindow.hpp"
     8#include "MainWindow.hpp"
    99
    1010MainWindow::MainWindow()
  • src/UIElements/MainWindow.hpp

    ra7b761b r1024cb  
    2525};
    2626
    27 /**
    28  * The type of menuPopulators
    29  */
    30 typedef void (*MenuMaker)(Menu*,MoleculeListClass*, config*, periodentafel*);
    31 
    32 /**
    33  * This contains all Functions that are used to create the menus.
    34  * Needs a specific funtion for each menu. All populators will be called
    35  * by the UIFactory upon creation of the main menu. Thus the actuall construction
    36  * of the Menus can be kept independent of the concrete type of UI that is being
    37  * built.
    38  */
    39 struct menuPopulaters{
    40   MenuMaker MakeEditMoleculesMenu;
    41 };
    4227
    4328#endif /* MAINWINDOW_HPP_ */
  • src/UIElements/UIFactory.cpp

    ra7b761b r1024cb  
    99#include <cassert>
    1010#include "Patterns/Singleton_impl.hpp"
    11 #include "UIElements/UIFactory.hpp"
     11#include "UIFactory.hpp"
    1212
    1313// all factories that can be used:
    14 #include "UIElements/TextUIFactory.hpp"
     14#include "TextUI/TextUIFactory.hpp"
     15#include "CommandLineUI/CommandLineUIFactory.hpp"
    1516
    1617UIFactory::UIFactory()
     
    3031      setInstance(new TextUIFactory());
    3132      break;
     33    case CommandLine:
     34      setInstance(new CommandLineUIFactory());
     35      break;
    3236
    3337    default:
  • src/UIElements/UIFactory.hpp

    ra7b761b r1024cb  
    1111class MainWindow;
    1212class Dialog;
    13 
    14 class MoleculeListClass;
    15 class config;
    16 class periodentafel;
    17 
    18 struct menuPopulaters;
     13class DialogDescription;
    1914
    2015#include "Patterns/Singleton.hpp"
     
    3126
    3227public:
    33   enum InterfaceTypes {Text};
     28  enum InterfaceTypes {Text, CommandLine};
    3429  virtual ~UIFactory();
    3530
     
    3732   * Produce some kind of main window, of whichever type was chosen when the factory was created
    3833   */
    39   virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0;
     34  virtual MainWindow* makeMainWindow()=0;
    4035
    4136  /**
  • src/World.cpp

    ra7b761b r1024cb  
    99
    1010#include "atom.hpp"
     11#include "config.hpp"
    1112#include "molecule.hpp"
    1213#include "periodentafel.hpp"
     
    2728}
    2829
     30config *&World::getConfig(){
     31  return configuration;
     32}
     33
    2934// Atoms
    3035
     
    5358std::vector<molecule*> World::getAllMolecules(MoleculeDescriptor descriptor){
    5459  return descriptor.findAll();
     60}
     61
     62std::vector<molecule*> World::getAllMolecules(){
     63  return getAllMolecules(AllMolecules());
    5564}
    5665
     
    7887  delete[](defaultName);
    7988  const int length = strlen(name);
    80   defaultName = new char[length+2];
    81   if (length < MAXSTRINGSIZE)
     89  if (length < MAXSTRINGSIZE) {
     90    defaultName = new char[length+2];
    8291    strncpy(defaultName, name, length);
    83   else
    84     strcpy(defaultName, "none");
     92  } else {
     93    defaultName = new char[MAXSTRINGSIZE];
     94    strncpy(defaultName, "none", MAXSTRINGSIZE-1);
     95  }
    8596};
    8697
     
    267278World::World() :
    268279    periode(new periodentafel),
     280    configuration(new config),
    269281    atoms(),
    270282    currAtomId(0),
     
    292304  delete molecules_deprecated;
    293305  delete periode;
     306  delete configuration;
    294307  MoleculeSet::iterator molIter;
    295308  for(molIter=molecules.begin();molIter!=molecules.end();++molIter){
  • src/World.hpp

    ra7b761b r1024cb  
    3030
    3131// forward declarations
     32class config;
    3233class periodentafel;
    3334class MoleculeListClass;
     
    7576
    7677  /**
     78   * returns the configuration for the world.
     79   */
     80  config *&getConfig();
     81
     82  /**
    7783   * returns the first atom that matches a given descriptor.
    7884   * Do not rely on ordering for descriptors that match more than one atom.
     
    109115   */
    110116  std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor);
     117  std::vector<molecule*> getAllMolecules();
    111118
    112119  /**
     
    234241
    235242  periodentafel *periode;
     243  config *configuration;
    236244  static double *cell_size;
    237245  static char *defaultName;
  • src/analysis_bonds.cpp

    ra7b761b r1024cb  
    4949 * \param &Max maximum distance on return, 0 if no bond between the two elements
    5050 */
    51 void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max)
     51void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max)
    5252{
    5353  Min = 2e+6;
     
    120120 * \param *InterfaceElement or NULL
    121121 */
    122 int CountHydrogenBridgeBonds(MoleculeListClass *molecules, element * InterfaceElement = NULL)
     122int CountHydrogenBridgeBonds(MoleculeListClass *molecules, const element * InterfaceElement = NULL)
    123123{
    124124  int count = 0;
  • src/analysis_bonds.hpp

    ra7b761b r1024cb  
    3131
    3232void GetMaxMinMeanBondCount(const molecule * const mol, double &Min, double &Mean, double &Max);
    33 void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max);
     33void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max);
    3434
    35 int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, element * InterfaceElement);
     35int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, const element * InterfaceElement);
    3636int CountBondsOfTwo(MoleculeListClass * const molecules, const element * const first, const element * const second);
    3737int CountBondsOfThree(MoleculeListClass * const molecules, const element * const first, const element * const second, const element * const third);
  • src/analysis_correlation.cpp

    ra7b761b r1024cb  
    136136        }
    137137      }
    138       Free(&FullMatrix);
    139       Free(&FullInverseMatrix);
     138      delete[](FullMatrix);
     139      delete[](FullInverseMatrix);
    140140    }
    141141
     
    221221        }
    222222      }
    223       Free(&FullMatrix);
    224       Free(&FullInverseMatrix);
     223      delete[](FullMatrix);
     224      delete[](FullInverseMatrix);
    225225    }
    226226
     
    328328        }
    329329      }
    330       Free(&FullMatrix);
    331       Free(&FullInverseMatrix);
     330      delete[](FullMatrix);
     331      delete[](FullInverseMatrix);
    332332    }
    333333
  • src/analyzer.cpp

    ra7b761b r1024cb  
    7575    return 1;
    7676  } else {
    77     dir = Malloc<char>(strlen(argv[2]) + 2, "main: *dir");
     77    dir = new char[strlen(argv[2]) + 2];
    7878    strcpy(dir, "/");
    7979    strcat(dir, argv[2]);
     
    8282  if (argc > 4) {
    8383    DoLog(0) && (Log() << Verbose(0) << "Loading periodentafel." << endl);
    84     periode = Malloc<periodentafel>(1, "main - periode");
     84    periode = new periodentafel;
    8585    periode->LoadPeriodentafel(argv[4]);
    8686  }
     
    558558  // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++
    559559  delete(periode);
    560   Free(&dir);
     560  delete[](dir);
    561561  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    562562  return 0;
  • src/atom.cpp

    ra7b761b r1024cb  
    269269{
    270270  if (ComponentNr != NULL)
    271     Free(&ComponentNr);
    272   ComponentNr = Malloc<int>(ListOfBonds.size()+1, "atom::InitComponentNumbers: *ComponentNr");
     271    delete[](ComponentNr);
     272  ComponentNr = new int[ListOfBonds.size()+1];
    273273  for (int i=ListOfBonds.size()+1;i--;)
    274274    ComponentNr[i] = -1;
  • src/atom_bondedparticle.cpp

    ra7b761b r1024cb  
    7474      *BondFile << nr << "\t" << (*Runner)->GetOtherAtom(this)->nr << "\n";
    7575};
     76
     77/**
     78 * Adds a bond between this bonded particle and another. Does nothing if this
     79 * bond already exists.
     80 *
     81 * \param bonding partner
     82 */
     83void BondedParticle::addBond(BondedParticle* Partner) {
     84  if (IsBondedTo(Partner)) {
     85    return;
     86  }
     87
     88  bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0);
     89  RegisterBond(newBond);
     90  Partner->RegisterBond(newBond);
     91}
    7692
    7793/** Puts a given bond into atom::ListOfBonds.
  • src/atom_bondedparticle.hpp

    ra7b761b r1024cb  
    3737  virtual ~BondedParticle();
    3838
     39  void addBond(BondedParticle* Partner);
    3940  bool RegisterBond(bond *Binder);
    4041  bool UnregisterBond(bond *Binder);
  • src/atom_graphnodeinfo.cpp

    ra7b761b r1024cb  
    1717GraphNodeInfo::~GraphNodeInfo()
    1818{
    19   Free<int>(&ComponentNr, "atom::~atom: *ComponentNr");
     19  delete[](ComponentNr);
    2020};
  • src/atom_trajectoryparticle.cpp

    ra7b761b r1024cb  
    1010#include "config.hpp"
    1111#include "element.hpp"
     12#include "info.hpp"
    1213#include "log.hpp"
    1314#include "parser.hpp"
     
    7172void TrajectoryParticle::ResizeTrajectory(int MaxSteps)
    7273{
     74  Info FunctionInfo(__func__);
    7375  if (Trajectory.R.size() <= (unsigned int)(MaxSteps)) {
    74     //Log() << Verbose(0) << "Increasing size for trajectory array of " << keyword << " to " << (MaxSteps+1) << "." << endl;
     76    DoLog(0) && (Log() << Verbose(0) << "Increasing size for trajectory array of " << nr << " from " << Trajectory.R.size() << " to " << (MaxSteps+1) << "." << endl);
    7577    Trajectory.R.resize(MaxSteps+1);
    7678    Trajectory.U.resize(MaxSteps+1);
  • src/bond.cpp

    ra7b761b r1024cb  
    1515/** Empty Constructor for class bond.
    1616 */
    17 bond::bond() : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white)
     17bond::bond()
     18  : leftatom(NULL), rightatom(NULL), previous(NULL), next(NULL), HydrogenBond(0),
     19    BondDegree(0), nr(-1), Cyclic(false), Type(Undetermined), Used(white)
    1820{
    1921};
     
    2527 * \param number increasing index
    2628 */
    27 bond::bond(atom *left, atom *right, const int degree, const int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
     29bond::bond(atom *left, atom *right, const int degree, const int number)
     30  : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0),
     31    BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
    2832{
    2933  if ((left != NULL) && (right != NULL)) {
  • src/bondgraph.hpp

    ra7b761b r1024cb  
    2727
    2828class molecule;
    29 class periodentafel;
     29class BondedParticle;
    3030class MatrixContainer;
    3131
  • src/boundary.cpp

    ra7b761b r1024cb  
    918918        }
    919919      }
    920   Free(&M);
    921   Free(&MInverse);
     920  delete[](M);
     921  delete[](MInverse);
    922922
    923923  return Filling;
  • src/builder.cpp

    ra7b761b r1024cb  
    5353
    5454#include <cstring>
     55#include <cstdlib>
    5556
    5657#include "analysis_bonds.hpp"
     
    6061#include "bondgraph.hpp"
    6162#include "boundary.hpp"
     63#include "CommandLineParser.hpp"
    6264#include "config.hpp"
    6365#include "element.hpp"
     
    7678#include "Actions/ActionRegistry.hpp"
    7779#include "Actions/ActionHistory.hpp"
     80#include "Actions/MapOfActions.hpp"
    7881#include "Actions/MethodAction.hpp"
    79 #include "Actions/small_actions.hpp"
     82#include "Actions/MoleculeAction/ChangeNameAction.hpp"
    8083#include "World.hpp"
    8184#include "version.h"
     
    862865
    863866        mol->CountAtoms(); // recount atoms
    864         if (mol->AtomCount != 0) {  // if there is more than none
    865           count = mol->AtomCount;  // is changed becausing of adding, thus has to be stored away beforehand
     867        if (mol->getAtomCount() != 0) {  // if there is more than none
     868          count = mol->getAtomCount();  // is changed becausing of adding, thus has to be stored away beforehand
    866869          Elements = new element *[count];
    867870          vectors = new Vector *[count];
     
    12931296  // generate some KeySets
    12941297  DoLog(0) && (Log() << Verbose(0) << "Generating KeySets." << endl);
    1295   KeySet TestSets[mol->AtomCount+1];
     1298  KeySet TestSets[mol->getAtomCount()+1];
    12961299  i=1;
    12971300  while (Walker->next != mol->end) {
     
    13041307  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl);
    13051308  KeySetTestPair test;
    1306   test = TestSets[mol->AtomCount-1].insert(Walker->nr);
     1309  test = TestSets[mol->getAtomCount()-1].insert(Walker->nr);
    13071310  if (test.second) {
    13081311    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
     
    13101313    DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl);
    13111314  }
    1312   TestSets[mol->AtomCount].insert(mol->end->previous->nr);
    1313   TestSets[mol->AtomCount].insert(mol->end->previous->previous->previous->nr);
     1315  TestSets[mol->getAtomCount()].insert(mol->end->previous->nr);
     1316  TestSets[mol->getAtomCount()].insert(mol->end->previous->previous->previous->nr);
    13141317
    13151318  // constructing Graph structure
     
    13191322  // insert KeySets into Subgraphs
    13201323  DoLog(0) && (Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl);
    1321   for (int j=0;j<mol->AtomCount;j++) {
     1324  for (int j=0;j<mol->getAtomCount();j++) {
    13221325    Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.)));
    13231326  }
    13241327  DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl);
    13251328  GraphTestPair test2;
    1326   test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.)));
     1329  test2 = Subgraphs.insert(GraphPair (TestSets[mol->getAtomCount()],pair<int, double>(counter++, 1.)));
    13271330  if (test2.second) {
    13281331    DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl);
     
    14791482
    14801483/** Parses the command line options.
     1484 * Note that this function is from now on transitional. All commands that are not passed
     1485 * here are handled by CommandLineParser and the actions of CommandLineUIFactory.
    14811486 * \param argc argument count
    14821487 * \param **argv arguments array
     
    14861491 * \param *ConfigFileName pointer to config file name in **argv
    14871492 * \param *PathToDatabases pointer to db's path in **argv
     1493 * \param &ArgcList list of arguments that we do not parse here
    14881494 * \return exit code (0 - successful, all else - something's wrong)
    14891495 */
    1490 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,\
    1491                                    config& configuration, char *&ConfigFileName)
     1496static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
     1497                                   config& configuration, char **ConfigFileName, set<int> &ArgcList)
    14921498{
    14931499  Vector x,y,z,n;  // coordinates for absolute point in cell volume
     
    15071513  molecule *mol = NULL;
    15081514  string BondGraphFileName("\n");
    1509   int verbosity = 0;
    1510   strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
     1515  bool DatabasePathGiven = false;
    15111516
    15121517  if (argc > 1) { // config file specified as option
     
    15211526          case 'H':
    15221527          case '?':
    1523             DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl);
    1524             DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl);
    1525             DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl);
    1526             DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl);
    1527             DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl);
    1528             DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
    1529             DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl);
    1530             DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl);
    1531             DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl);
    1532             DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl);
    1533             DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl);
    1534             DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl);
    1535             DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl);
    1536             DoLog(0) && (Log() << Verbose(0) << "\t-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);
    1537             DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
    1538             DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl);
    1539             DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl);
    1540             DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl);
    1541             DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl);
    1542             DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl);
    1543             DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl);
    1544             DoLog(0) && (Log() << Verbose(0) << "\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);
    1545             DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl);
    1546             DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl);
    1547             DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl);
    1548             DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl);
    1549             DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl);
    1550             DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl);
    1551             DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl);
    1552             DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl);
    1553             DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl);
    1554             DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl);
    1555             DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl);
    1556             DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl);
    1557             DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl);
    1558             DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl);
    1559             DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl);
    1560             DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl);
    1561             DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl);
    1562             DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl);
    1563             DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl);
    1564             return (1);
     1528            ArgcList.insert(argptr-1);
     1529            return(1);
    15651530            break;
    15661531          case 'v':
    1567             while (argv[argptr-1][verbosity+1] == 'v') {
    1568               verbosity++;
    1569             }
    1570             setVerbosity(verbosity);
    1571             DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
     1532            setVerbosity(atoi(argv[argptr]));
     1533            ArgcList.insert(argptr-1);
     1534            ArgcList.insert(argptr);
     1535            argptr++;
    15721536            break;
    15731537          case 'V':
    1574             DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl);
    1575             DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl);
    1576             return (1);
     1538            ArgcList.insert(argptr-1);
     1539            return(1);
    15771540            break;
    15781541          case 'B':
     1542            ArgcList.insert(argptr-1);
     1543            ArgcList.insert(argptr);
     1544            ArgcList.insert(argptr+1);
     1545            ArgcList.insert(argptr+2);
     1546            ArgcList.insert(argptr+3);
     1547            ArgcList.insert(argptr+4);
     1548            ArgcList.insert(argptr+5);
     1549            argptr+=6;
    15791550            if (ExitFlag == 0) ExitFlag = 1;
    1580             if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {
    1581               ExitFlag = 255;
    1582               DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);
    1583               performCriticalExit();
    1584             } else {
    1585               SaveFlag = true;
    1586               j = -1;
    1587               DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    1588               double * const cell_size = World::getInstance().getDomain();
    1589               for (int i=0;i<6;i++) {
    1590                 cell_size[i] = atof(argv[argptr+i]);
    1591               }
    1592               argptr+=6;
    1593             }
    15941551            break;
    15951552          case 'e':
     
    16001557              DoLog(0) && (Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl);
    16011558              strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1);
     1559              DatabasePathGiven = true;
    16021560              argptr+=1;
    16031561            }
     
    16131571            }
    16141572            break;
     1573          case 'M':
     1574            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
     1575              ExitFlag = 255;
     1576              DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -M <basis name>" << endl);
     1577              performCriticalExit();
     1578            } else {
     1579              configuration.basis = argv[argptr];
     1580              DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl);
     1581              argptr+=1;
     1582            }
     1583            break;
    16151584          case 'n':
    16161585            DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     
    16201589            {
    16211590              World::getInstance().setDefaultName(argv[argptr]);
    1622               DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << *World::getInstance().getDefaultName() << "." << endl);
     1591              DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    16231592            }
    16241593            break;
     
    16321601
    16331602    // 3a. Parse the element database
    1634     if (periode->LoadPeriodentafel(configuration.databasepath)) {
    1635       DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
    1636       //periode->Output();
    1637     } else {
    1638       DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
    1639       return 1;
    1640     }
     1603    if (DatabasePathGiven)
     1604      if (periode->LoadPeriodentafel(configuration.databasepath)) {
     1605        DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl);
     1606        //periode->Output();
     1607      } else {
     1608        DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl);
     1609        return 1;
     1610      }
    16411611    // 3b. Find config file name and parse if possible, also BondGraphFileName
    16421612    if (argv[1][0] != '-') {
     
    16521622        } else {
    16531623          DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl);
    1654           ConfigFileName = argv[1];
     1624          strcpy(*ConfigFileName, argv[1]);
    16551625          configPresent = empty;
    16561626          output.close();
     
    16581628      } else {
    16591629        test.close();
    1660         ConfigFileName = argv[1];
     1630        strcpy(*ConfigFileName, argv[1]);
    16611631        DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");
    1662         switch (configuration.TestSyntax(ConfigFileName, periode)) {
     1632        switch (configuration.TestSyntax(*ConfigFileName, periode)) {
    16631633          case 1:
    16641634            DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl);
    1665             configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules);
     1635            configuration.Load(*ConfigFileName, BondGraphFileName, periode, molecules);
    16661636            configPresent = present;
    16671637            break;
    16681638          case 0:
    16691639            DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl);
    1670             configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules);
     1640            configuration.LoadOld(*ConfigFileName, BondGraphFileName, periode, molecules);
    16711641            configPresent = present;
    16721642            break;
     
    16891659       mol = World::getInstance().createMolecule();
    16901660       mol->ActiveFlag = true;
    1691        if (ConfigFileName != NULL)
    1692          mol->SetNameFromFilename(ConfigFileName);
     1661       if (*ConfigFileName != NULL)
     1662         mol->SetNameFromFilename(*ConfigFileName);
    16931663       molecules->insert(mol);
    16941664     }
     
    17571727        if (configPresent == present) {
    17581728          switch(argv[argptr-1][1]) {
    1759             case 'M':
    1760               if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    1761                 ExitFlag = 255;
    1762                 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl);
    1763                 performCriticalExit();
    1764               } else {
    1765                 configuration.basis = argv[argptr];
    1766                 DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl);
    1767                 argptr+=1;
    1768               }
    1769               break;
    17701729            case 'D':
    17711730              if (ExitFlag == 0) ExitFlag = 1;
     
    17931752                  delete(Subgraphs);
    17941753                  for (int i=0;i<FragmentCounter;i++)
    1795                     Free(&ListOfLocalAtoms[i]);
    1796                   Free(&ListOfLocalAtoms);
     1754                    delete[](ListOfLocalAtoms[i]);
     1755                  delete[](ListOfLocalAtoms);
    17971756                }
    17981757                delete(BackEdgeStack);
     
    18341793                        if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) {
    18351794                          ExitFlag = 255;
    1836                           DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl);
     1795                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output> <binstart> <binend>" << endl);
    18371796                          performCriticalExit();
    18381797                        } else {
     
    18651824                        if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) ||  (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) {
    18661825                          ExitFlag = 255;
    1867                           DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl);
     1826                          DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output> <binstart> <binend>" << endl);
    18681827                          performCriticalExit();
    18691828                        } else {
     
    19261885                            counter++;
    19271886                          }
    1928                           bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
     1887                          bool *Actives = new bool[counter];
    19291888                          counter = 0;
    19301889                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
     
    19541913                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
    19551914                            (*BigFinder)->ActiveFlag = Actives[counter++];
    1956                           Free(&Actives);
     1915                          delete[](Actives);
    19571916                          delete(LCList);
    19581917                          delete(TesselStruct);
     
    20111970                configuration.BG->ConstructBondGraph(filler);
    20121971                molecule *Filling = NULL;
    2013                 atom *second = NULL, *third = NULL;
    2014                 first = World::getInstance().createAtom();
    2015                 first->type = periode->FindElement(1);
    2016                 first->x = Vector(0.441, -0.143, 0.);
    2017                 filler->AddAtom(first);
    2018                 second = World::getInstance().createAtom();
    2019                 second->type = periode->FindElement(1);
    2020                 second->x = Vector(-0.464, 1.137, 0.0);
    2021                 filler->AddAtom(second);
    2022                 third = World::getInstance().createAtom();
    2023                 third->type = periode->FindElement(8);
    2024                 third->x = Vector(-0.464, 0.177, 0.);
    2025                 filler->AddAtom(third);
    2026                 filler->AddBond(first, third, 1);
    2027                 filler->AddBond(second, third, 1);
    20281972                // call routine
    20291973                double distance[NDIM];
     
    20471991              } else {
    20481992                DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl);
    2049                 ifstream *input = new ifstream(argv[argptr]);
    2050                 mol->CreateAdjacencyListFromDbondFile(input);
    2051                 input->close();
     1993                ifstream input(argv[argptr]);
     1994                mol->CreateAdjacencyListFromDbondFile(&input);
     1995                input.close();
    20521996                argptr+=1;
    20531997              }
     
    21392083              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    21402084                ExitFlag = 255;
    2141                 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl);
     2085                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for linear interpolation: -L <step0> <step1> <prefix> <identity mapping?>" << endl);
    21422086                performCriticalExit();
    21432087              } else {
     
    21712115            case 'R':
    21722116              if (ExitFlag == 0) ExitFlag = 1;
    2173               if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])))  {
     2117              if ((argptr+3 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])))  {
    21742118                ExitFlag = 255;
    2175                 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl);
     2119                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <x> <y> <z> <distance>" << endl);
    21762120                performCriticalExit();
    21772121              } else {
    21782122                SaveFlag = true;
    2179                 DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl);
    2180                 double tmp1 = atof(argv[argptr+1]);
    2181                 atom *third = mol->FindAtom(atoi(argv[argptr]));
    2182                 if(third){
    2183                   for(molecule::iterator iter = mol->begin(); iter != mol->end();){
    2184                     if ((*iter)->x.DistanceSquared(third->x) > tmp1*tmp1){ // distance to first above radius ...
    2185                       mol->RemoveAtom(*(iter++));
    2186                     }
    2187                     else{
    2188                       ++iter;
    2189                     }
     2123                const double radius = atof(argv[argptr+3]);
     2124                Vector point(atof(argv[argptr]),atof(argv[argptr+1]),atof(argv[argptr+2]));
     2125                DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << point << " with radius " << radius << "." << endl);
     2126                atom *Walker = NULL;
     2127                molecule::iterator advancer = mol->begin();
     2128                for(molecule::iterator iter = advancer; advancer != mol->end();) {
     2129                  iter = advancer++;
     2130                  if ((*iter)->x.DistanceSquared(point) > radius*radius){ // distance to first above radius ...
     2131                    Walker = (*iter);
     2132                    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << *Walker << "." << endl);
     2133                    mol->RemoveAtom(*(iter));
     2134                    World::getInstance().destroyAtom(Walker);
    21902135                  }
    2191                 } else {
    2192                   DoeLog(1) && (eLog()<< Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl);
    21932136                }
    2194                 argptr+=2;
     2137                argptr+=4;
    21952138              }
    21962139              break;
     
    22292172            case 's':
    22302173              if (ExitFlag == 0) ExitFlag = 1;
    2231               if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
     2174              if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {
    22322175                ExitFlag = 255;
    22332176                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl);
    22342177                performCriticalExit();
    22352178              } else {
    2236                 SaveFlag = true;
    2237                 j = -1;
    2238                 DoLog(1) && (Log() << Verbose(1) << "Scaling all ion positions by factor." << endl);
    2239                 factor = new double[NDIM];
    2240                 factor[0] = atof(argv[argptr]);
    2241                 factor[1] = atof(argv[argptr+1]);
    2242                 factor[2] = atof(argv[argptr+2]);
    2243                 mol->Scale((const double ** const)&factor);
    2244                 double * const cell_size = World::getInstance().getDomain();
    2245                 for (int i=0;i<NDIM;i++) {
    2246                   j += i+1;
    2247                   x[i] = atof(argv[NDIM+i]);
    2248                   cell_size[j]*=factor[i];
    2249                 }
    2250                 delete[](factor);
     2179                ArgcList.insert(argptr-1);
     2180                ArgcList.insert(argptr);
     2181                ArgcList.insert(argptr+1);
     2182                ArgcList.insert(argptr+2);
    22512183                argptr+=3;
    22522184              }
     
    22592191                performCriticalExit();
    22602192              } else {
    2261                 SaveFlag = true;
    2262                 j = -1;
    2263                 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    2264                 double * const cell_size = World::getInstance().getDomain();
    2265                 for (int i=0;i<6;i++) {
    2266                   cell_size[i] = atof(argv[argptr+i]);
    2267                 }
    2268                 // center
    2269                 mol->CenterInBox();
     2193                ArgcList.insert(argptr-1);
     2194                ArgcList.insert(argptr);
     2195                ArgcList.insert(argptr+1);
     2196                ArgcList.insert(argptr+2);
     2197                ArgcList.insert(argptr+3);
     2198                ArgcList.insert(argptr+4);
     2199                ArgcList.insert(argptr+5);
    22702200                argptr+=6;
    22712201              }
     
    22782208                performCriticalExit();
    22792209              } else {
    2280                 SaveFlag = true;
    2281                 j = -1;
    2282                 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);
    2283                 double * const cell_size = World::getInstance().getDomain();
    2284                 for (int i=0;i<6;i++) {
    2285                   cell_size[i] = atof(argv[argptr+i]);
    2286                 }
    2287                 // center
    2288                 mol->BoundInBox();
     2210                ArgcList.insert(argptr-1);
     2211                ArgcList.insert(argptr);
     2212                ArgcList.insert(argptr+1);
     2213                ArgcList.insert(argptr+2);
     2214                ArgcList.insert(argptr+3);
     2215                ArgcList.insert(argptr+4);
     2216                ArgcList.insert(argptr+5);
    22892217                argptr+=6;
    22902218              }
     
    24982426    } while (argptr < argc);
    24992427    if (SaveFlag)
    2500       configuration.SaveAll(ConfigFileName, periode, molecules);
     2428      configuration.SaveAll(*ConfigFileName, periode, molecules);
    25012429  } else {  // no arguments, hence scan the elements db
    25022430    if (periode->LoadPeriodentafel(configuration.databasepath))
     
    25092437};
    25102438
    2511 /***************************************** Functions used to build all menus **********************/
    2512 
    2513 void populateEditMoleculesMenu(Menu* editMoleculesMenu,MoleculeListClass *molecules, config *configuration, periodentafel *periode){
    2514   // build the EditMoleculesMenu
    2515   Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));
    2516   new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);
    2517 
    2518   Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));
    2519   new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
    2520 
    2521   Action *changeFilenameAction = new ChangeMoleculeNameAction(molecules);
    2522   new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
    2523 
    2524   Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));
    2525   new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);
    2526 
    2527   Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));
    2528   new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);
    2529 
    2530   Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
    2531   new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
    2532 
    2533 }
    2534 
    2535 
    25362439/********************************************** Main routine **************************************/
    25372440
    2538 void cleanUp(config *configuration){
    2539   UIFactory::purgeInstance();
     2441void cleanUp(){
    25402442  World::purgeInstance();
    2541   delete(configuration);
    2542   Log() << Verbose(0) <<  "Maximum of allocated memory: "
    2543     << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
    2544   Log() << Verbose(0) <<  "Remaining non-freed memory: "
    2545     << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
    2546   MemoryUsageObserver::purgeInstance();
    25472443  logger::purgeInstance();
    25482444  errorLogger::purgeInstance();
     2445  UIFactory::purgeInstance();
     2446  MapOfActions::purgeInstance();
     2447  CommandLineParser::purgeInstance();
    25492448  ActionRegistry::purgeInstance();
    25502449  ActionHistory::purgeInstance();
     
    25542453int main(int argc, char **argv)
    25552454{
     2455    config *configuration = World::getInstance().getConfig();
    25562456    // while we are non interactive, we want to abort from asserts
    25572457    //ASSERT_DO(Assert::Abort);
    25582458    molecule *mol = NULL;
    2559     config *configuration = new config;
    25602459    Vector x, y, z, n;
    25612460    ifstream test;
    25622461    ofstream output;
    25632462    string line;
    2564     char *ConfigFileName = NULL;
    2565     int j;
    2566 
     2463    char **Arguments = NULL;
     2464    int ArgcSize = 0;
     2465    int ExitFlag = 0;
     2466    bool ArgumentsCopied = false;
     2467    char *ConfigFileName = new char[MAXSTRINGSIZE];
     2468
     2469    // print version check whether arguments are present at all
    25672470    cout << ESPACKVersion << endl;
     2471    if (argc < 2) {
     2472      cout << "Obtain help with " << argv[0] << " -h." << endl;
     2473      cleanUp();
     2474      Memory::getState();
     2475      return(1);
     2476    }
     2477
    25682478
    25692479    setVerbosity(0);
    25702480    // need to init the history before any action is created
    25712481    ActionHistory::init();
    2572     /* structure of ParseCommandLineOptions will be refactored later */
    2573     j = ParseCommandLineOptions(argc, argv,  World::getInstance().getMolecules(), World::getInstance().getPeriode(), *configuration, ConfigFileName);
    2574     switch (j){
    2575         case 255:
    2576         case 2:
    2577         case 1:
    2578             cleanUp(configuration);
    2579             return (j == 1 ? 0 : j);
    2580         default:
    2581             break;
    2582     }
    2583     if(World::getInstance().numMolecules() == 0){
    2584         mol = World::getInstance().createMolecule();
    2585         World::getInstance().getMolecules()->insert(mol);
    2586         cout << "Molecule created" << endl;
    2587         if(World::getInstance().getDomain()[0] == 0.){
    2588             Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;
    2589             for(int i = 0;i < 6;i++){
    2590                 Log() << Verbose(1) << "Cell size" << i << ": ";
    2591                 cin >> World::getInstance().getDomain()[i];
    2592             }
    2593         }
    2594         mol->ActiveFlag = true;
    2595     }
    25962482
    25972483    // In the interactive mode, we can leave the user the choice in case of error
    25982484    ASSERT_DO(Assert::Ask);
    25992485
     2486    // from this moment on, we need to be sure to deeinitialize in the correct order
     2487    // this is handled by the cleanup function
     2488    atexit(cleanUp);
     2489
     2490    // Parse command line options and if present create respective UI
    26002491    {
    2601       cout << ESPACKVersion << endl;
    2602 
    2603       setVerbosity(0);
    2604 
    2605       menuPopulaters populaters;
    2606       populaters.MakeEditMoleculesMenu = populateEditMoleculesMenu;
    2607 
    2608       UIFactory::makeUserInterface(UIFactory::Text);
    2609       MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(populaters,World::getInstance().getMolecules(), configuration, World::getInstance().getPeriode(), ConfigFileName);
     2492      set<int> ArgcList;
     2493      ArgcList.insert(0); // push back program!
     2494      ArgcList.insert(1); // push back config file name
     2495      // handle arguments by ParseCommandLineOptions()
     2496      ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, ArgcList);
     2497      // copy all remaining arguments to a new argv
     2498      Arguments = new char *[ArgcList.size()];
     2499      cout << "The following arguments are handled by CommandLineParser: ";
     2500      for (set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
     2501        Arguments[ArgcSize] = new char[strlen(argv[*ArgcRunner])+2];
     2502        strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
     2503        cout << " " << argv[*ArgcRunner];
     2504        ArgcSize++;
     2505      }
     2506      cout << endl;
     2507      ArgumentsCopied = true;
     2508      // handle remaining arguments by CommandLineParser
     2509      MapOfActions::getInstance().AddOptionsToParser();
     2510      CommandLineParser::getInstance().Run(ArgcSize,Arguments);
     2511      if (!CommandLineParser::getInstance().isEmpty()) {
     2512        DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
     2513        UIFactory::makeUserInterface(UIFactory::CommandLine);
     2514      } else {
     2515        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
     2516        UIFactory::makeUserInterface(UIFactory::Text);
     2517      }
     2518    }
     2519
     2520    {
     2521      MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow();
    26102522      mainWindow->display();
    26112523      delete mainWindow;
    26122524    }
    26132525
    2614     if(World::getInstance().getPeriode()->StorePeriodentafel(configuration->databasepath))
    2615         Log() << Verbose(0) << "Saving of elements.db successful." << endl;
    2616 
    2617     else
    2618         Log() << Verbose(0) << "Saving of elements.db failed." << endl;
    2619 
    2620   cleanUp(configuration);
    2621 
    2622   return (0);
     2526    Log() << Verbose(0) << "Saving to " << ConfigFileName << "." << endl;
     2527    World::getInstance().getConfig()->SaveAll(ConfigFileName, World::getInstance().getPeriode(), World::getInstance().getMolecules());
     2528
     2529  // free the new argv
     2530  if (ArgumentsCopied) {
     2531    for (int i=0; i<ArgcSize;i++)
     2532      delete[](Arguments[i]);
     2533    delete[](Arguments);
     2534  }
     2535  delete[](ConfigFileName);
     2536
     2537  return (ExitFlag == 1 ? 0 : ExitFlag);
    26232538}
    26242539
  • src/config.cpp

    ra7b761b r1024cb  
    1414#include "element.hpp"
    1515#include "helpers.hpp"
     16#include "info.hpp"
    1617#include "lists.hpp"
    1718#include "log.hpp"
     
    9394    return;
    9495  } else
    95     buffer = Malloc<char*>(NoLines, "ConfigFileBuffer::ConfigFileBuffer: **buffer");
     96    buffer = new char *[NoLines];
    9697
    9798  // scan each line and put into buffer
     
    99100  int i;
    100101  do {
    101     buffer[lines] = Malloc<char>(MAXSTRINGSIZE, "ConfigFileBuffer::ConfigFileBuffer: *buffer[]");
     102    buffer[lines] = new char[MAXSTRINGSIZE];
    102103    file->getline(buffer[lines], MAXSTRINGSIZE-1);
    103104    i = strlen(buffer[lines]);
     
    119120{
    120121  for(int i=0;i<NoLines;++i)
    121     Free(&buffer[i]);
    122   Free(&buffer);
    123   Free(&LineMapping);
     122    delete[](buffer[i]);
     123  delete[](buffer);
     124  delete[](LineMapping);
    124125}
    125126
     
    129130void ConfigFileBuffer::InitMapping()
    130131{
    131   LineMapping = Malloc<int>(NoLines, "ConfigFileBuffer::InitMapping: *LineMapping");
     132  LineMapping = new int[NoLines];
    132133  for (int i=0;i<NoLines;i++)
    133134    LineMapping[i] = i;
     
    179180    MaxLevel(5), RiemannTensor(0), LevRFactor(0), RiemannLevel(0), Lev0Factor(2), RTActualUse(0), AddPsis(0), RCut(20.), StructOpt(0), IsAngstroem(1), RelativeCoord(0),
    180181    MaxTypes(0) {
    181   mainname = Malloc<char>(MAXSTRINGSIZE,"config constructor: mainname");
    182   defaultpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: defaultpath");
    183   pseudopotpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: pseudopotpath");
    184   databasepath = Malloc<char>(MAXSTRINGSIZE,"config constructor: databasepath");
    185   configpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: configpath");
    186   configname = Malloc<char>(MAXSTRINGSIZE,"config constructor: configname");
     182  mainname = new char[MAXSTRINGSIZE];
     183  defaultpath = new char[MAXSTRINGSIZE];
     184  pseudopotpath = new char[MAXSTRINGSIZE];
     185  databasepath = new char[MAXSTRINGSIZE];
     186  configpath = new char[MAXSTRINGSIZE];
     187  configname = new char[MAXSTRINGSIZE];
    187188  strcpy(mainname,"pcp");
    188189  strcpy(defaultpath,"not specified");
     
    199200config::~config()
    200201{
    201   Free(&mainname);
    202   Free(&defaultpath);
    203   Free(&pseudopotpath);
    204   Free(&databasepath);
    205   Free(&configpath);
    206   Free(&configname);
    207   Free(&ThermostatImplemented);
     202  delete[](mainname);
     203  delete[](defaultpath);
     204  delete[](pseudopotpath);
     205  delete[](databasepath);
     206  delete[](configpath);
     207  delete[](configname);
     208  delete[](ThermostatImplemented);
    208209  for (int j=0;j<MaxThermostats;j++)
    209     Free(&ThermostatNames[j]);
    210   Free(&ThermostatNames);
     210    delete[](ThermostatNames[j]);
     211  delete[](ThermostatNames);
    211212
    212213  if (BG != NULL)
     
    218219void config::InitThermostats()
    219220{
    220   ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented");
    221   ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames");
     221  ThermostatImplemented = new int[MaxThermostats];
     222  ThermostatNames = new char *[MaxThermostats];
    222223  for (int j=0;j<MaxThermostats;j++)
    223     ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]");
     224    ThermostatNames[j] = new char[12];
    224225
    225226  strcpy(ThermostatNames[0],"None");
     
    242243void config::ParseThermostats(class ConfigFileBuffer * const fb)
    243244{
    244   char * const thermo = Malloc<char>(12, "IonsInitRead: thermo");
     245  char * const thermo = new char[12];
    245246  const int verbose = 0;
    246247
     
    309310    Thermostat = None;
    310311  }
    311   Free(thermo);
     312  delete[](thermo);
    312313};
    313314
     
    15601561
    15611562  for (MoleculeList::const_iterator MolRunner = MolList->ListOfMolecules.begin(); MolRunner != MolList->ListOfMolecules.end(); MolRunner++) {
    1562     int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo");
     1563    int *elementNo = new int[MAX_ELEMENTS];
     1564    for (int i=0;i<MAX_ELEMENTS;i++)
     1565      elementNo[i] = 0;
    15631566    AtomNo = 0;
    15641567    for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) {
     
    15821585      AtomNo++;
    15831586    }
    1584     Free(&elementNo);
     1587    delete[](elementNo);
    15851588    MolNo++;
    15861589  }
     
    16001603  FILE *f = NULL;
    16011604
    1602   int *elementNo = Calloc<int>(MAX_ELEMENTS, "config::SavePDB - elementNo");
     1605  int *elementNo = new int[MAX_ELEMENTS];
     1606  for (int i=0;i<MAX_ELEMENTS;i++)
     1607    elementNo[i] = 0;
    16031608  char name[MAXSTRINGSIZE];
    16041609  strncpy(name, filename, MAXSTRINGSIZE-1);
     
    16071612  if (f == NULL) {
    16081613    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);
    1609     Free(&elementNo);
     1614    delete[](elementNo);
    16101615    return false;
    16111616  }
     
    16341639  }
    16351640  fclose(f);
    1636   Free(&elementNo);
     1641  delete[](elementNo);
    16371642
    16381643  return true;
     
    16971702bool config::SaveTREMOLO(const char * const filename, const MoleculeListClass * const MolList) const
    16981703{
     1704  Info FunctionInfo(__func__);
    16991705  ofstream *output = NULL;
    17001706  stringstream * const fname = new stringstream;
     
    17201726
    17211727  // create global to local id map
    1722   int **LocalNotoGlobalNoMap = Calloc<int *>(MolList->ListOfMolecules.size(), "config::SaveTREMOLO - **LocalNotoGlobalNoMap");
     1728  map<int, int> LocalNotoGlobalNoMap;
    17231729  {
    1724     int MolCounter = 0;
    1725     int AtomNo = 0;
     1730    unsigned int MolCounter = 0;
     1731    int AtomNo = 1;
    17261732    for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) {
    1727       LocalNotoGlobalNoMap[MolCounter] = Calloc<int>(MolList->CountAllAtoms(), "config::SaveTREMOLO - *LocalNotoGlobalNoMap[]");
    1728 
    1729       (*MolWalker)->SetIndexedArrayForEachAtomTo( LocalNotoGlobalNoMap[MolCounter], &atom::nr, IncrementalAbsoluteValue, &AtomNo);
    1730 
     1733      for(molecule::iterator AtomRunner = (*MolWalker)->begin(); AtomRunner != (*MolWalker)->end(); ++AtomRunner) {
     1734        LocalNotoGlobalNoMap.insert( pair<int,int>((*AtomRunner)->getId(), AtomNo++) );
     1735      }
    17311736      MolCounter++;
    17321737    }
     1738    ASSERT(MolCounter == MolList->ListOfMolecules.size(), "SaveTREMOLO: LocalNotoGlobalNoMap[] has not been correctly initialized for each molecule");
    17331739  }
    17341740
     
    17391745    for (MoleculeList::const_iterator MolWalker = MolList->ListOfMolecules.begin(); MolWalker != MolList->ListOfMolecules.end(); MolWalker++) {
    17401746      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    1741         *output << AtomNo+1 << "\t";
     1747        *output << LocalNotoGlobalNoMap[ (*iter)->getId() ] << "\t";
    17421748        *output << (*iter)->getName() << "\t";
    17431749        *output << (*MolWalker)->name << "\t";
     
    17471753        *output << (*iter)->type->symbol << "\t";
    17481754        for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)
    1749           *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(*iter)->nr ]+1 << "\t";
     1755          *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ] << "\t";
    17501756        for(int i=(*iter)->ListOfBonds.size(); i < MaxNeighbours; i++)
    17511757          *output << "-\t";
     
    17621768  delete(output);
    17631769  delete(fname);
    1764   for(size_t i=0;i<MolList->ListOfMolecules.size(); i++)
    1765     Free(&LocalNotoGlobalNoMap[i]);
    1766   Free(&LocalNotoGlobalNoMap);
    17671770
    17681771  return true;
     
    17921795  if (output == NULL)
    17931796    strcpy(filename,"main_pcp_linux");
    1794   Log() << Verbose(0) << "Saving as pdb input ";
     1797  Log() << Verbose(0) << "Saving as pdb input ... " << endl;
    17951798  if (SavePDB(filename, molecules))
    1796     Log() << Verbose(0) << "done." << endl;
     1799    Log() << Verbose(0) << "\t... done." << endl;
    17971800  else
    1798     Log() << Verbose(0) << "failed." << endl;
     1801    Log() << Verbose(0) << "\t... failed." << endl;
    17991802
    18001803  // then save as tremolo data file
     
    18031806  if (output == NULL)
    18041807    strcpy(filename,"main_pcp_linux");
    1805   Log() << Verbose(0) << "Saving as tremolo data input ";
     1808  Log() << Verbose(0) << "Saving as tremolo data input ... " << endl;
    18061809  if (SaveTREMOLO(filename, molecules))
    1807     Log() << Verbose(0) << "done." << endl;
     1810    Log() << Verbose(0) << "\t... done." << endl;
    18081811  else
    1809     Log() << Verbose(0) << "failed." << endl;
     1812    Log() << Verbose(0) << "\t... failed." << endl;
    18101813
    18111814  // translate each to its center and merge all molecules in MoleculeListClass into this molecule
     
    18431846  output.close();
    18441847  output.clear();
    1845   Log() << Verbose(0) << "Saving of config file ";
     1848  Log() << Verbose(0) << "Saving of config file ... " << endl;
    18461849  if (Save(filename, periode, mol))
    1847     Log() << Verbose(0) << "successful." << endl;
     1850    Log() << Verbose(0) << "\t... successful." << endl;
    18481851  else
    1849     Log() << Verbose(0) << "failed." << endl;
     1852    Log() << Verbose(0) << "\t... failed." << endl;
    18501853
    18511854  // and save to xyz file
     
    18601863    output.open(filename, ios::trunc);
    18611864  }
    1862   Log() << Verbose(0) << "Saving of XYZ file ";
     1865  Log() << Verbose(0) << "Saving of XYZ file ... " << endl;
    18631866  if (mol->MDSteps <= 1) {
    18641867    if (mol->OutputXYZ(&output))
    1865       Log() << Verbose(0) << "successful." << endl;
     1868      Log() << Verbose(0) << "\t... successful." << endl;
    18661869    else
    1867       Log() << Verbose(0) << "failed." << endl;
     1870      Log() << Verbose(0) << "\t... failed." << endl;
    18681871  } else {
    18691872    if (mol->OutputTrajectoriesXYZ(&output))
    1870       Log() << Verbose(0) << "successful." << endl;
     1873      Log() << Verbose(0) << "\t... successful." << endl;
    18711874    else
    1872       Log() << Verbose(0) << "failed." << endl;
     1875      Log() << Verbose(0) << "\t... failed." << endl;
    18731876  }
    18741877  output.close();
     
    18801883  if (output == NULL)
    18811884    strcpy(filename,"main_pcp_linux");
    1882   Log() << Verbose(0) << "Saving as mpqc input ";
     1885  Log() << Verbose(0) << "Saving as mpqc input .. " << endl;
    18831886  if (SaveMPQC(filename, mol))
    1884     Log() << Verbose(0) << "done." << endl;
     1887    Log() << Verbose(0) << "\t... done." << endl;
    18851888  else
    1886     Log() << Verbose(0) << "failed." << endl;
     1889    Log() << Verbose(0) << "\t... failed." << endl;
    18871890
    18881891  if (!strcmp(configpath, GetDefaultPath())) {
     
    19221925  char *dummy1 = NULL;
    19231926  char *dummy = NULL;
    1924   char * const free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy");    // pointers in the line that is read in per step
     1927  char free_dummy[MAXSTRINGSIZE];    // pointers in the line that is read in per step
    19251928  dummy1 = free_dummy;
    19261929
     
    19381941      if (file->eof()) {
    19391942        if ((critical) && (found == 0)) {
    1940           Free(free_dummy);
    19411943          //Error(InitReading, name);
    19421944          fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
     
    19461948          file->clear();
    19471949          file->seekg(file_position, ios::beg);  // rewind to start position
    1948           Free(free_dummy);
    19491950          return 0;
    19501951        }
     
    19771978        dummy = strchr(dummy1, '\n'); // set on line end then (whole line = keyword)
    19781979        //fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name);
    1979         //Free((void **)&free_dummy);
    19801980        //Error(FileOpenParams, NULL);
    19811981      } else {
     
    19981998              if (file->eof()) {
    19991999                if ((critical) && (found == 0)) {
    2000                   Free(free_dummy);
    20012000                  //Error(InitReading, name);
    20022001                  fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
     
    20062005                  file->clear();
    20072006                  file->seekg(file_position, ios::beg);  // rewind to start position
    2008                   Free(free_dummy);
    20092007                  return 0;
    20102008                }
     
    20472045                  if (critical) {
    20482046                    if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
    2049                     Free(free_dummy);
    20502047                    //return 0;
    20512048                    exit(255);
     
    20552052                    file->clear();
    20562053                    file->seekg(file_position, ios::beg);  // rewind to start position
    2057                     Free(free_dummy);
    20582054                    return 0;
    20592055                  }
     
    20682064                  file->seekg(file_position, ios::beg);  // rewind to start position
    20692065                }
    2070                 Free(free_dummy);
    20712066                return 0;
    20722067              }
     
    21242119  if ((type >= row_int) && (verbose))
    21252120    fprintf(stderr,"\n");
    2126   Free(free_dummy);
    21272121  if (!sequential) {
    21282122    file->clear();
     
    22052199        dummy = strchr(dummy1, '\n'); // set on line end then (whole line = keyword)
    22062200        //fprintf(stderr,"Error: Cannot find tabs or spaces on line %i in search for %s\n", line, name);
    2207         //Free(&free_dummy);
    22082201        //Error(FileOpenParams, NULL);
    22092202      } else {
  • src/elements.db

    • Property mode changed from 100755 to 100644
    ra7b761b r1024cb  
    22#Element        Name    Symbol  Period  Group   Block   Atomic  Number  AtomicWeight    Covalent        Radius  vdW     Radius
    33Hydrogen        H       1       1       s       1       1.008   0.23    1.09
    4 Helium  He      1       18      p       2       4.003   1.50    1.40
     4Helium  He      1       18      p       2       4.003   1.5     1.4
    55Lithium Li      2       1       s       3       6.941   0.68    1.82
    6 Beryllium       Be      2       2       s       4       9.012   0.35    2.00
    7 Boron   B       2       13      p       5       10.811  0.83    2.00
    8 Carbon  C       2       14      p       6       12.011  0.68    1.70
     6Beryllium       Be      2       2       s       4       9.012   0.35    2
     7Boron   B       2       13      p       5       10.811  0.83    2
     8Carbon  C       2       14      p       6       12.011  0.68    1.7
    99Nitrogen        N       2       15      p       7       14.007  0.68    1.55
    1010Oxygen  O       2       16      p       8       15.999  0.68    1.52
    1111Fluorine        F       2       17      p       9       18.998  0.64    1.47
    12 Neon    Ne      2       18      p       10      20.180  1.50    1.54
     12Neon    Ne      2       18      p       10      20.18   1.5     1.54
    1313Sodium  Na      3       1       s       11      22.991  0.97    2.27
    14 Magnesium       Mg      3       2       s       12      24.305  1.10    1.73
    15 Aluminium       Al      3       13      p       13      26.982  1.35    2.00
    16 Silicon Si      3       14      p       14      28.086  1.20    2.10
    17 Phosphorus      P       3       15      p       15      30.974  1.05    1.80
    18 Sulphur S       3       16      p       16      32.066  1.02    1.80
     14Magnesium       Mg      3       2       s       12      24.305  1.1     1.73
     15Aluminium       Al      3       13      p       13      26.982  1.35    2
     16Silicon Si      3       14      p       14      28.086  1.2     2.1
     17Phosphorus      P       3       15      p       15      30.974  1.05    1.8
     18Sulphur S       3       16      p       16      32.066  1.02    1.8
    1919Chlorine        Cl      3       17      p       17      35.453  0.99    1.75
    2020Argon   Ar      3       18      p       18      39.948  1.51    1.88
    2121Potassium       K       4       1       s       19      39.098  1.33    2.75
    22 Calcium Ca      4       2       s       20      40.078  0.99    2.00
    23 Scandium        Sc      4       3       d       21      44.956  1.44    2.00
    24 Titanium        Ti      4       4       d       22      47.867  1.47    2.00
    25 Vanadium        V       4       5       d       23      50.942  1.33    2.00
    26 Chromium        Cr      4       6       d       24      51.996  1.35    2.00
    27 Manganese       Mn      4       7       d       25      54.938  1.35    2.00
    28 Iron    Fe      4       8       d       26      55.845  1.34    2.00
    29 Cobalt  Co      4       9       d       27      58.933  1.33    2.00
    30 Nickel  Ni      4       10      d       28      58.693  1.50    1.63
    31 Copper  Cu      4       11      d       29      63.546  1.52    1.40
    32 Zinc    Zn      4       12      d       30      65.390  1.45    1.39
     22Calcium Ca      4       2       s       20      40.078  0.99    2
     23Scandium        Sc      4       3       d       21      44.956  1.44    2
     24Titanium        Ti      4       4       d       22      47.867  1.47    2
     25Vanadium        V       4       5       d       23      50.942  1.33    2
     26Chromium        Cr      4       6       d       24      51.996  1.35    2
     27Manganese       Mn      4       7       d       25      54.938  1.35    2
     28Iron    Fe      4       8       d       26      55.845  1.34    2
     29Cobalt  Co      4       9       d       27      58.933  1.33    2
     30Nickel  Ni      4       10      d       28      58.693  1.5     1.63
     31Copper  Cu      4       11      d       29      63.546  1.52    1.4
     32Zinc    Zn      4       12      d       30      65.39   1.45    1.39
    3333Gallium Ga      4       13      p       31      69.723  1.22    1.87
    34 Germanium       Ge      4       14      p       32      72.610  1.17    2.00
     34Germanium       Ge      4       14      p       32      72.61   1.17    2
    3535Arsenic As      4       15      p       33      74.922  1.21    1.85
    36 Selenium        Se      4       16      p       34      78.960  1.22    1.90
     36Selenium        Se      4       16      p       34      78.96   1.22    1.9
    3737Bromine Br      4       17      p       35      79.904  1.21    1.85
    38 Krypton Kr      4       18      p       36      83.800  1.50    2.02
    39 Rubidium        Rb      5       1       s       37      85.468  1.47    2.00
    40 Strontium       Sr      5       2       s       38      87.620  1.12    2.00
    41 Yttrium Y       5       3       d       39      88.906  1.78    2.00
    42 Zirconium       Zr      5       4       d       40      91.224  1.56    2.00
    43 Niobium Nb      5       5       d       41      92.906  1.48    2.00
    44 Molybdenum      Mo      5       6       d       42      95.940  1.47    2.00
    45 Technetium      Tc      5       7       d       43      98      1.35    2.00
    46 Ruthenium       Ru      5       8       d       44      101.070 1.40    2.00
    47 Rhodium Rh      5       9       d       45      102.906 1.45    2.00
    48 Palladium       Pd      5       10      d       46      106.420 1.50    1.63
     38Krypton Kr      4       18      p       36      83.8    1.5     2.02
     39Rubidium        Rb      5       1       s       37      85.468  1.47    2
     40Strontium       Sr      5       2       s       38      87.62   1.12    2
     41Yttrium Y       5       3       d       39      88.906  1.78    2
     42Zirconium       Zr      5       4       d       40      91.224  1.56    2
     43Niobium Nb      5       5       d       41      92.906  1.48    2
     44Molybdenum      Mo      5       6       d       42      95.94   1.47    2
     45Technetium      Tc      5       7       d       43      98      1.35    2
     46Ruthenium       Ru      5       8       d       44      101.07  1.4     2
     47Rhodium Rh      5       9       d       45      102.906 1.45    2
     48Palladium       Pd      5       10      d       46      106.42  1.5     1.63
    4949Silver  Ag      5       11      d       47      107.868 1.59    1.72
    5050Cadmium Cd      5       12      d       48      112.411 1.69    1.58
    5151Indium  In      5       13      p       49      114.818 1.63    1.93
    5252Tin     Sn      5       14      p       50      118.71  1.46    2.17
    53 Antimony        Sb      5       15      p       51      121.760 1.46    2.00
    54 Tellurium       Te      5       16      p       52      127.600 1.47    2.06
    55 Iodine  I       5       17      p       53      126.904 1.40    1.98
    56 Xenon   Xe      5       18      p       54      131.290 1.50    2.16
    57 Caesium Cs      6       1       s       55      132.905 1.67    2.00
    58 Barium  Ba      6       2       s       56      137.327 1.34    2.00
    59 Lutetium        Lu      6       3       d       71      174.967 1.72    2.00
    60 Hafnium Hf      6       4       d       72      178.490 1.57    2.00
    61 Tantalum        Ta      6       5       d       73      180.948 1.43    2.00
    62 Tungsten        W       6       6       d       74      183.840 1.37    2.00
    63 Rhenium Re      6       7       d       75      186.207 1.35    2.00
    64 Osmium  Os      6       8       d       76      190.230 1.37    2.00
    65 Iridium Ir      6       9       d       77      192.217 1.32    2.00
    66 Platinum        Pt      6       10      d       78      195.078 1.50    1.72
    67 Gold    Au      6       11      d       79      196.967 1.50    1.66
    68 Mercury Hg      6       12      d       80      200.590 1.70    1.55
     53Antimony        Sb      5       15      p       51      121.76  1.46    2
     54Tellurium       Te      5       16      p       52      127.6   1.47    2.06
     55Iodine  I       5       17      p       53      126.904 1.4     1.98
     56Xenon   Xe      5       18      p       54      131.29  1.5     2.16
     57Caesium Cs      6       1       s       55      132.905 1.67    2
     58Barium  Ba      6       2       s       56      137.327 1.34    2
     59Lanthanum       La      6Lan    19      f       57      138.906 1.87    2
     60Cerium  Ce      6Lan    19      f       58      140.116 1.83    2
     61Praseodymium    Pr      6Lan    19      f       59      140.908 1.82    2
     62Neodymium       Nd      6Lan    19      f       60      144.24  1.81    2
     63Promethium      Pm      6Lan    19      f       61      145     1.8     2
     64Samarium        Sm      6Lan    19      f       62      150.36  1.8     2
     65Europium        Eu      6Lan    19      f       63      151.964 1.99    2
     66Gadolinium      Gd      6Lan    19      f       64      157.25  1.79    2
     67Terbium Tb      6Lan    19      f       65      158.925 1.76    2
     68Dysprosium      Dy      6Lan    19      f       66      162.5   1.75    2
     69Holmium Ho      6Lan    19      f       67      164.93  1.74    2
     70Erbium  Er      6Lan    19      f       68      167.26  1.73    2
     71Thulium Tm      6Lan    19      f       69      168.934 1.72    2
     72Ytterbium       Yb      6Lan    19      f       70      173.04  1.94    2
     73Lutetium        Lu      6       3       d       71      174.967 1.72    2
     74Hafnium Hf      6       4       d       72      178.49  1.57    2
     75Tantalum        Ta      6       5       d       73      180.948 1.43    2
     76Tungsten        W       6       6       d       74      183.84  1.37    2
     77Rhenium Re      6       7       d       75      186.207 1.35    2
     78Osmium  Os      6       8       d       76      190.23  1.37    2
     79Iridium Ir      6       9       d       77      192.217 1.32    2
     80Platinum        Pt      6       10      d       78      195.078 1.5     1.72
     81Gold    Au      6       11      d       79      196.967 1.5     1.66
     82Mercury Hg      6       12      d       80      200.59  1.7     1.55
    6983Thallium        Tl      6       13      p       81      204.383 1.55    1.96
    70 Lead    Pb      6       14      p       82      207.200 1.54    2.02
    71 Bismuth Bi      6       15      p       83      208.980 1.54    2.00
    72 Polonium        Po      6       16      p       84      210     1.68    2.00
    73 Astatine        At      6       17      p       85      210     1.21    2.00
    74 Radon   Rn      6       18      p       86      222     1.50    2.00
    75 Cerium  Ce      6Lan    19      f       58      140.116 1.83    2.00
    76 Dysprosium      Dy      6Lan    19      f       66      162.500 1.75    2.00
    77 Erbium  Er      6Lan    19      f       68      167.260 1.73    2.00
    78 Europium        Eu      6Lan    19      f       63      151.964 1.99    2.00
    79 Gadolinium      Gd      6Lan    19      f       64      157.250 1.79    2.00
    80 Holmium Ho      6Lan    19      f       67      164.930 1.74    2.00
    81 Lanthanum       La      6Lan    19      f       57      138.906 1.87    2.00
    82 Neodymium       Nd      6Lan    19      f       60      144.240 1.81    2.00
    83 Promethium      Pm      6Lan    19      f       61      145     1.80    2.00
    84 Praseodymium    Pr      6Lan    19      f       59      140.908 1.82    2.00
    85 Samarium        Sm      6Lan    19      f       62      150.360 1.80    2.00
    86 Terbium Tb      6Lan    19      f       65      158.925 1.76    2.00
    87 Thulium Tm      6Lan    19      f       69      168.934 1.72    2.00
    88 Ytterbium       Yb      6Lan    19      f       70      173.040 1.94    2.00
    89 Francium        Fr      7       1       s       87      223     1.50    2.00
    90 Radium  Ra      7       2       s       88      226     1.90    2.00
    91 Lawrencium      Lr      7       3       d       103     262     1.50    2.00
    92 Rutherfordium   Rf      7       4       d       104     261     1.50    2.00
    93 Dubnium Db      7       5       d       105     262     1.50    2.00
    94 Seaborgium      Sg      7       6       d       106     266     1.50    2.00
    95 Bohrium Bh      7       7       d       107     264     1.50    2.00
    96 Hassium Hs      7       8       d       108     269     1.50    2.00
    97 Meitnerium      Mt      7       9       d       109     268     1.50    2.00
    98 Darmstadtium    Ds      7       10      d       110     271     1.50    2.00
    99 Actinium        Ac      7Act    20      f       89      227     1.88    2.00
    100 Americium       Am      7Act    20      f       95      243     1.51    2.00
    101 Berkelium       Bk      7Act    20      f       97      247     1.54    2.00
    102 Californium     Cf      7Act    20      f       98      251     1.83    2.00
    103 Curium  Cm      7Act    20      f       96      247     0.99    2.00
    104 Einsteinium     Es      7Act    20      f       99      252     1.50    2.00
    105 Fermium Fm      7Act    20      f       100     257     1.50    2.00
    106 Mendelevium     Md      7Act    20      f       101     258     1.50    2.00
    107 Nobelium        No      7Act    20      f       102     259     1.50    2.00
    108 Neptunium       Np      7Act    20      f       93      237     1.55    2.00
    109 Protactinium    Pa      7Act    20      f       91      231.036 1.61    2.00
    110 Plutonium       Pu      7Act    20      f       94      244     1.53    2.00
    111 Thorium Th      7Act    20      f       90      232.038 1.79    2.00
     84Lead    Pb      6       14      p       82      207.2   1.54    2.02
     85Bismuth Bi      6       15      p       83      208.98  1.54    2
     86Polonium        Po      6       16      p       84      210     1.68    2
     87Astatine        At      6       17      p       85      210     1.21    2
     88Radon   Rn      6       18      p       86      222     1.5     2
     89Francium        Fr      7       1       s       87      223     1.5     2
     90Radium  Ra      7       2       s       88      226     1.9     2
     91Actinium        Ac      7Act    20      f       89      227     1.88    2
     92Thorium Th      7Act    20      f       90      232.038 1.79    2
     93Protactinium    Pa      7Act    20      f       91      231.036 1.61    2
    11294Uranium U       7Act    20      f       92      238.029 1.58    1.86
     95Neptunium       Np      7Act    20      f       93      237     1.55    2
     96Plutonium       Pu      7Act    20      f       94      244     1.53    2
     97Americium       Am      7Act    20      f       95      243     1.51    2
     98Curium  Cm      7Act    20      f       96      247     0.99    2
     99Berkelium       Bk      7Act    20      f       97      247     1.54    2
     100Californium     Cf      7Act    20      f       98      251     1.83    2
     101Einsteinium     Es      7Act    20      f       99      252     1.5     2
     102Fermium Fm      7Act    20      f       100     257     1.5     2
     103Mendelevium     Md      7Act    20      f       101     258     1.5     2
     104Nobelium        No      7Act    20      f       102     259     1.5     2
     105Lawrencium      Lr      7       3       d       103     262     1.5     2
     106Rutherfordium   Rf      7       4       d       104     261     1.5     2
     107Dubnium Db      7       5       d       105     262     1.5     2
     108Seaborgium      Sg      7       6       d       106     266     1.5     2
     109Bohrium Bh      7       7       d       107     264     1.5     2
     110Hassium Hs      7       8       d       108     269     1.5     2
     111Meitnerium      Mt      7       9       d       109     268     1.5     2
     112Darmstadtium    Ds      7       10      d       110     271     1.5     2
  • src/helpers.cpp

    ra7b761b r1024cb  
    5858int CountLinesinFile(ifstream &InputFile)
    5959{
    60   char *buffer = Malloc<char>(MAXSTRINGSIZE, "CountLinesinFile: *buffer");
     60  char *buffer = new char[MAXSTRINGSIZE];
    6161  int lines=0;
    6262
     
    7070  }
    7171  InputFile.seekg(PositionMarker, ios::beg);
    72   Free(&buffer);
     72  delete[](buffer);
    7373  return lines;
    7474};
     
    9090  }
    9191  // allocate string
    92   returnstring = Malloc<char>(order + 2, "FixedDigitNumber: *returnstring");
     92  returnstring = new char[order + 2];
    9393  // terminate  and fill string array from end backward
    9494  returnstring[order] = '\0';
     
    122122double * ReturnFullMatrixforSymmetric(const double * const symm)
    123123{
    124   double *matrix = Malloc<double>(NDIM * NDIM, "molecule::ReturnFullMatrixforSymmetric: *matrix");
     124  double *matrix = new double[NDIM * NDIM];
    125125  matrix[0] = symm[0];
    126126  matrix[1] = symm[1];
     
    140140double * InverseMatrix( const double * const A)
    141141{
    142   double *B = Malloc<double>(NDIM * NDIM, "Vector::InverseMatrix: *B");
     142  double *B = new double[NDIM * NDIM];
    143143  double detA = RDET3(A);
    144144  double detAReci;
     
    180180
    181181
    182 /** Allocates a memory range using malloc().
    183  * Prints the provided error message in case of a failure.
    184  *
    185  * \param number of memory slices of type X to allocate
    186  * \param failure message which is printed if the allocation fails
    187  * \return pointer to the allocated memory range, will be NULL if a failure occurred
    188  */
    189 template <> char* Malloc<char>(size_t size, const char* output)
    190 {
    191   char* buffer = NULL;
    192   buffer = (char*) malloc(sizeof(char) * (size + 1));
    193   for (size_t i = size; i--;)
    194     buffer[i] = (i % 2 == 0) ? 'p': 'c';
    195   buffer[size] = '\0';
    196 
    197   if (buffer != NULL) {
    198     MemoryUsageObserver::getInstance()->addMemory(buffer, size);
    199   } else {
    200     Log() << Verbose(0) << "Malloc for datatype " << typeid(char).name()
    201       << " failed - pointer is NULL: " << output << endl;
    202   }
    203 
    204   return buffer;
    205 };
    206 
    207182/**
    208  * Frees all memory registered by the memory observer and calls exit(225) afterwards.
     183 * Calls exit(255).
    209184 */
    210185void performCriticalExit() {
    211   map<void*, size_t> pointers = MemoryUsageObserver::getInstance()->getPointersToAllocatedMemory();
    212   for (map<void*, size_t>::iterator runner = pointers.begin(); runner != pointers.end(); runner++) {
    213     Free(((void**) &runner->first));
    214   }
    215 
    216186  exit(255);
    217187}
  • src/helpers.hpp

    ra7b761b r1024cb  
    8383};
    8484
     85/** Creates a lookup table for true father's Atom::Nr -> atom ptr.
     86 * \param *start begin of chain list
     87 * \paran *end end of chain list
     88 * \param **Lookuptable pointer to return allocated lookup table (should be NULL on start)
     89 * \param count optional predetermined size for table (otherwise we set the count to highest true father id)
     90 * \return true - success, false - failure
     91 */
     92template <typename T> bool CreateFatherLookupTable(T *start, T *end, T **&LookupTable, int count = 0)
     93{
     94  bool status = true;
     95  T *Walker = NULL;
     96  int AtomNo;
     97
     98  if (LookupTable != NULL) {
     99    DoLog(0) && (Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl);
     100    return false;
     101  }
     102
     103  // count them
     104  if (count == 0) {
     105    Walker = start;
     106    while (Walker->next != end) { // create a lookup table (Atom::nr -> atom) used as a marker table lateron
     107      Walker = Walker->next;
     108      count = (count < Walker->GetTrueFather()->nr) ? Walker->GetTrueFather()->nr : count;
     109    }
     110  }
     111  if (count <= 0) {
     112    DoLog(0) && (Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl);
     113    return false;
     114  }
     115
     116  // allocate and fill
     117  LookupTable = new T*[count];
     118  if (LookupTable == NULL) {
     119    DoeLog(0) && (eLog()<< Verbose(0) << "LookupTable memory allocation failed!" << endl);
     120    performCriticalExit();
     121    status = false;
     122  } else {
     123    Walker = start;
     124    while (Walker->next != end) { // create a lookup table (Atom::nr -> atom) used as a marker table lateron
     125      Walker = Walker->next;
     126      AtomNo = Walker->GetTrueFather()->nr;
     127      if ((AtomNo >= 0) && (AtomNo < count)) {
     128        //*out << "Setting LookupTable[" << AtomNo << "] to " << *Walker << endl;
     129        LookupTable[AtomNo] = Walker;
     130      } else {
     131        DoLog(0) && (Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl);
     132        status = false;
     133        break;
     134      }
     135    }
     136  }
     137
     138  return status;
     139};
     140
     141
    85142/** Frees a two-dimensional array.
    86143 * \param *ptr pointer to array
  • src/joiner.cpp

    ra7b761b r1024cb  
    5858    return 1;
    5959  } else {
    60     dir = Malloc<char>(strlen(argv[2]) + 2, "main: *dir");
     60    dir = new char[strlen(argv[2]) + 2];
    6161    strcpy(dir, "/");
    6262    strcat(dir, argv[2]);
     
    243243  // exit
    244244  delete(periode);
    245   Free(&dir);
     245  delete[](dir);
    246246  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    247247  return 0;
  • src/molecule.cpp

    ra7b761b r1024cb  
    293293    Orthovector1.MatrixMultiplication(matrix);
    294294    InBondvector -= Orthovector1; // subtract just the additional translation
    295     Free(&matrix);
     295    delete[](matrix);
    296296    bondlength = InBondvector.Norm();
    297297//    Log() << Verbose(4) << "Corrected InBondvector is now: ";
     
    302302  InBondvector.Normalize();
    303303  // get typical bond length and store as scale factor for later
     304  ASSERT(TopOrigin->type != NULL, "AddHydrogenReplacementAtom: element of TopOrigin is not given.");
    304305  BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1];
    305306  if (BondRescale == -1) {
     
    523524      break;
    524525  }
    525   Free(&matrix);
     526  delete[](matrix);
    526527
    527528//  Log() << Verbose(3) << "End of AddHydrogenReplacementAtom." << endl;
     
    10791080  if (result) {
    10801081    DoLog(5) && (Log() << Verbose(5) << "Calculating distances" << endl);
    1081     Distances = Calloc<double>(getAtomCount(), "molecule::IsEqualToWithinThreshold: Distances");
    1082     OtherDistances = Calloc<double>(getAtomCount(), "molecule::IsEqualToWithinThreshold: OtherDistances");
     1082    Distances = new double[getAtomCount()];
     1083    OtherDistances = new double[getAtomCount()];
    10831084    SetIndexedArrayForEachAtomTo ( Distances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
    10841085    SetIndexedArrayForEachAtomTo ( OtherDistances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
     1086    for(int i=0;i<getAtomCount();i++) {
     1087      Distances[i] = 0.;
     1088      OtherDistances[i] = 0.;
     1089    }
    10851090
    10861091    /// ... sort each list (using heapsort (o(N log N)) from GSL)
    10871092    DoLog(5) && (Log() << Verbose(5) << "Sorting distances" << endl);
    1088     PermMap = Calloc<size_t>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *PermMap");
    1089     OtherPermMap = Calloc<size_t>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *OtherPermMap");
     1093    PermMap = new size_t[getAtomCount()];
     1094    OtherPermMap = new size_t[getAtomCount()];
     1095    for(int i=0;i<getAtomCount();i++) {
     1096      PermMap[i] = 0;
     1097      OtherPermMap[i] = 0;
     1098    }
    10901099    gsl_heapsort_index (PermMap, Distances, getAtomCount(), sizeof(double), CompareDoubles);
    10911100    gsl_heapsort_index (OtherPermMap, OtherDistances, getAtomCount(), sizeof(double), CompareDoubles);
    1092     PermutationMap = Calloc<int>(getAtomCount(), "molecule::IsEqualToWithinThreshold: *PermutationMap");
     1101    PermutationMap = new int[getAtomCount()];
     1102    for(int i=0;i<getAtomCount();i++)
     1103      PermutationMap[i] = 0;
    10931104    DoLog(5) && (Log() << Verbose(5) << "Combining Permutation Maps" << endl);
    10941105    for(int i=getAtomCount();i--;)
     
    11051116
    11061117    // free memory
    1107     Free(&PermMap);
    1108     Free(&OtherPermMap);
    1109     Free(&Distances);
    1110     Free(&OtherDistances);
     1118    delete[](PermMap);
     1119    delete[](OtherPermMap);
     1120    delete[](Distances);
     1121    delete[](OtherDistances);
    11111122    if (flag) { // if not equal
    1112       Free(&PermutationMap);
     1123      delete[](PermutationMap);
    11131124      result = false;
    11141125    }
     
    11351146{
    11361147  DoLog(3) && (Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl);
    1137   int *AtomicMap = Malloc<int>(getAtomCount(), "molecule::GetAtomicMap: *AtomicMap");
     1148  int *AtomicMap = new int[getAtomCount()];
    11381149  for (int i=getAtomCount();i--;)
    11391150    AtomicMap[i] = -1;
     
    11501161        for (molecule::const_iterator runner = OtherMolecule->begin(); runner != OtherMolecule->end(); ++runner) {
    11511162      //for (int i=0;i<AtomCount;i++) { // search atom
    1152         //for (int j=0;j<OtherMolecule->AtomCount;j++) {
     1163        //for (int j=0;j<OtherMolecule->getAtomCount();j++) {
    11531164          //Log() << Verbose(4) << "Comparing father " << (*iter)->father << " with the other one " << (*runner)->father << "." << endl;
    11541165          if ((*iter)->father == (*runner))
  • src/molecule.hpp

    ra7b761b r1024cb  
    3636#include "Patterns/ObservedIterator.hpp"
    3737#include "Patterns/Cacheable.hpp"
     38
     39#include "Descriptors/MoleculeDescriptor_impl.hpp"
    3840
    3941/****************************************** forward declarations *****************************/
     
    273275  Vector * DetermineCenterOfGravity();
    274276  Vector * DetermineCenterOfAll() const;
     277  Vector * DetermineCenterOfBox() const;
    275278  void SetNameFromFilename(const char *filename);
    276279  void SetBoxDimension(Vector *dim);
  • src/molecule_dynamics.cpp

    ra7b761b r1024cb  
    1010#include "config.hpp"
    1111#include "element.hpp"
     12#include "info.hpp"
    1213#include "log.hpp"
    1314#include "memoryallocator.hpp"
     
    183184{
    184185  stringstream zeile1, zeile2;
    185   int *DoubleList = Calloc<int>(AtomCount, "PrintPermutationMap: *DoubleList");
     186  int *DoubleList = new int[AtomCount];
     187  for(int i=0;i<AtomCount;i++)
     188    DoubleList[i] = 0;
    186189  int doubles = 0;
    187190  zeile1 << "PermutationMap: ";
     
    197200  if (doubles >0)
    198201    DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl);
    199   Free(&DoubleList);
     202  delete[](DoubleList);
    200203//  Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl;
    201204};
     
    329332  double Potential, OldPotential, OlderPotential;
    330333  struct EvaluatePotential Params;
    331   Params.PermutationMap = Calloc<atom*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**PermutationMap");
    332   Params.DistanceList = Malloc<DistanceMap*>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.**DistanceList");
    333   Params.DistanceIterators = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DistanceIterators");
    334   Params.DoubleList = Calloc<int>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*DoubleList");
    335   Params.StepList = Malloc<DistanceMap::iterator>(getAtomCount(), "molecule::MinimiseConstrainedPotential: Params.*StepList");
     334  Params.PermutationMap = new atom *[getAtomCount()];
     335  Params.DistanceList = new DistanceMap *[getAtomCount()];
     336  Params.DistanceIterators = new DistanceMap::iterator[getAtomCount()];
     337  Params.DoubleList = new int[getAtomCount()];
     338  Params.StepList = new DistanceMap::iterator[getAtomCount()];
    336339  int round;
    337340  atom *Sprinter = NULL;
    338341  DistanceMap::iterator Rider, Strider;
     342
     343  // set to zero
     344  for (int i=0;i<getAtomCount();i++) {
     345    Params.PermutationMap[i] = NULL;
     346    Params.DoubleList[i] = 0;
     347  }
    339348
    340349  /// Minimise the potential
     
    353362  DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl);
    354363  MakeInjectivePermutation(this, Params);
    355   Free(&Params.DoubleList);
     364  delete[](Params.DoubleList);
    356365
    357366  // argument minimise the constrained potential in this injective PermutationMap
     
    434443  for (int i=getAtomCount(); i--;)
    435444    Params.DistanceList[i]->clear();
    436   Free(&Params.DistanceList);
    437   Free(&Params.DistanceIterators);
     445  delete[](Params.DistanceList);
     446  delete[](Params.DistanceIterators);
    438447  return ConstrainedPotential(Params);
    439448};
     
    477486    MinimiseConstrainedPotential(PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
    478487  else {
    479     PermutationMap = Malloc<atom *>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     488    PermutationMap = new atom *[getAtomCount()];
    480489    SetIndexedArrayForEachAtomTo( PermutationMap, &atom::nr );
    481490  }
     
    510519
    511520  // store the list to single step files
    512   int *SortIndex = Malloc<int>(getAtomCount(), "molecule::LinearInterpolationBetweenConfiguration: *SortIndex");
     521  int *SortIndex = new int[getAtomCount()];
    513522  for (int i=getAtomCount(); i--; )
    514523    SortIndex[i] = i;
    515524  status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex);
     525  delete[](SortIndex);
    516526
    517527  // free and return
    518   Free(&PermutationMap);
     528  delete[](PermutationMap);
    519529  delete(MoleculePerStep);
    520530  return status;
     
    536546bool molecule::VerletForceIntegration(char *file, config &configuration)
    537547{
     548  Info FunctionInfo(__func__);
    538549  ifstream input(file);
    539550  string token;
     
    576587      ConstrainedPotentialEnergy = MinimiseConstrainedPotential(PermutationMap,configuration.DoConstrainedMD, 0, configuration.GetIsAngstroem());
    577588      EvaluateConstrainedForces(configuration.DoConstrainedMD, 0, PermutationMap, &Force);
    578       Free(&PermutationMap);
     589      delete[](PermutationMap);
    579590    }
    580591
    581592    // and perform Verlet integration for each atom with position, velocity and force vector
    582593    // check size of vectors
    583     ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 );
    584 
    585     ActOnAllAtoms( &atom::VelocityVerletUpdate, MDSteps, &configuration, &Force);
     594    //ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 );
     595
     596    ActOnAllAtoms( &atom::VelocityVerletUpdate, MDSteps+1, &configuration, &Force);
    586597  }
    587598  // correct velocities (rather momenta) so that center of mass remains motionless
    588599  Velocity.Zero();
    589600  IonMass = 0.;
    590   ActOnAllAtoms ( &atom::SumUpKineticEnergy, MDSteps, &IonMass, &Velocity );
     601  ActOnAllAtoms ( &atom::SumUpKineticEnergy, MDSteps+1, &IonMass, &Velocity );
    591602
    592603  // correct velocities (rather momenta) so that center of mass remains motionless
    593604  Velocity.Scale(1./IonMass);
    594605  ActualTemp = 0.;
    595   ActOnAllAtoms ( &atom::CorrectVelocity, &ActualTemp, MDSteps, &Velocity );
     606  ActOnAllAtoms ( &atom::CorrectVelocity, &ActualTemp, MDSteps+1, &Velocity );
    596607  Thermostats(configuration, ActualTemp, Berendsen);
    597608  MDSteps++;
  • src/molecule_fragmentation.cpp

    ra7b761b r1024cb  
    9292  GraphTestPair testGraphInsert;
    9393  int NumberOfFragments = 0;
    94   char *filename = Malloc<char>(MAXSTRINGSIZE, "molecule::ParseKeySetFile - filename");
     94  char filename[MAXSTRINGSIZE];
    9595
    9696  if (FragmentList == NULL) { // check list pointer
     
    104104  if (InputFile != NULL) {
    105105    // each line represents a new fragment
    106     char *buffer = Malloc<char>(MAXSTRINGSIZE, "molecule::ParseKeySetFile - *buffer");
     106    char buffer[MAXSTRINGSIZE];
    107107    // 1. parse keysets and insert into temp. graph
    108108    while (!InputFile.eof()) {
     
    120120    InputFile.close();
    121121    InputFile.clear();
    122     Free(&buffer);
    123122    DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    124123  } else {
     
    127126  }
    128127
    129   Free(&filename);
    130128  return status;
    131129};
     
    146144  int NumberOfFragments = 0;
    147145  double TEFactor;
    148   char *filename = Malloc<char>(MAXSTRINGSIZE, "molecule::ParseTEFactorsFile - filename");
     146  char filename[MAXSTRINGSIZE];
    149147
    150148  if (FragmentList == NULL) { // check list pointer
     
    177175  }
    178176
    179   // free memory
    180   Free(&filename);
    181 
    182177  return status;
    183178};
     
    315310  int No = 0, FragOrder = 0;
    316311  double Value = 0.;
    317   char *buffer = Malloc<char>(MAXSTRINGSIZE, "molecule::CheckOrderAtSite: *buffer");
     312  char buffer[MAXSTRINGSIZE];
    318313  sprintf(buffer, "%s/%s%s.dat", path, FRAGMENTPREFIX, ENERGYPERFRAGMENT);
    319314  ifstream InputFile(buffer, ios::in);
     
    343338    InputFile.clear();
    344339  }
    345   Free(&buffer);
    346340
    347341  return AdaptiveCriteriaList;
     
    470464    MarkUpdateCandidates(AtomMask, *FinalRootCandidates, Order, this);
    471465
    472     Free(&IndexKeySetList);
    473     Free(&AdaptiveCriteriaList);
    474     Free(&FinalRootCandidates);
     466    delete[](IndexKeySetList);
     467    delete[](AdaptiveCriteriaList);
     468    delete[](FinalRootCandidates);
    475469  } else { // global increase of Bond Order
    476470    for(molecule::const_iterator iter = begin(); iter != end(); ++iter) {
     
    511505    return false;
    512506  }
    513   SortIndex = Malloc<int>(getAtomCount(), "molecule::CreateMappingLabelsToConfigSequence: *SortIndex");
     507  SortIndex = new int[getAtomCount()];
    514508  for(int i=getAtomCount();i--;)
    515509    SortIndex[i] = -1;
     
    552546
    553547  // allocate and fill
    554   LookupTable = Calloc<atom *>(count, "CreateFatherLookupTable - **LookupTable");
     548  LookupTable = new atom *[count];
    555549  if (LookupTable == NULL) {
    556550    eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;
     
    558552    status = false;
    559553  } else {
     554    for (int i=0;i<count;i++)
     555      LookupTable[i] = NULL;
    560556    for (molecule::iterator iter = begin(); iter != end(); ++iter) {
    561557      AtomNo = (*iter)->GetTrueFather()->nr;
     
    595591{
    596592  MoleculeListClass *BondFragments = NULL;
    597   int *SortIndex = NULL;
    598593  int *MinimumRingSize = new int[getAtomCount()];
    599594  int FragmentCounter;
     
    628623  // === compare it with adjacency file ===
    629624  FragmentationToDo = FragmentationToDo && CheckAdjacencyFileAgainstMolecule(configuration->configpath, ListOfAtoms);
    630   Free(&ListOfAtoms);
     625  delete[](ListOfAtoms);
    631626
    632627  // ===== 2. perform a DFS analysis to gather info on cyclic structure and a list of disconnected subgraphs =====
     
    646641//    // check the list of local atoms for debugging
    647642//    Log() << Verbose(0) << "ListOfLocalAtoms for this subgraph is:" << endl;
    648 //    for (int i=0;i<AtomCount;i++)
     643//    for (int i=0;i<getAtomCount();i++)
    649644//      if (ListOfLocalAtoms[FragmentCounter][i] == NULL)
    650645//        Log() << Verbose(0) << "\tNULL";
     
    720715    delete(Subgraphs);
    721716  }
    722   Free(&FragmentList);
     717  delete[](FragmentList);
    723718
    724719  // ===== 8b. gather keyset lists (graphs) from all subgraphs and transform into MoleculeListClass =====
     
    738733  if (BondFragments->ListOfMolecules.size() != 0) {
    739734    // create the SortIndex from BFS labels to order in the config file
     735    int *SortIndex = NULL;
    740736    CreateMappingLabelsToConfigSequence(SortIndex);
    741737
     
    752748    StoreKeySetFile(TotalGraph, configuration->configpath);
    753749
    754     // store Adjacency file
    755     char *filename = Malloc<char> (MAXSTRINGSIZE, "molecule::FragmentMolecule - *filename");
    756     strcpy(filename, FRAGMENTPREFIX);
    757     strcat(filename, ADJACENCYFILE);
    758     StoreAdjacencyToFile(configuration->configpath, filename);
    759     Free(&filename);
     750    {
     751      // store Adjacency file
     752      char filename[MAXSTRINGSIZE];
     753      strcpy(filename, FRAGMENTPREFIX);
     754      strcat(filename, ADJACENCYFILE);
     755      StoreAdjacencyToFile(configuration->configpath, filename);
     756    }
    760757
    761758    // store Hydrogen saturation correction file
     
    770767    // free memory for bond part
    771768    DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl);
    772     Free(&FragmentList); // remove bond molecule from memory
    773     Free(&SortIndex);
     769    delete[](SortIndex);
    774770  } else {
    775771    DoLog(1) && (Log() << Verbose(1) << "FragmentList is zero on return, splitting failed." << endl);
     
    816812bool molecule::ParseOrderAtSiteFromFile(char *path)
    817813{
    818   unsigned char *OrderArray = Calloc<unsigned char>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *OrderArray");
    819   bool *MaxArray = Calloc<bool>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *MaxArray");
     814  unsigned char *OrderArray = new unsigned char[getAtomCount()];
     815  bool *MaxArray = new bool[getAtomCount()];
    820816  bool status;
    821817  int AtomNr, value;
    822818  stringstream line;
    823819  ifstream file;
     820
     821  for(int i=0;i<getAtomCount();i++) {
     822    OrderArray[i] = 0;
     823    MaxArray[i] = false;
     824  }
    824825
    825826  DoLog(1) && (Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl);
     
    850851    status = false;
    851852  }
    852   Free(&OrderArray);
    853   Free(&MaxArray);
     853  delete[](OrderArray);
     854  delete[](MaxArray);
    854855
    855856  DoLog(1) && (Log() << Verbose(1) << "End of ParseOrderAtSiteFromFile" << endl);
     
    981982molecule * molecule::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem)
    982983{
    983   atom **SonList = Calloc<atom*>(getAtomCount(), "molecule::StoreFragmentFromStack: **SonList");
     984  atom **SonList = new atom*[getAtomCount()];
    984985  molecule *Leaf = World::getInstance().createMolecule();
     986
     987  for(int i=0;i<getAtomCount();i++)
     988    SonList[i] = NULL;
    985989
    986990//  Log() << Verbose(1) << "Begin of StoreFragmentFromKeyset." << endl;
     
    991995
    992996  //Leaflet->Leaf->ScanForPeriodicCorrection(out);
    993   Free(&SonList);
     997  delete[](SonList);
    994998//  Log() << Verbose(1) << "End of StoreFragmentFromKeyset." << endl;
    995999  return Leaf;
     
    11361140  int bits, TouchedIndex, SubSetDimension, SP, Added;
    11371141  int SpaceLeft;
    1138   int *TouchedList = Malloc<int>(SubOrder + 1, "molecule::SPFragmentGenerator: *TouchedList");
     1142  int *TouchedList = new int[SubOrder + 1];
    11391143  bond **BondsList = NULL;
    11401144  KeySetTestPair TestKeySetInsert;
     
    11761180
    11771181          // then allocate and fill the list
    1178           BondsList = Malloc<bond*>(SubSetDimension, "molecule::SPFragmentGenerator: **BondsList");
     1182          bond *BondsList[SubSetDimension];
    11791183          SubSetDimension = FillBondsList(BondsList, FragmentSearch->BondsPerSPList[2*SP], FragmentSearch->BondsPerSPList[2*SP+1], TouchedList, TouchedIndex);
    11801184
     
    11821186          Log() << Verbose(2+verbosity) << "Calling subset generator " << SP << " away from root " << *FragmentSearch->Root << " with sub set dimension " << SubSetDimension << "." << endl;
    11831187          SPFragmentGenerator(FragmentSearch, SP, BondsList, SubSetDimension, SubOrder-bits);
    1184 
    1185           Free(&BondsList);
    11861188        }
    11871189      } else {
     
    12051207    }
    12061208  }
    1207   Free(&TouchedList);
     1209  delete[](TouchedList);
    12081210  Log() << Verbose(1+verbosity) << "End of SPFragmentGenerator, " << RootDistance << " away from Root " << *FragmentSearch->Root << " and SubOrder is " << SubOrder << "." << endl;
    12091211};
     
    12171219void InitialiseSPList(int Order, struct UniqueFragments &FragmentSearch)
    12181220{
    1219   FragmentSearch.BondsPerSPList = Malloc<bond*>(Order * 2, "molecule::PowerSetGenerator: ***BondsPerSPList");
    1220   FragmentSearch.BondsPerSPCount = Malloc<int>(Order, "molecule::PowerSetGenerator: *BondsPerSPCount");
     1221  FragmentSearch.BondsPerSPList = new bond* [Order * 2];
     1222  FragmentSearch.BondsPerSPCount = new int[Order];
    12211223  for (int i=Order;i--;) {
    12221224    FragmentSearch.BondsPerSPList[2*i] = new bond();    // start node
     
    12361238void FreeSPList(int Order, struct UniqueFragments &FragmentSearch)
    12371239{
    1238   Free(&FragmentSearch.BondsPerSPCount);
     1240  delete[](FragmentSearch.BondsPerSPCount);
    12391241  for (int i=Order;i--;) {
    12401242    delete(FragmentSearch.BondsPerSPList[2*i]);
    12411243    delete(FragmentSearch.BondsPerSPList[2*i+1]);
    12421244  }
    1243   Free(&FragmentSearch.BondsPerSPList);
     1245  delete[](FragmentSearch.BondsPerSPList);
    12441246};
    12451247
     
    14461448
    14471449    // prepare the subset and call the generator
    1448     BondsList = Calloc<bond*>(FragmentSearch.BondsPerSPCount[0], "molecule::PowerSetGenerator: **BondsList");
     1450    bond* BondsList[FragmentSearch.BondsPerSPCount[0]];
     1451    for(int i=0;i<FragmentSearch.BondsPerSPCount[0];i++)
     1452      BondsList[i] = NULL;
    14491453    BondsList[0] = FragmentSearch.BondsPerSPList[0]->next;  // on SP level 0 there's only the root bond
    14501454
    14511455    SPFragmentGenerator(&FragmentSearch, 0, BondsList, FragmentSearch.BondsPerSPCount[0], Order);
    1452 
    1453     Free(&BondsList);
    14541456  } else {
    14551457    DoLog(0) && (Log() << Verbose(0) << "Not enough total number of edges to build " << Order << "-body fragments." << endl);
     
    15591561      }
    15601562    }
    1561     Free(&FragmentLowerOrdersList[RootNr]);
     1563    delete[](FragmentLowerOrdersList[RootNr]);
    15621564    RootNr++;
    15631565  }
    1564   Free(&FragmentLowerOrdersList);
     1566  delete[](FragmentLowerOrdersList);
    15651567};
    15661568
     
    16011603  // FragmentLowerOrdersList is a 2D-array of pointer to MoleculeListClass objects, one dimension represents the ANOVA expansion of a single order (i.e. 5)
    16021604  // with all needed lower orders that are subtracted, the other dimension is the BondOrder (i.e. from 1 to 5)
    1603   NumMoleculesOfOrder = Calloc<int>(UpgradeCount, "molecule::FragmentBOSSANOVA: *NumMoleculesOfOrder");
    1604   FragmentLowerOrdersList = Calloc<Graph**>(UpgradeCount, "molecule::FragmentBOSSANOVA: ***FragmentLowerOrdersList");
     1605  NumMoleculesOfOrder = new int[UpgradeCount];
     1606  FragmentLowerOrdersList = new Graph**[UpgradeCount];
     1607
     1608  for(int i=0;i<UpgradeCount;i++) {
     1609    NumMoleculesOfOrder[i] = 0;
     1610    FragmentLowerOrdersList[i] = NULL;
     1611  }
    16051612
    16061613  // initialise the fragments structure
     
    16081615  FragmentSearch.FragmentSet = new KeySet;
    16091616  FragmentSearch.Root = FindAtom(RootKeyNr);
    1610   FragmentSearch.ShortestPathList = Malloc<int>(getAtomCount(), "molecule::PowerSetGenerator: *ShortestPathList");
     1617  FragmentSearch.ShortestPathList = new int[getAtomCount()];
    16111618  for (int i=getAtomCount();i--;) {
    16121619    FragmentSearch.ShortestPathList[i] = -1;
     
    16421649      // allocate memory for all lower level orders in this 1D-array of ptrs
    16431650      NumLevels = 1 << (Order-1); // (int)pow(2,Order);
    1644       FragmentLowerOrdersList[RootNr] = Calloc<Graph*>(NumLevels, "molecule::FragmentBOSSANOVA: **FragmentLowerOrdersList[]");
     1651      FragmentLowerOrdersList[RootNr] = new Graph*[NumLevels];
     1652      for (int i=0;i<NumLevels;i++)
     1653        FragmentLowerOrdersList[RootNr][i] = NULL;
    16451654
    16461655      // create top order where nothing is reduced
     
    16781687
    16791688  // cleanup FragmentSearch structure
    1680   Free(&FragmentSearch.ShortestPathList);
     1689  delete[](FragmentSearch.ShortestPathList);
    16811690  delete(FragmentSearch.FragmentSet);
    16821691
     
    16911700  CombineAllOrderListIntoOne(FragmentList, FragmentLowerOrdersList, RootStack, this);
    16921701  FreeAllOrdersList(FragmentLowerOrdersList, RootStack, this);
    1693   Free(&NumMoleculesOfOrder);
     1702  delete[](NumMoleculesOfOrder);
    16941703
    16951704  DoLog(0) && (Log() << Verbose(0) << "End of FragmentBOSSANOVA." << endl);
     
    17191728  DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl);
    17201729
    1721   ColorList = Calloc<enum Shading>(getAtomCount(), "molecule::ScanForPeriodicCorrection: *ColorList");
     1730  ColorList = new enum Shading[getAtomCount()];
     1731  for (int i=0;i<getAtomCount();i++)
     1732    ColorList[i] = (enum Shading)0;
    17221733  while (flag) {
    17231734    // remove bonds that are beyond bonddistance
     
    17771788  // free allocated space from ReturnFullMatrixforSymmetric()
    17781789  delete(AtomStack);
    1779   Free(&ColorList);
    1780   Free(&matrix);
     1790  delete[](ColorList);
     1791  delete[](matrix);
    17811792  DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl);
    17821793};
  • src/molecule_geometry.cpp

    ra7b761b r1024cb  
    2727  bool status = true;
    2828  const Vector *Center = DetermineCenterOfAll();
     29  const Vector *CenterBox = DetermineCenterOfBox();
    2930  double * const cell_size = World::getInstance().getDomain();
    3031  double *M = ReturnFullMatrixforSymmetric(cell_size);
     
    3334  // go through all atoms
    3435  ActOnAllVectors( &Vector::SubtractVector, *Center);
     36  ActOnAllVectors( &Vector::SubtractVector, *CenterBox);
    3537  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    3638
    37   Free(&M);
    38   Free(&Minv);
     39  delete[](M);
     40  delete[](Minv);
    3941  delete(Center);
    4042  return status;
     
    5557  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    5658
    57   Free(&M);
    58   Free(&Minv);
     59  delete[](M);
     60  delete[](Minv);
    5961  return status;
    6062};
     
    125127  molecule::const_iterator iter = begin();  // start at first in list
    126128  Vector *a = new Vector();
    127   Vector tmp;
    128129  double Num = 0;
    129130
     
    133134    for (; iter != end(); ++iter) {  // continue with second if present
    134135      Num += 1.;
    135       tmp = (*iter)->x;
    136       (*a) += tmp;
     136      (*a) += (*iter)->x;
    137137    }
    138138    a->Scale(1./Num); // divide through total mass (and sign for direction)
    139139  }
     140  return a;
     141};
     142
     143/** Returns vector pointing to center of the domain.
     144 * \return pointer to center of the domain
     145 */
     146Vector * molecule::DetermineCenterOfBox() const
     147{
     148  Vector *a = new Vector(0.5,0.5,0.5);
     149
     150  const double *cell_size = World::getInstance().getDomain();
     151  double *M = ReturnFullMatrixforSymmetric(cell_size);
     152  a->MatrixMultiplication(M);
     153  delete[](M);
     154
    140155  return a;
    141156};
     
    228243
    229244  // go through all atoms
    230   ActOnAllVectors( &Vector::SubtractVector, *trans);
     245  ActOnAllVectors( &Vector::AddVector, *trans);
    231246  ActOnAllVectors( &Vector::WrapPeriodically, (const double *)M, (const double *)Minv);
    232247
    233   Free(&M);
    234   Free(&Minv);
     248  delete[](M);
     249  delete[](Minv);
    235250};
    236251
     
    300315    }
    301316  } while (!flag);
    302   Free(&matrix);
    303   Free(&inversematrix);
     317  delete[](matrix);
     318  delete[](inversematrix);
    304319
    305320  Center.Scale(1./static_cast<double>(getAtomCount()));
  • src/molecule_graph.cpp

    ra7b761b r1024cb  
    1212#include "element.hpp"
    1313#include "helpers.hpp"
     14#include "info.hpp"
    1415#include "linkedcell.hpp"
    1516#include "lists.hpp"
     
    5657void molecule::CreateAdjacencyListFromDbondFile(ifstream *input)
    5758{
    58 
     59  Info FunctionInfo(__func__);
    5960  // 1 We will parse bonds out of the dbond file created by tremolo.
    6061  int atom1, atom2;
    6162  atom *Walker, *OtherWalker;
    62 
    63   if (!input) {
    64     DoLog(1) && (Log() << Verbose(1) << "Opening silica failed \n");
     63  char line[MAXSTRINGSIZE];
     64
     65  if (input->fail()) {
     66    DoeLog(0) && (eLog() << Verbose(0) << "Opening of bond file failed \n");
     67    performCriticalExit();
    6568  };
    6669
    67   *input >> ws >> atom1;
    68   *input >> ws >> atom2;
    69   DoLog(1) && (Log() << Verbose(1) << "Scanning file\n");
     70  // skip header
     71  input->getline(line,MAXSTRINGSIZE);
     72  DoLog(1) && (Log() << Verbose(1) << "Scanning file ... \n");
    7073  while (!input->eof()) // Check whether we read everything already
    7174  {
    72     *input >> ws >> atom1;
    73     *input >> ws >> atom2;
    74 
     75    input->getline(line,MAXSTRINGSIZE);
     76    stringstream zeile(line);
     77    zeile >> atom1;
     78    zeile >> atom2;
     79
     80    DoLog(2) && (Log() << Verbose(2) << "Looking for atoms " << atom1 << " and " << atom2 << "." << endl);
    7581    if (atom2 < atom1) //Sort indices of atoms in order
    7682      flip(atom1, atom2);
     
    626632{
    627633  BFS.AtomCount = AtomCount;
    628   BFS.PredecessorList = Calloc<atom*> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: **PredecessorList");
    629   BFS.ShortestPathList = Malloc<int> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: *ShortestPathList");
    630   BFS.ColorList = Calloc<enum Shading> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: *ColorList");
     634  BFS.PredecessorList = new atom*[AtomCount];
     635  BFS.ShortestPathList = new int[AtomCount];
     636  BFS.ColorList = new enum Shading[AtomCount];
    631637  BFS.BFSStack = new StackClass<atom *> (AtomCount);
    632638
    633   for (int i = AtomCount; i--;)
     639  for (int i = AtomCount; i--;) {
    634640    BFS.ShortestPathList[i] = -1;
     641    BFS.PredecessorList[i] = 0;
     642  }
    635643};
    636644
     
    641649void FinalizeBFSAccounting(struct BFSAccounting &BFS)
    642650{
    643   Free(&BFS.PredecessorList);
    644   Free(&BFS.ShortestPathList);
    645   Free(&BFS.ColorList);
     651  delete[](BFS.PredecessorList);
     652  delete[](BFS.ShortestPathList);
     653  delete[](BFS.ColorList);
    646654  delete (BFS.BFSStack);
    647655  BFS.AtomCount = 0;
     
    10621070
    10631071  // allocate storage structure
    1064   CurrentBonds = Calloc<int> (8, "molecule::CheckAdjacencyFileAgainstMolecule - CurrentBonds"); // contains parsed bonds of current atom
     1072  CurrentBonds = new int[8]; // contains parsed bonds of current atom
     1073  for(int i=0;i<8;i++)
     1074    CurrentBonds[i] = 0;
    10651075  return true;
    10661076}
     
    10711081  File.close();
    10721082  File.clear();
    1073   Free(&CurrentBonds);
     1083  delete[](CurrentBonds);
    10741084}
    10751085;
     
    11151125  bool status = true;
    11161126  atom *Walker = NULL;
    1117   char *buffer = NULL;
    11181127  int *CurrentBonds = NULL;
    11191128  int NonMatchNumber = 0; // will number of atoms with differing bond structure
     
    11251134  }
    11261135
    1127   buffer = Malloc<char> (MAXSTRINGSIZE, "molecule::CheckAdjacencyFileAgainstMolecule: *buffer");
     1136  char buffer[MAXSTRINGSIZE];
    11281137  // Parse the file line by line and count the bonds
    11291138  while (!File.eof()) {
     
    11431152    }
    11441153  }
    1145   Free(&buffer);
    11461154  CheckAdjacencyFileAgainstMolecule_Finalize(File, CurrentBonds);
    11471155
     
    11971205  BFS.AtomCount = AtomCount;
    11981206  BFS.BondOrder = BondOrder;
    1199   BFS.PredecessorList = Calloc<atom*> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: **PredecessorList");
    1200   BFS.ShortestPathList = Calloc<int> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: *ShortestPathList");
    1201   BFS.ColorList = Malloc<enum Shading> (AtomCount, "molecule::BreadthFirstSearchAdd_Init: *ColorList");
     1207  BFS.PredecessorList = new atom*[AtomCount];
     1208  BFS.ShortestPathList = new int[AtomCount];
     1209  BFS.ColorList = new enum Shading[AtomCount];
    12021210  BFS.BFSStack = new StackClass<atom *> (AtomCount);
    12031211
     
    12081216  // initialise each vertex as white with no predecessor, empty queue, color Root lightgray
    12091217  for (int i = AtomCount; i--;) {
     1218    BFS.PredecessorList[i] = NULL;
    12101219    BFS.ShortestPathList[i] = -1;
    12111220    if ((AddedAtomList != NULL) && (AddedAtomList[i] != NULL)) // mark already present atoms (i.e. Root and maybe others) as visited
     
    12141223      BFS.ColorList[i] = white;
    12151224  }
    1216   //BFS.ShortestPathList[Root->nr] = 0; //is set due to Calloc()
     1225  //BFS.ShortestPathList[Root->nr] = 0; // done by Calloc
    12171226}
    12181227;
     
    12201229void BreadthFirstSearchAdd_Free(struct BFSAccounting &BFS)
    12211230{
    1222   Free(&BFS.PredecessorList);
    1223   Free(&BFS.ShortestPathList);
    1224   Free(&BFS.ColorList);
     1231  delete[](BFS.PredecessorList);
     1232  delete[](BFS.ShortestPathList);
     1233  delete[](BFS.ColorList);
    12251234  delete (BFS.BFSStack);
    12261235  BFS.AtomCount = 0;
     
    13611370{
    13621371  // reset parent list
    1363   ParentList = Calloc<atom*> (AtomCount, "molecule::BuildInducedSubgraph_Init: **ParentList");
     1372  ParentList = new atom*[AtomCount];
     1373  for (int i=0;i<AtomCount;i++)
     1374    ParentList[i] = NULL;
    13641375  DoLog(3) && (Log() << Verbose(3) << "Resetting ParentList." << endl);
    13651376}
     
    13791390void BuildInducedSubgraph_Finalize(atom **&ParentList)
    13801391{
    1381   Free(&ParentList);
     1392  delete[](ParentList);
    13821393}
    13831394;
  • src/moleculelist.cpp

    ra7b761b r1024cb  
    2020#include "memoryallocator.hpp"
    2121#include "periodentafel.hpp"
     22#include "Helpers/Assert.hpp"
     23
    2224#include "Helpers/Assert.hpp"
    2325
     
    416418
    417419  // 0b. allocate memory for constants
    418   FitConstant = Calloc<double**>(3, "MoleculeListClass::AddHydrogenCorrection: ***FitConstant");
     420  FitConstant = new double**[3];
    419421  for (int k = 0; k < 3; k++) {
    420     FitConstant[k] = Calloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **FitConstant[]");
     422    FitConstant[k] = new double*[a];
    421423    for (int i = a; i--;) {
    422       FitConstant[k][i] = Calloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *FitConstant[][]");
     424      FitConstant[k][i] = new double[b];
     425      for (int j = b; j--;) {
     426        FitConstant[k][i][j] = 0.;
     427      }
    423428    }
    424429  }
     
    466471
    467472  // 0d. allocate final correction matrix
    468   correction = Calloc<double*>(a, "MoleculeListClass::AddHydrogenCorrection: **correction");
     473  correction = new double*[a];
    469474  for (int i = a; i--;)
    470     correction[i] = Calloc<double>(b, "MoleculeListClass::AddHydrogenCorrection: *correction[]");
     475    correction[i] = new double[b];
    471476
    472477  // 1a. go through every molecule in the list
     
    516521    FragmentNumber = FixedDigitNumber(ListOfMolecules.size(), (*ListRunner)->IndexNr);
    517522    line += FragmentNumber;
    518     delete (FragmentNumber);
     523    delete[] (FragmentNumber);
    519524    line += HCORRECTIONSUFFIX;
    520525    output.open(line.c_str());
     
    527532    output.close();
    528533  }
     534  for (int i = a; i--;)
     535    delete[](correction[i]);
     536  delete[](correction);
     537
    529538  line = path;
    530539  line.append("/");
     
    541550  for (int k = 0; k < 3; k++) {
    542551    for (int i = a; i--;) {
    543       Free(&FitConstant[k][i]);
    544     }
    545     Free(&FitConstant[k]);
    546   }
    547   Free(&FitConstant);
     552      delete[](FitConstant[k][i]);
     553    }
     554    delete[](FitConstant[k]);
     555  }
     556  delete[](FitConstant);
    548557  DoLog(0) && (Log() << Verbose(0) << "done." << endl);
    549558  return true;
     
    604613 * \param *configuration standard configuration to attach atoms in fragment molecule to.
    605614 * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
    606  * \param DoPeriodic true - call ScanForPeriodicCorrection, false - don't
    607  * \param DoCentering true - call molecule::CenterEdge(), false - don't
    608615 * \return true - success (each file was written), false - something went wrong.
    609616 */
     
    703710    //outputFragment.close();
    704711    //outputFragment.clear();
    705     Free(&FragmentNumber);
     712    delete[](FragmentNumber);
    706713  }
    707714  DoLog(0) && (Log() << Verbose(0) << " done." << endl);
     
    784791  const int MolCount = Subgraphs->next->Count();
    785792  char number[MAXSTRINGSIZE];
    786   molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules");
     793  molecule **molecules = new molecule *[MolCount];
    787794  for (int i=0;i<MolCount;i++) {
    788795    molecules[i] = World::getInstance().createMolecule();
     
    799806  // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
    800807  int FragmentCounter = 0;
    801   int *MolMap = Calloc<int>(mol->getAtomCount(), "config::Load() - *MolMap");
     808  int *MolMap = new int[mol->getAtomCount()];
     809  for (int i=0;i<mol->getAtomCount();i++)
     810    MolMap[i] = 0;
    802811  MoleculeLeafClass *MolecularWalker = Subgraphs;
    803812  while (MolecularWalker->next != NULL) {
     
    840849  }
    841850  delete(MolecularWalker);
    842   Free(&MolMap);
    843   Free(&molecules);
     851  delete[](MolMap);
     852  delete[](molecules);
    844853  DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
    845854};
     
    10691078  if ((FreeList) && (ListOfLocalAtoms != NULL)) {
    10701079    // free the index lookup list
    1071     Free(&ListOfLocalAtoms[FragmentCounter]);
     1080    delete[](ListOfLocalAtoms[FragmentCounter]);
    10721081    if (FragmentCounter == 0) // first fragments frees the initial pointer to list
    1073       Free(&ListOfLocalAtoms);
     1082      delete[](ListOfLocalAtoms);
    10741083  }
    10751084  DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl);
     
    11301139    // allocate and set each field to NULL
    11311140    const int Counter = Count();
    1132     ListOfLocalAtoms = Calloc<atom**>(Counter, "MoleculeLeafClass::FillListOfLocalAtoms - ***ListOfLocalAtoms");
     1141    ASSERT(FragmentCounter < Counter, "FillListOfLocalAtoms: FragmenCounter greater than present fragments.");
     1142    ListOfLocalAtoms = new atom**[Counter];
    11331143    if (ListOfLocalAtoms == NULL) {
    11341144      FreeList = FreeList && false;
    11351145      status = false;
    11361146    }
     1147    for (int i=0;i<Counter;i++)
     1148      ListOfLocalAtoms[i] = NULL;
    11371149  }
    11381150
     
    11701182  if (FragmentList == NULL) {
    11711183    KeySetCounter = Count();
    1172     FragmentList = Calloc<Graph*>(KeySetCounter, "MoleculeLeafClass::AssignKeySetsToFragment - **FragmentList");
     1184    FragmentList = new Graph*[KeySetCounter];
     1185    for (int i=0;i<KeySetCounter;i++)
     1186      FragmentList[i] = NULL;
    11731187    KeySetCounter = 0;
    11741188  }
     
    12041218  if ((FreeList) && (ListOfLocalAtoms != NULL)) {
    12051219    // free the index lookup list
    1206     Free(&ListOfLocalAtoms[FragmentCounter]);
     1220    delete[](ListOfLocalAtoms[FragmentCounter]);
    12071221    if (FragmentCounter == 0) // first fragments frees the initial pointer to list
    1208       Free(&ListOfLocalAtoms);
     1222      delete[](ListOfLocalAtoms);
    12091223  }
    12101224  DoLog(1) && (Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl);
  • src/parser.cpp

    ra7b761b r1024cb  
    5959MatrixContainer::MatrixContainer() {
    6060  Indices = NULL;
    61   Header = Malloc<char*>(1, "MatrixContainer::MatrixContainer: **Header");
    62   Matrix = Malloc<double**>(1, "MatrixContainer::MatrixContainer: ***Matrix"); // one more each for the total molecule
    63   RowCounter = Malloc<int>(1, "MatrixContainer::MatrixContainer: *RowCounter");
    64   ColumnCounter = Malloc<int>(1, "MatrixContainer::MatrixContainer: *ColumnCounter");
     61  Header = new char*[1];
     62  Matrix = new double**[1]; // one more each for the total molecule
     63  RowCounter = new int[1];
     64  ColumnCounter = new int[1];
    6565  Header[0] = NULL;
    6666  Matrix[0] = NULL;
     
    7777      if ((ColumnCounter != NULL) && (RowCounter != NULL)) {
    7878          for(int j=RowCounter[i]+1;j--;)
    79             Free(&Matrix[i][j]);
    80         Free(&Matrix[i]);
     79            delete[](Matrix[i][j]);
     80          delete[](Matrix[i]);
    8181      }
    8282    }
    8383    if ((ColumnCounter != NULL) && (RowCounter != NULL) && (Matrix[MatrixCounter] != NULL))
    8484      for(int j=RowCounter[MatrixCounter]+1;j--;)
    85         Free(&Matrix[MatrixCounter][j]);
     85        delete[](Matrix[MatrixCounter][j]);
    8686    if (MatrixCounter != 0)
    87       Free(&Matrix[MatrixCounter]);
    88     Free(&Matrix);
     87      delete[](Matrix[MatrixCounter]);
     88    delete[](Matrix);
    8989  }
    9090  if (Indices != NULL)
    9191    for(int i=MatrixCounter+1;i--;) {
    92       Free(&Indices[i]);
    93     }
    94   Free(&Indices);
     92      delete[](Indices[i]);
     93    }
     94  delete[](Indices);
    9595 
    9696  if (Header != NULL)
    9797    for(int i=MatrixCounter+1;i--;)
    98       Free(&Header[i]);
    99   Free(&Header);
    100   Free(&RowCounter);
    101   Free(&ColumnCounter);
     98      delete[](Header[i]);
     99  delete[](Header);
     100  delete[](RowCounter);
     101  delete[](ColumnCounter);
    102102};
    103103
     
    112112  if (Matrix == NULL) {
    113113    DoLog(0) && (Log() << Verbose(0) << " with trivial mapping." << endl);
    114     Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices");
     114    Indices = new int*[MatrixCounter + 1];
    115115    for(int i=MatrixCounter+1;i--;) {
    116       Indices[i] = Malloc<int>(RowCounter[i], "MatrixContainer::InitialiseIndices: *Indices[]");
     116      Indices[i] = new int[RowCounter[i]];
    117117      for(int j=RowCounter[i];j--;)
    118118        Indices[i][j] = j;
     
    122122    if (MatrixCounter != Matrix->MatrixCounter)
    123123      return false;
    124     Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices");
     124    Indices = new int*[MatrixCounter + 1];
    125125    for(int i=MatrixCounter+1;i--;) {
    126126      if (RowCounter[i] != Matrix->RowCounter[i])
    127127        return false;
    128       Indices[i] = Malloc<int>(Matrix->RowCounter[i], "MatrixContainer::InitialiseIndices: *Indices[]");
     128      Indices[i] = new int[Matrix->RowCounter[i]];
    129129      for(int j=Matrix->RowCounter[i];j--;) {
    130130        Indices[i][j] = Matrix->Indices[i][j];
     
    166166
    167167  // parse header
    168   Header[MatrixNr] = Malloc<char>(1024, "MatrixContainer::ParseMatrix: *Header[]");
     168  Header[MatrixNr] = new char[1024];
    169169  for (int m=skiplines+1;m--;)
    170170    input.getline(Header[MatrixNr], 1023);
     
    205205  // allocate matrix if it's not zero dimension in one direction
    206206  if ((ColumnCounter[MatrixNr] > 0) && (RowCounter[MatrixNr] > -1)) {
    207     Matrix[MatrixNr] = Malloc<double*>(RowCounter[MatrixNr] + 1, "MatrixContainer::ParseMatrix: **Matrix[]");
     207    Matrix[MatrixNr] = new double*[RowCounter[MatrixNr] + 1];
    208208 
    209209    // parse in each entry for this matrix
     
    217217    strncpy(Header[MatrixNr], line.str().c_str(), 1023); 
    218218    for(int j=0;j<RowCounter[MatrixNr];j++) {
    219       Matrix[MatrixNr][j] = Malloc<double>(ColumnCounter[MatrixNr], "MatrixContainer::ParseMatrix: *Matrix[][]");
     219      Matrix[MatrixNr][j] = new double[ColumnCounter[MatrixNr]];
    220220      input.getline(filename, 1023);
    221221      stringstream lines(filename);
     
    227227        //Log() << Verbose(1) << " " << setprecision(2) << Matrix[MatrixNr][j][k] << endl;
    228228      }
    229       Matrix[MatrixNr][ RowCounter[MatrixNr] ] = Malloc<double>(ColumnCounter[MatrixNr], "MatrixContainer::ParseMatrix: *Matrix[RowCounter[MatrixNr]][]");
     229      Matrix[MatrixNr][ RowCounter[MatrixNr] ] = new double[ColumnCounter[MatrixNr]];
    230230      for(int j=ColumnCounter[MatrixNr];j--;)
    231231        Matrix[MatrixNr][ RowCounter[MatrixNr] ][j] = 0.;
     
    281281
    282282  DoLog(0) && (Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl);
    283   Header = ReAlloc<char*>(Header, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: **Header"); // one more each for the total molecule
    284   Matrix = ReAlloc<double**>(Matrix, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule
    285   RowCounter = ReAlloc<int>(RowCounter, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: *RowCounter");
    286   ColumnCounter = ReAlloc<int>(ColumnCounter, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: *ColumnCounter");
     283  delete[](Header);
     284  delete[](Matrix);
     285  delete[](RowCounter);
     286  delete[](ColumnCounter);
     287  Header = new char*[MatrixCounter + 1]; // one more each for the total molecule
     288  Matrix = new double**[MatrixCounter + 1]; // one more each for the total molecule
     289  RowCounter = new int[MatrixCounter + 1];
     290  ColumnCounter = new int[MatrixCounter + 1];
    287291  for(int i=MatrixCounter+1;i--;) {
    288292    Matrix[i] = NULL;
     
    298302    if (!ParseMatrix(file.str().c_str(), skiplines, skipcolumns, i))
    299303      return false;
    300     Free(&FragmentNumber);
     304    delete[](FragmentNumber);
    301305  }
    302306  return true;
     
    313317{
    314318  MatrixCounter = MCounter;
    315   Header = Malloc<char*>(MatrixCounter + 1, "MatrixContainer::AllocateMatrix: *Header");
    316   Matrix = Malloc<double**>(MatrixCounter + 1, "MatrixContainer::AllocateMatrix: ***Matrix"); // one more each for the total molecule
    317   RowCounter = Malloc<int>(MatrixCounter + 1, "MatrixContainer::AllocateMatrix: *RowCounter");
    318   ColumnCounter = Malloc<int>(MatrixCounter + 1, "MatrixContainer::AllocateMatrix: *ColumnCounter");
     319  Header = new char*[MatrixCounter + 1];
     320  Matrix = new double**[MatrixCounter + 1]; // one more each for the total molecule
     321  RowCounter = new int[MatrixCounter + 1];
     322  ColumnCounter = new int[MatrixCounter + 1];
    319323  for(int i=MatrixCounter+1;i--;) {
    320     Header[i] = Malloc<char>(1024, "MatrixContainer::AllocateMatrix: *Header[i]");
     324    Header[i] = new char[1024];
    321325    strncpy(Header[i], GivenHeader[i], 1023);
    322326    RowCounter[i] = RCounter[i];
    323327    ColumnCounter[i] = CCounter[i];
    324     Matrix[i] = Malloc<double*>(RowCounter[i] + 1, "MatrixContainer::AllocateMatrix: **Matrix[]");
     328    Matrix[i] = new double*[RowCounter[i] + 1];
    325329    for(int j=RowCounter[i]+1;j--;) {
    326       Matrix[i][j] = Malloc<double>(ColumnCounter[i], "MatrixContainer::AllocateMatrix: *Matrix[][]");
     330      Matrix[i][j] = new double[ColumnCounter[i]];
    327331      for(int k=ColumnCounter[i];k--;)
    328332        Matrix[i][j][k] = 0.;
     
    474478    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    475479    line << name << FRAGMENTPREFIX << FragmentNumber << "/" << prefix;
    476     Free(&FragmentNumber);
     480    delete[](FragmentNumber);
    477481    output.open(line.str().c_str(), ios::out);
    478482    if (output == NULL) {
     
    530534{
    531535  DoLog(0) && (Log() << Verbose(0) << "Parsing energy indices." << endl);
    532   Indices = Malloc<int*>(MatrixCounter + 1, "EnergyMatrix::ParseIndices: **Indices");
     536  Indices = new int*[MatrixCounter + 1];
    533537  for(int i=MatrixCounter+1;i--;) {
    534     Indices[i] = Malloc<int>(RowCounter[i], "EnergyMatrix::ParseIndices: *Indices[]");
     538    Indices[i] = new int[RowCounter[i]];
    535539    for(int j=RowCounter[i];j--;)
    536540      Indices[i][j] = j;
     
    589593    // allocate last plus one matrix
    590594    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    591     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     595    Matrix[MatrixCounter] = new double*[RowCounter[MatrixCounter] + 1];
    592596    for(int j=0;j<=RowCounter[MatrixCounter];j++)
    593       Matrix[MatrixCounter][j] = Malloc<double>(ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
     597      Matrix[MatrixCounter][j] = new double[ColumnCounter[MatrixCounter]];
    594598   
    595599    // try independently to parse global energysuffix file if present
     
    616620
    617621  DoLog(0) && (Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl);
    618   Indices = Malloc<int*>(MatrixCounter + 1, "ForceMatrix::ParseIndices: **Indices");
     622  Indices = new int*[MatrixCounter + 1];
    619623  line << name << FRAGMENTPREFIX << FORCESFILE;
    620624  input.open(line.str().c_str(), ios::in);
     
    629633    line.str(filename);
    630634    // parse the values
    631     Indices[i] = Malloc<int>(RowCounter[i], "ForceMatrix::ParseIndices: *Indices[]");
     635    Indices[i] = new int[RowCounter[i]];
    632636    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    633637    //Log() << Verbose(0) << FRAGMENTPREFIX << FragmentNumber << "[" << RowCounter[i] << "]:";
    634     Free(&FragmentNumber);
     638    delete[](FragmentNumber);
    635639    for(int j=0;(j<RowCounter[i]) && (!line.eof());j++) {
    636640      line >> Indices[i][j];
     
    639643    //Log() << Verbose(0) << endl;
    640644  }
    641   Indices[MatrixCounter] = Malloc<int>(RowCounter[MatrixCounter], "ForceMatrix::ParseIndices: *Indices[]");
     645  Indices[MatrixCounter] = new int[RowCounter[MatrixCounter]];
    642646  for(int j=RowCounter[MatrixCounter];j--;) {
    643647    Indices[MatrixCounter][j] = j;
     
    725729    // allocate last plus one matrix
    726730    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    727     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     731    Matrix[MatrixCounter] = new double*[RowCounter[MatrixCounter] + 1];
    728732    for(int j=0;j<=RowCounter[MatrixCounter];j++)
    729       Matrix[MatrixCounter][j] = Malloc<double>(ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
     733      Matrix[MatrixCounter][j] = new double[ColumnCounter[MatrixCounter]];
    730734
    731735    // try independently to parse global forcesuffix file if present
     
    754758 
    755759  DoLog(0) && (Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl);
    756   Indices = Malloc<int*>(MatrixCounter + 1, "HessianMatrix::ParseIndices: **Indices");
     760  Indices = new int*[MatrixCounter + 1];
    757761  line << name << FRAGMENTPREFIX << FORCESFILE;
    758762  input.open(line.str().c_str(), ios::in);
     
    767771    line.str(filename);
    768772    // parse the values
    769     Indices[i] = Malloc<int>(RowCounter[i], "HessianMatrix::ParseIndices: *Indices[]");
     773    Indices[i] = new int[RowCounter[i]];
    770774    FragmentNumber = FixedDigitNumber(MatrixCounter, i);
    771775    //Log() << Verbose(0) << FRAGMENTPREFIX << FragmentNumber << "[" << RowCounter[i] << "]:";
    772     Free(&FragmentNumber);
     776    delete[](FragmentNumber);
    773777    for(int j=0;(j<RowCounter[i]) && (!line.eof());j++) {
    774778      line >> Indices[i][j];
     
    777781    //Log() << Verbose(0) << endl;
    778782  }
    779   Indices[MatrixCounter] = Malloc<int>(RowCounter[MatrixCounter], "HessianMatrix::ParseIndices: *Indices[]");
     783  Indices[MatrixCounter] = new int[RowCounter[MatrixCounter]];
    780784  for(int j=RowCounter[MatrixCounter];j--;) {
    781785    Indices[MatrixCounter][j] = j;
     
    953957    // allocate last plus one matrix
    954958    DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl);
    955     Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
     959    Matrix[MatrixCounter] = new double*[RowCounter[MatrixCounter] + 1];
    956960    for(int j=0;j<=RowCounter[MatrixCounter];j++)
    957       Matrix[MatrixCounter][j] = Malloc<double>(ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
     961      Matrix[MatrixCounter][j] = new double[ColumnCounter[MatrixCounter]];
    958962
    959963    // try independently to parse global forcesuffix file if present
     
    985989KeySetsContainer::~KeySetsContainer() {
    986990  for(int i=FragmentCounter;i--;)
    987     Free(&KeySets[i]);
     991    delete[](KeySets[i]);
    988992  for(int i=Order;i--;)
    989     Free(&OrderSet[i]);
    990   Free(&KeySets);
    991   Free(&OrderSet);
    992   Free(&AtomCounter);
    993   Free(&FragmentsPerOrder);
     993    delete[](OrderSet[i]);
     994  delete[](KeySets);
     995  delete[](OrderSet);
     996  delete[](AtomCounter);
     997  delete[](FragmentsPerOrder);
    994998};
    995999
     
    10081012  FragmentCounter = FCounter;
    10091013  DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl);
    1010   KeySets = Malloc<int*>(FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets");
     1014  KeySets = new int*[FragmentCounter];
    10111015  for(int i=FragmentCounter;i--;)
    10121016    KeySets[i] = NULL;
     
    10181022  }
    10191023
    1020   AtomCounter = Malloc<int>(FragmentCounter, "KeySetsContainer::ParseKeySets: *RowCounter");
     1024  AtomCounter = new int[FragmentCounter];
    10211025  for(int i=0;(i<FragmentCounter) && (!input.eof());i++) {
    10221026    stringstream line;
    10231027    AtomCounter[i] = ACounter[i];
    10241028    // parse the values
    1025     KeySets[i] = Malloc<int>(AtomCounter[i], "KeySetsContainer::ParseKeySets: *KeySets[]");
     1029    KeySets[i] = new int[AtomCounter[i]];
    10261030    for(int j=AtomCounter[i];j--;)
    10271031      KeySets[i][j] = -1;
    10281032    FragmentNumber = FixedDigitNumber(FragmentCounter, i);
    10291033    //Log() << Verbose(0) << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:";
    1030     Free(&FragmentNumber);
     1034    delete[](FragmentNumber);
    10311035    input.getline(filename, 1023);
    10321036    line.str(filename);
     
    10621066
    10631067  // scan through all to determine fragments per order
    1064   FragmentsPerOrder = Malloc<int>(Order, "KeySetsContainer::ParseManyBodyTerms: *FragmentsPerOrder");
     1068  FragmentsPerOrder = new int[Order];
    10651069  for(int i=Order;i--;)
    10661070    FragmentsPerOrder[i] = 0;
     
    10761080
    10771081  // scan through all to gather indices to each order set
    1078   OrderSet = Malloc<int*>(Order, "KeySetsContainer::ParseManyBodyTerms: **OrderSet");
     1082  OrderSet = new int*[Order];
    10791083  for(int i=Order;i--;)
    1080     OrderSet[i] = Malloc<int>(FragmentsPerOrder[i], "KeySetsContainer::ParseManyBodyTermsKeySetsContainer::ParseManyBodyTerms: *OrderSet[]");
     1084    OrderSet[i] = new int[FragmentsPerOrder[i]];
    10811085  for(int i=Order;i--;)
    10821086    FragmentsPerOrder[i] = 0;
  • src/periodentafel.cpp

    ra7b761b r1024cb  
    88
    99#include <iomanip>
     10#include <iostream>
    1011#include <fstream>
    1112#include <cstring>
    12 #include <cassert>
    13 
     13
     14#include "Helpers/Assert.hpp"
    1415#include "element.hpp"
     16#include "elements_db.hpp"
    1517#include "helpers.hpp"
    1618#include "lists.hpp"
     
    2729 */
    2830periodentafel::periodentafel()
    29 {};
     31{
     32  ASSERT(LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)), "General element initialization failed");
     33  ASSERT(LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)), "Valence entry of element initialization failed");
     34  ASSERT(LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)), "Orbitals entry of element initialization failed");
     35  ASSERT(LoadHBondAngleDatabase(new stringstream(HbondangleDB,ios_base::in)), "HBond angle entry of element initialization failed");
     36  ASSERT(LoadHBondLengthsDatabase(new stringstream(HbonddistanceDB,ios_base::in)), "HBond distance entry of element initialization failed");
     37};
    3038
    3139/** destructor for class periodentafel
    3240 * Removes every element and afterwards deletes start and end of list.
     41 * TODO: Handle when elements have changed and store databases then
    3342 */
    3443periodentafel::~periodentafel()
     
    3948/** Adds element to period table list
    4049 * \param *pointer element to be added
    41  * \return true - succeeded, false - does not occur
     50 * \return iterator to added element
    4251 */
    4352periodentafel::iterator periodentafel::AddElement(element * const pointer)
    4453{
    4554  atomicNumber_t Z = pointer->getNumber();
    46   assert(!elements.count(Z));
     55  ASSERT(!elements.count(Z), "Element is already present.");
    4756  pointer->sort = &pointer->Z;
    4857  if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS)
     
    5463/** Removes element from list.
    5564 * \param *pointer element to be removed
    56  * \return true - succeeded, false - element not found
    5765 */
    5866void periodentafel::RemoveElement(element * const pointer)
    5967{
    60   atomicNumber_t Z = pointer->getNumber();
     68  RemoveElement(pointer->getNumber());
     69};
     70
     71/** Removes element from list.
     72 * \param Z element to be removed
     73 */
     74void periodentafel::RemoveElement(atomicNumber_t Z)
     75{
    6176  elements.erase(Z);
    6277};
    6378
    6479/** Removes every element from the period table.
    65  * \return true - succeeded, false - does not occur
    6680 */
    6781void periodentafel::CleanupPeriodtable()
     
    7892 * \return pointer to element or NULL if not found
    7993 */
    80 const element * periodentafel::FindElement(atomicNumber_t Z) const
     94element * const periodentafel::FindElement(atomicNumber_t Z) const
    8195{
    8296  const_iterator res = elements.find(Z);
     
    89103 * \return pointer to element
    90104 */
    91 const element * periodentafel::FindElement(const char * const shorthand) const
     105element * const periodentafel::FindElement(const char * const shorthand) const
    92106{
    93107  element *res = 0;
     
    102116
    103117/** Asks for element number and returns pointer to element
    104  */
    105 const element * periodentafel::AskElement() const
    106 {
    107   const element *walker = NULL;
     118 * \return desired element or NULL
     119 */
     120element * const periodentafel::AskElement() const
     121{
     122  element * walker = NULL;
    108123  int Z;
    109124  do {
     
    118133 * \return pointer to either present or newly created element
    119134 */
    120 const element * periodentafel::EnterElement()
    121 {
    122   const element *res = NULL;
     135element * const periodentafel::EnterElement()
     136{
    123137  atomicNumber_t Z = 0;
    124138  DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
    125139  cin >> Z;
    126   res = FindElement(Z);
     140  element * const res = FindElement(Z);
    127141  if (!res) {
    128142    // TODO: make this using the constructor
    129     element *tmp;
    130143    DoLog(0) && (Log() << Verbose(0) << "Element not found in database, please enter." << endl);
    131     tmp = new element;
     144    element *tmp = new element;
    132145    tmp->Z = Z;
    133146    DoLog(0) && (Log() << Verbose(0) << "Mass: " << endl);
     
    138151    cin >> tmp->symbol;
    139152    AddElement(tmp);
    140     res = tmp;
     153    return tmp;
    141154  }
    142155  return res;
     
    204217bool periodentafel::LoadPeriodentafel(const char *path)
    205218{
    206   ifstream infile;
    207   element *ptr;
    208   map<atomicNumber_t,element*> parsedElems;
     219  ifstream input;
    209220  bool status = true;
    210221  bool otherstatus = true;
     
    215226  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    216227  strncat(filename, STANDARDELEMENTSDB, MAXSTRINGSIZE-strlen(filename));
    217   infile.open(filename);
    218   if (infile != NULL) {
    219     infile.getline(header1, MAXSTRINGSIZE);
    220     infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
     228  input.open(filename);
     229  status = status && LoadElementsDatabase(&input);
     230
     231  // fill valence DB per element
     232  strncpy(filename, path, MAXSTRINGSIZE);
     233  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
     234  strncat(filename, STANDARDVALENCEDB, MAXSTRINGSIZE-strlen(filename));
     235  input.open(filename);
     236  otherstatus = otherstatus && LoadValenceDatabase(&input);
     237
     238  // fill orbitals DB per element
     239  strncpy(filename, path, MAXSTRINGSIZE);
     240  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
     241  strncat(filename, STANDARDORBITALDB, MAXSTRINGSIZE-strlen(filename));
     242  input.open(filename);
     243  otherstatus = otherstatus && LoadOrbitalsDatabase(&input);
     244
     245  // fill H-BondAngle DB per element
     246  strncpy(filename, path, MAXSTRINGSIZE);
     247  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
     248  strncat(filename, STANDARDHBONDANGLEDB, MAXSTRINGSIZE-strlen(filename));
     249  input.open(filename);
     250  otherstatus = otherstatus && LoadHBondAngleDatabase(&input);
     251
     252  // fill H-BondDistance DB per element
     253  strncpy(filename, path, MAXSTRINGSIZE);
     254  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
     255  strncat(filename, STANDARDHBONDDISTANCEDB, MAXSTRINGSIZE-strlen(filename));
     256  input.open(filename);
     257  otherstatus = otherstatus && LoadHBondLengthsDatabase(&input);
     258
     259  if (!otherstatus){
     260    DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
     261  }
     262
     263  return status;
     264};
     265
     266/** load the element info.
     267 * \param *input stream to parse from
     268 * \return true - parsing successful, false - something went wrong
     269 */
     270bool periodentafel::LoadElementsDatabase(istream *input)
     271{
     272  bool status = true;
     273  int counter = 0;
     274  if (!(*input).fail()) {
     275    (*input).getline(header1, MAXSTRINGSIZE);
     276    (*input).getline(header2, MAXSTRINGSIZE); // skip first two header lines
    221277    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    222     while (!infile.eof()) {
     278    while (!(*input).eof()) {
    223279      element *neues = new element;
    224       infile >> neues->name;
    225       //infile >> ws;
    226       infile >> neues->symbol;
    227       //infile >> ws;
    228       infile >> neues->period;
    229       //infile >> ws;
    230       infile >> neues->group;
    231       //infile >> ws;
    232       infile >> neues->block;
    233       //infile >> ws;
    234       infile >> neues->Z;
    235       //infile >> ws;
    236       infile >> neues->mass;
    237       //infile >> ws;
    238       infile >> neues->CovalentRadius;
    239       //infile >> ws;
    240       infile >> neues->VanDerWaalsRadius;
    241       //infile >> ws;
    242       infile >> ws;
    243       DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol);
     280      (*input) >> neues->name;
     281      //(*input) >> ws;
     282      (*input) >> neues->symbol;
     283      //(*input) >> ws;
     284      (*input) >> neues->period;
     285      //(*input) >> ws;
     286      (*input) >> neues->group;
     287      //(*input) >> ws;
     288      (*input) >> neues->block;
     289      //(*input) >> ws;
     290      (*input) >> neues->Z;
     291      //(*input) >> ws;
     292      (*input) >> neues->mass;
     293      //(*input) >> ws;
     294      (*input) >> neues->CovalentRadius;
     295      //(*input) >> ws;
     296      (*input) >> neues->VanDerWaalsRadius;
     297      //(*input) >> ws;
     298      (*input) >> ws;
     299      if (elements.count(neues->Z)) {// if element already present, remove and delete it
     300        element * const Elemental = FindElement(neues->Z);
     301        ASSERT(Elemental != NULL, "element should be present but is not??");
     302        RemoveElement(Elemental);
     303        delete(Elemental);
     304      }
    244305      //neues->Output((ofstream *)&cout);
    245       if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS))
    246         parsedElems[neues->getNumber()] = neues;
    247       else {
    248         DoLog(0) && (Log() << Verbose(0) << "Could not parse element: ");
    249         neues->Output((ofstream *)&cout);
     306      if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS)) {
     307        DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol);
     308        elements[neues->getNumber()] = neues;
     309        counter++;
     310      } else {
     311        DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl);
     312        DoLog(0) && (Log() << Verbose(0) << " <?>");
    250313        delete(neues);
    251314      }
    252315    }
    253316    DoLog(0) && (Log() << Verbose(0) << endl);
    254     infile.close();
    255     infile.clear();
    256317  } else
    257318    status = false;
    258319
    259   // fill valence DB per element
    260   strncpy(filename, path, MAXSTRINGSIZE);
    261   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    262   strncat(filename, STANDARDVALENCEDB, MAXSTRINGSIZE-strlen(filename));
    263   infile.open(filename);
    264   if (infile != NULL) {
    265     while (!infile.eof()) {
     320  if (counter == 0)
     321    status = false;
     322
     323  return status;
     324}
     325
     326/** load the valence info.
     327 * \param *input stream to parse from
     328 * \return true - parsing successful, false - something went wrong
     329 */
     330bool periodentafel::LoadValenceDatabase(istream *input)
     331{
     332  char dummy[MAXSTRINGSIZE];
     333  if (!(*input).fail()) {
     334    (*input).getline(dummy, MAXSTRINGSIZE);
     335    while (!(*input).eof()) {
    266336      atomicNumber_t Z;
    267       infile >> Z;
    268       infile >> ws;
    269       infile >> parsedElems[Z]->Valence;
    270       infile >> ws;
     337      (*input) >> Z;
     338      ASSERT(elements.count(Z), "Element not present");
     339      (*input) >> ws;
     340      (*input) >> elements[Z]->Valence;
     341      (*input) >> ws;
    271342      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;
    272343    }
    273     infile.close();
    274     infile.clear();
    275   } else
    276     otherstatus = false;
    277 
    278   // fill valence DB per element
    279   strncpy(filename, path, MAXSTRINGSIZE);
    280   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    281   strncat(filename, STANDARDORBITALDB, MAXSTRINGSIZE-strlen(filename));
    282   infile.open(filename);
    283   if (infile != NULL) {
    284     while (!infile.eof()) {
     344    return true;
     345  } else
     346                return false;
     347}
     348
     349/** load the orbitals info.
     350 * \param *input stream to parse from
     351 * \return true - parsing successful, false - something went wrong
     352 */
     353bool periodentafel::LoadOrbitalsDatabase(istream *input)
     354{
     355  char dummy[MAXSTRINGSIZE];
     356  if (!(*input).fail()) {
     357    (*input).getline(dummy, MAXSTRINGSIZE);
     358    while (!(*input).eof()) {
    285359      atomicNumber_t Z;
    286       infile >> Z;
    287       infile >> ws;
    288       infile >> parsedElems[Z]->NoValenceOrbitals;
    289       infile >> ws;
     360      (*input) >> Z;
     361      ASSERT(elements.count(Z), "Element not present");
     362      (*input) >> ws;
     363      (*input) >> elements[Z]->NoValenceOrbitals;
     364      (*input) >> ws;
    290365      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;
    291366    }
    292     infile.close();
    293     infile.clear();
    294   } else
    295     otherstatus = false;
    296 
    297   // fill H-BondDistance DB per element
    298   strncpy(filename, path, MAXSTRINGSIZE);
    299   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    300   strncat(filename, STANDARDHBONDDISTANCEDB, MAXSTRINGSIZE-strlen(filename));
    301   infile.open(filename);
    302   if (infile != NULL) {
    303     while (!infile.eof()) {
     367    return true;
     368  } else
     369    return false;
     370}
     371
     372/** load the hbond angles info.
     373 * \param *input stream to parse from
     374 * \return true - parsing successful, false - something went wrong
     375 */
     376bool periodentafel::LoadHBondAngleDatabase(istream *input)
     377{
     378  char dummy[MAXSTRINGSIZE];
     379  if (!(*input).fail()) {
     380    (*input).getline(dummy, MAXSTRINGSIZE);
     381    while (!(*input).eof()) {
    304382      atomicNumber_t Z;
    305       infile >> Z;
    306       ptr = parsedElems[Z];
    307       infile >> ws;
    308       infile >> ptr->HBondDistance[0];
    309       infile >> ptr->HBondDistance[1];
    310       infile >> ptr->HBondDistance[2];
    311       infile >> ws;
     383      (*input) >> Z;
     384      ASSERT(elements.count(Z), "Element not present");
     385      (*input) >> ws;
     386      (*input) >> elements[Z]->HBondAngle[0];
     387      (*input) >> elements[Z]->HBondAngle[1];
     388      (*input) >> elements[Z]->HBondAngle[2];
     389      (*input) >> ws;
     390      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
     391    }
     392    return true;
     393  } else
     394                return false;
     395}
     396
     397/** load the hbond lengths info.
     398 * \param *input stream to parse from
     399 * \return true - parsing successful, false - something went wrong
     400 */
     401bool periodentafel::LoadHBondLengthsDatabase(istream *input)
     402{
     403  char dummy[MAXSTRINGSIZE];
     404  if (!(*input).fail()) {
     405    (*input).getline(dummy, MAXSTRINGSIZE);
     406    while (!(*input).eof()) {
     407      atomicNumber_t Z;
     408      (*input) >> Z;
     409      ASSERT(elements.count(Z), "Element not present");
     410      (*input) >> ws;
     411      (*input) >> elements[Z]->HBondDistance[0];
     412      (*input) >> elements[Z]->HBondDistance[1];
     413      (*input) >> elements[Z]->HBondDistance[2];
     414      (*input) >> ws;
    312415      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
    313416    }
    314     infile.close();
    315     infile.clear();
    316   } else
    317     otherstatus = false;
    318 
    319   // fill H-BondAngle DB per element
    320   strncpy(filename, path, MAXSTRINGSIZE);
    321   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    322   strncat(filename, STANDARDHBONDANGLEDB, MAXSTRINGSIZE-strlen(filename));
    323   infile.open(filename);
    324   if (infile != NULL) {
    325     while (!infile.eof()) {
    326       atomicNumber_t Z;
    327       infile >> Z;
    328       ptr = parsedElems[Z];
    329       infile >> ws;
    330       infile >> ptr->HBondAngle[0];
    331       infile >> ptr->HBondAngle[1];
    332       infile >> ptr->HBondAngle[2];
    333       infile >> ws;
    334       //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
    335     }
    336     infile.close();
    337   } else
    338     otherstatus = false;
    339 
    340   if (otherstatus){
    341     map<atomicNumber_t,element*>::iterator iter;
    342     for(iter=parsedElems.begin();iter!=parsedElems.end();++iter){
    343       AddElement((*iter).second);
    344     }
    345   }
    346   else{
    347     DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
    348     map<atomicNumber_t,element*>::iterator iter;
    349     for(iter=parsedElems.begin();iter!=parsedElems.end();++iter){
    350       AddElement((*iter).second);
    351     }
    352   }
    353 
    354   return status;
    355 };
     417    return true;
     418  } else
     419                return false;
     420}
    356421
    357422/** Stores element list to file.
     
    374439    }
    375440    f.close();
    376   } else
    377     result = false;
    378   return result;
    379 };
     441    return true;
     442  } else
     443    return result;
     444};
  • src/periodentafel.hpp

    ra7b761b r1024cb  
    1313#include <iterator>
    1414
     15#include "unittests/periodentafelTest.hpp"
    1516#include "defs.hpp"
    1617#include "types.hpp"
     
    2728class periodentafel {
    2829  /******* Types *********/
     30  friend class periodentafelTest;
    2931  private:
    3032    typedef std::map<atomicNumber_t,element*> elementSet;
     
    4345  iterator AddElement(element * const pointer);
    4446  void RemoveElement(element * const pointer);
     47  void RemoveElement(atomicNumber_t);
    4548  void CleanupPeriodtable();
    46   const element *FindElement(atomicNumber_t) const;
    47   const element *FindElement(const char * const shorthand) const;
    48   const element *AskElement() const;
    49   const element *EnterElement();
     49  element * const FindElement(atomicNumber_t) const;
     50  element * const FindElement(const char * const shorthand) const;
     51  element * const AskElement() const;
     52  element * const EnterElement();
    5053
    5154  const_iterator begin();
     
    5962
    6063  private:
     64
     65  bool LoadElementsDatabase(std::istream *input);
     66  bool LoadValenceDatabase(std::istream *input);
     67  bool LoadOrbitalsDatabase(std::istream *input);
     68  bool LoadHBondAngleDatabase(std::istream *input);
     69  bool LoadHBondLengthsDatabase(std::istream *input);
     70
    6171    elementSet elements;
    6272};
  • src/stackclass.hpp

    ra7b761b r1024cb  
    5050template <typename T> StackClass<T>::StackClass(int dimension) : StackList(NULL), EntryCount(dimension), CurrentLastEntry(0), CurrentFirstEntry(0), NextFreeField(0)
    5151{
    52   StackList = Calloc<T>(EntryCount, "StackClass::StackClass: **StackList");
     52  StackList = new T[EntryCount];
     53  for (int i=0;i<EntryCount;i++)
     54    StackList[i] = NULL;
    5355};
    5456
     
    5759template <typename T> StackClass<T>::~StackClass()
    5860{
    59   Free(&StackList);
     61  delete[](StackList);
    6062};
    6163
  • src/unittests/ActOnAllUnitTest.cpp

    ra7b761b r1024cb  
    4646  // Ref was copy constructed, hence has to be cleaned, too!
    4747  Ref.EmptyList();
    48   MemoryUsageObserver::purgeInstance();
    4948};
    5049
     
    7776
    7877  // scaling by three values
    79   double *factors = Malloc<double>(NDIM, "ActOnAllTest::ScaleTest - factors");
    80   double *inverses = Malloc<double>(NDIM, "ActOnAllTest::ScaleTest - inverses");
     78  double *factors = new double[NDIM];
     79  double *inverses = new double[NDIM];
    8180  for (int i=0;i<NDIM;++i) {
    8281    factors[i] = 2.;
     
    8887  VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, inverses );
    8988  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    90   Free(factors);
    91   Free(inverses);
     89  delete[](factors);
     90  delete[](inverses);
    9291};
    9392
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    ra7b761b r1024cb  
    1717#include "AnalysisCorrelationToPointUnitTest.hpp"
    1818
    19 #include "World.hpp"
    2019#include "atom.hpp"
    21 #include "boundary.hpp"
    2220#include "element.hpp"
    2321#include "molecule.hpp"
    2422#include "linkedcell.hpp"
    2523#include "periodentafel.hpp"
    26 #include "tesselation.hpp"
     24#include "World.hpp"
    2725
    2826#ifdef HAVE_TESTRUNNER
     
    4240  TestList = NULL;
    4341  TestMolecule = NULL;
    44   hydrogen = NULL;
    45   tafel = NULL;
    4642  pointmap = NULL;
    4743  binmap = NULL;
    4844  point = NULL;
    4945
    50   // construct element
    51   hydrogen = new element;
    52   hydrogen->Z = 1;
    53   strcpy(hydrogen->name, "hydrogen");
    54   strcpy(hydrogen->symbol, "H");
    55 
    56 
    57   // construct periodentafel
    58   tafel = World::getInstance().getPeriode();
    59   tafel->AddElement(hydrogen);
    60 
    6146  // construct molecule (tetraeder of hydrogens)
     47  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     48  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
    6249  TestMolecule = World::getInstance().createMolecule();
    6350  Walker = World::getInstance().createAtom();
     
    10491  delete(point);
    10592  World::purgeInstance();
    106   MemoryUsageObserver::purgeInstance();
    10793  logger::purgeInstance();
    10894};
  • src/unittests/AnalysisCorrelationToPointUnitTest.hpp

    ra7b761b r1024cb  
    1212
    1313class element;
    14 class LinkedCell;
    1514class molecule;
    1615class MoleculeListClass;
    17 class periodentafel;
    18 class Tesselation;
    1916class Vector;
    2017
     
    4037      MoleculeListClass *TestList;
    4138      molecule *TestMolecule;
    42       element *hydrogen;
    43       periodentafel *tafel;
     39      const element *hydrogen;
    4440
    4541      CorrelationToPointMap *pointmap;
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    ra7b761b r1024cb  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
    19 #include "World.hpp"
    2019#include "atom.hpp"
    2120#include "boundary.hpp"
     
    4847  TestList = NULL;
    4948  TestSurfaceMolecule = NULL;
    50   hydrogen = NULL;
    51   tafel = NULL;
    5249  surfacemap = NULL;
    5350  binmap = NULL;
     
    5552  LC = NULL;
    5653
    57   // construct element
    58   hydrogen = new element;
    59   hydrogen->Z = 1;
    60   strcpy(hydrogen->name, "hydrogen");
    61   strcpy(hydrogen->symbol, "H");
    62   carbon = new element;
    63   carbon->Z = 6;
    64   strcpy(carbon->name, "carbon");
    65   strcpy(carbon->symbol, "C");
    66 
    67   // construct periodentafel
    68   tafel = World::getInstance().getPeriode();
    69   tafel->AddElement(hydrogen);
    70   tafel->AddElement(carbon);
    71 
    7254  // construct molecule (tetraeder of hydrogens) base
     55  hydrogen = World::getInstance().getPeriode()->FindElement(1);
    7356  TestSurfaceMolecule = World::getInstance().createMolecule();
    7457
     
    10689
    10790  // add outer atoms
     91  carbon = World::getInstance().getPeriode()->FindElement(6);
    10892  TestSurfaceMolecule = World::getInstance().createMolecule();
    10993  Walker = World::getInstance().createAtom();
     
    149133  delete(LC);
    150134  World::purgeInstance();
    151   MemoryUsageObserver::purgeInstance();
    152135  logger::purgeInstance();
    153136};
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp

    ra7b761b r1024cb  
    4545      MoleculeListClass *TestList;
    4646      molecule *TestSurfaceMolecule;
    47       element *hydrogen;
    48       element *carbon;
    49       periodentafel *tafel;
     47      const element *hydrogen;
     48      const element *carbon;
    5049
    5150      CorrelationToSurfaceMap *surfacemap;
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    ra7b761b r1024cb  
    4444  TestList = NULL;
    4545  TestMolecule = NULL;
    46   hydrogen = NULL;
    47   tafel = NULL;
    4846  correlationmap = NULL;
    4947  binmap = NULL;
    5048
    51   // construct element
    52   hydrogen = new element;
    53   hydrogen->Z = 1;
    54   strcpy(hydrogen->name, "hydrogen");
    55   strcpy(hydrogen->symbol, "H");
    56 
    57   // construct periodentafel
    58   tafel = World::getInstance().getPeriode();
    59   tafel->AddElement(hydrogen);
    60 
    6149  // construct molecule (tetraeder of hydrogens)
     50  hydrogen = World::getInstance().getPeriode()->FindElement(1);
    6251  TestMolecule = World::getInstance().createMolecule();
    6352  Walker = World::getInstance().createAtom();
     
    10190  // note that all the atoms are cleaned by TestMolecule
    10291  World::purgeInstance();
    103   MemoryUsageObserver::purgeInstance();
    10492  logger::purgeInstance();
    10593  errorLogger::purgeInstance();
  • src/unittests/AnalysisPairCorrelationUnitTest.hpp

    ra7b761b r1024cb  
    1212
    1313class element;
    14 class LinkedCell;
    1514class molecule;
    1615class MoleculeListClass;
    17 class periodentafel;
    18 class Tesselation;
    1916class Vector;
    2017
     
    4037      MoleculeListClass *TestList;
    4138      molecule *TestMolecule;
    42       element *hydrogen;
    43       periodentafel *tafel;
     39      const element *hydrogen;
    4440
    4541      PairCorrelationMap *correlationmap;
  • src/unittests/CountBondsUnitTest.cpp

    ra7b761b r1024cb  
    1616#include <stdio.h>
    1717#include <cstring>
     18
     19#include "Helpers/Assert.hpp"
    1820
    1921#include "analysis_bonds.hpp"
     
    4042{
    4143  atom *Walker = NULL;
    42   BG = NULL;
    43   filename = NULL;
    44 
    45   // init private all pointers to zero
    46   molecules = NULL;
    47   TestMolecule1 = NULL;
    48   TestMolecule2 = NULL;
    49   hydrogen = NULL;
    50   oxygen = NULL;
    51   tafel = NULL;
    5244
    5345  // construct element
    54   hydrogen = new element;
    55   hydrogen->Z = 1;
    56   hydrogen->CovalentRadius = 0.23;
    57   strcpy(hydrogen->name, "hydrogen");
    58   strcpy(hydrogen->symbol, "H");
    59   oxygen = new element;
    60   oxygen->Z = 8;
    61   oxygen->CovalentRadius = 0.68;
    62   strcpy(oxygen->name, "oxygen");
    63   strcpy(oxygen->symbol, "O");
    64 
    65   // construct periodentafel
    66   tafel = World::getInstance().getPeriode();
    67   tafel->AddElement(hydrogen);
    68   tafel->AddElement(oxygen);
     46  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     47  oxygen = World::getInstance().getPeriode()->FindElement(8);
     48  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     49  CPPUNIT_ASSERT(oxygen != NULL && "could not find element oxygen");
    6950
    7051  // construct molecule (water molecule)
    7152  TestMolecule1 = World::getInstance().createMolecule();
    72   Walker = World::getInstance().createAtom();
     53  CPPUNIT_ASSERT(TestMolecule1 != NULL && "could not create first molecule");
     54  Walker = World::getInstance().createAtom();
     55  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7356  Walker->type = hydrogen;
    7457  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    7558  TestMolecule1->AddAtom(Walker);
    7659  Walker = World::getInstance().createAtom();
     60  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7761  Walker->type = hydrogen;
    7862  *Walker->node = Vector(0.9658, 0., 0. );
    7963  TestMolecule1->AddAtom(Walker);
    8064  Walker = World::getInstance().createAtom();
     65  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8166  Walker->type = oxygen;
    8267  *Walker->node = Vector(0., 0., 0. );
     
    8469
    8570  TestMolecule2 = World::getInstance().createMolecule();
    86   Walker = World::getInstance().createAtom();
     71  CPPUNIT_ASSERT(TestMolecule2 != NULL && "could not create second molecule");
     72  Walker = World::getInstance().createAtom();
     73  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8774  Walker->type = hydrogen;
    8875  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    8976  TestMolecule2->AddAtom(Walker);
    9077  Walker = World::getInstance().createAtom();
     78  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    9179  Walker->type = hydrogen;
    9280  *Walker->node = Vector(0.9658, 0., 0. );
    9381  TestMolecule2->AddAtom(Walker);
    9482  Walker = World::getInstance().createAtom();
     83  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    9584  Walker->type = oxygen;
    9685  *Walker->node = Vector(0., 0., 0. );
     
    9887
    9988  molecules = World::getInstance().getMolecules();
     89  CPPUNIT_ASSERT(molecules != NULL && "could not obtain list of molecules");
    10090  molecules->insert(TestMolecule1);
    10191  molecules->insert(TestMolecule2);
     
    10797  // create a small file with table
    10898  BG = new BondGraph(true);
     99  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    109100
    110101  // construct bond graphs
     
    122113
    123114  World::purgeInstance();
    124   MemoryUsageObserver::purgeInstance();
    125115};
    126116
     
    154144{
    155145  double *mirror = new double[3];
     146  CPPUNIT_ASSERT(mirror != NULL && "could not create array of doubles");
    156147  for (int i=0;i<3;i++)
    157148    mirror[i] = -1.;
  • src/unittests/CountBondsUnitTest.hpp

    ra7b761b r1024cb  
    3939      molecule *TestMolecule1;
    4040      molecule *TestMolecule2;
    41       element *hydrogen;
    42       element *oxygen;
    43       periodentafel *tafel;
     41      const element *hydrogen;
     42      const element *oxygen;
    4443
    4544      BondGraph *BG;
  • src/unittests/LinkedCellUnitTest.cpp

    ra7b761b r1024cb  
    3838  atom *Walker = NULL;
    3939
    40   // init private all pointers to zero
    41   TestMolecule = NULL;
    42   hydrogen = NULL;
    43   tafel = NULL;
    44 
    4540  // construct element
    46   hydrogen = new element;
    47   hydrogen->Z = 1;
    48   hydrogen->CovalentRadius = 0.23;
    49   strcpy(hydrogen->name, "hydrogen");
    50   strcpy(hydrogen->symbol, "H");
    51 
    52   // construct periodentafel
    53   tafel = World::getInstance().getPeriode();
    54   tafel->AddElement(hydrogen);
     41  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     42  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
    5543
    5644  // construct molecule (water molecule)
    5745  TestMolecule = World::getInstance().createMolecule();
     46  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    5847  for (double x=0.5;x<3;x+=1.)
    5948    for (double y=0.5;y<3;y+=1.)
    6049      for (double z=0.5;z<3;z+=1.) {
    6150        Walker = World::getInstance().createAtom();
     51        CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6252        Walker->type = hydrogen;
    6353        *Walker->node = Vector(x, y, z );
     
    6757  // construct linked cell
    6858  LC = new LinkedCell (TestMolecule, 1.);
     59  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
    6960
    7061  // check that TestMolecule was correctly constructed
     
    7768  delete(LC);
    7869  World::purgeInstance();
    79   MemoryUsageObserver::purgeInstance();
    8070};
    8171
  • src/unittests/LinkedCellUnitTest.hpp

    ra7b761b r1024cb  
    4848
    4949      molecule *TestMolecule;
    50       element *hydrogen;
    51       periodentafel *tafel;
     50      const element *hydrogen;
    5251      LinkedCell *LC;
    5352};
  • src/unittests/Makefile.am

    ra7b761b r1024cb  
     1# PLEASE adhere to the alphabetical ordering in this Makefile!
     2# Also indentation by a single tab
     3
    14INCLUDES = -I$(top_srcdir)/src
    25
     
    3033  MemoryAllocatorUnitTest \
    3134  MoleculeDescriptorTest \
     35  ObserverTest \
     36  ParserUnitTest \
     37  periodentafelTest \
    3238  PlaneUnittest \
    33   ObserverTest \
    3439  SingletonTest \
    3540  StackClassUnitTest \
     
    7176  memoryusageobserverunittest.cpp \
    7277  MoleculeDescriptorTest.cpp \
     78  ObserverTest.cpp \
     79  ParserUnitTest.cpp \
     80  periodentafelTest.cpp \
    7381  PlaneUnittest.cpp \
    74   ObserverTest.cpp \
    7582  SingletonTest.cpp \
    7683  stackclassunittest.cpp \
     
    104111  memoryusageobserverunittest.hpp \
    105112  MoleculeDescriptorTest.hpp \
     113  periodentafelTest.hpp \
    106114  PlaneUnittest.hpp \
    107115  ObserverTest.hpp \
     
    114122 
    115123
     124ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
     125ActionSequenceTest_LDADD = ${ALLLIBS}
     126
    116127ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
    117128ActOnAllUnitTest_LDADD = ${ALLLIBS}
     
    132143atomsCalculationTest_LDADD = ${ALLLIBS}
    133144
     145AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
     146AtomDescriptorTest_LDADD = ${ALLLIBS}
     147
    134148BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
    135149BondGraphUnitTest_LDADD = ${ALLLIBS}
    136150
     151CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
     152CacheableTest_LDADD = ${ALLLIBS}
     153
    137154CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp
    138155CountBondsUnitTest_LDADD = ${ALLLIBS}
     
    162179LogUnitTest_LDADD = ${ALLLIBS}
    163180
    164 MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp
     181manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
     182manipulateAtomsTest_LDADD = ${ALLLIBS}
     183
     184MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp ../memoryallocator.hpp ../memoryallocator.cpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp
    165185MemoryAllocatorUnitTest_LDADD = ${ALLLIBS}
    166186
    167 MemoryUsageObserverUnitTest_SOURCES = UnitTestMain.cpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp
     187MemoryUsageObserverUnitTest_SOURCES = UnitTestMain.cpp ../memoryallocator.hpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp
    168188MemoryUsageObserverUnitTest_LDADD = ${ALLLIBS}
    169189
     
    171191MoleculeDescriptorTest_LDADD = ${ALLLIBS}
    172192
     193ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
     194ObserverTest_LDADD = ${ALLLIBS}
     195
     196ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
     197ParserUnitTest_LDADD = ${ALLLIBS}
     198
     199periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
     200periodentafelTest_LDADD = ${ALLLIBS}
     201
    173202PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
    174203PlaneUnittest_LDADD = ${ALLLIBS}
     
    189218Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
    190219
     220TestRunner_SOURCES = TestRunnerMain.cpp ../memoryallocator.hpp ../memoryallocator.cpp ../memoryusageobserver.cpp ../memoryusageobserver.hpp $(TESTSOURCES) $(TESTHEADERS)
     221TestRunner_LDADD = ${ALLLIBS}
     222
    191223VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
    192224VectorUnitTest_LDADD = ${ALLLIBS}
    193225
    194 ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
    195 ActionSequenceTest_LDADD = ${ALLLIBS}
    196 
    197 ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
    198 ObserverTest_LDADD = ${ALLLIBS}
    199 
    200 CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
    201 CacheableTest_LDADD = ${ALLLIBS}
    202 
    203 AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
    204 AtomDescriptorTest_LDADD = ${ALLLIBS}
    205 
    206 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
    207 manipulateAtomsTest_LDADD = ${ALLLIBS}
    208 
    209 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
    210 TestRunner_LDADD = ${ALLLIBS}
    211 
    212226#AUTOMAKE_OPTIONS = parallel-tests
    213 
  • src/unittests/SingletonTest.cpp

    ra7b761b r1024cb  
    5252    count1++;
    5353  }
    54   // explicit copy constructor to catch if thsi is ever called
     54  // explicit copy constructor to catch if this is ever called
    5555  SingletonStub2(const SingletonStub2&){
    5656    CPPUNIT_FAIL    ( "Copy constructor of Singleton called" );
  • src/unittests/TestRunnerMain.cpp

    ra7b761b r1024cb  
    66 */
    77
     8// include config.h
     9#ifdef HAVE_CONFIG_H
     10#include <config.h>
     11#endif
     12
     13#ifdef HAVE_ECUT
    814// give the main function its correct name
    915#define CPPUNIT_MAIN main
    10 
    1116// include the TestRunnerClient file containing the main class
    1217#include "../../../TestRunnerClient.h"
    1318#include "../../../TestRunnerClient.cpp"
     19#else
     20#include "UnitTestMain.cpp"
     21#endif
     22
  • src/unittests/analysisbondsunittest.cpp

    ra7b761b r1024cb  
    4141  atom *Walker = NULL;
    4242
    43   // init private all pointers to zero
    44   TestMolecule = NULL;
    45   hydrogen = NULL;
    46   tafel = NULL;
    47 
    48   // construct element
    49   hydrogen = new element;
    50   hydrogen->Z = 1;
    51   hydrogen->Valence = 1;
    52   hydrogen->NoValenceOrbitals = 1;
    53   strcpy(hydrogen->name, "hydrogen");
    54   strcpy(hydrogen->symbol, "H");
    55   carbon = new element;
    56   carbon->Z = 2;
    57   carbon->Valence = 4;
    58   carbon->NoValenceOrbitals = 4;
    59   strcpy(carbon->name, "carbon");
    60   strcpy(carbon->symbol, "C");
    61 
    62 
    63   // construct periodentafel
    64   tafel = World::getInstance().getPeriode();
    65   tafel->AddElement(hydrogen);
    66   tafel->AddElement(carbon);
     43  // get elements
     44  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     45  carbon = World::getInstance().getPeriode()->FindElement(6);
     46  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     47  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
    6748
    6849  // construct molecule (tetraeder of hydrogens)
    6950  TestMolecule = World::getInstance().createMolecule();
     51  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    7052  Walker = World::getInstance().createAtom();
     53  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7154  Walker->type = hydrogen;
    7255  *Walker->node = Vector(1.5, 0., 1.5 );
    7356  TestMolecule->AddAtom(Walker);
    7457  Walker = World::getInstance().createAtom();
     58  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7559  Walker->type = hydrogen;
    7660  *Walker->node = Vector(0., 1.5, 1.5 );
    7761  TestMolecule->AddAtom(Walker);
    7862  Walker = World::getInstance().createAtom();
     63  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7964  Walker->type = hydrogen;
    8065  *Walker->node = Vector(1.5, 1.5, 0. );
    8166  TestMolecule->AddAtom(Walker);
    8267  Walker = World::getInstance().createAtom();
     68  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8369  Walker->type = hydrogen;
    8470  *Walker->node = Vector(0., 0., 0. );
    8571  TestMolecule->AddAtom(Walker);
    8672  Walker = World::getInstance().createAtom();
     73  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8774  Walker->type = carbon;
    8875  *Walker->node = Vector(0.5, 0.5, 0.5 );
     
    9481  // create a small file with table
    9582  filename = new string("test.dat");
     83  CPPUNIT_ASSERT(filename != NULL && "could not create string");
    9684  ofstream test(filename->c_str());
    97   test << ".\tH\tC\n";
    98   test << "H\t1.\t1.2\n";
    99   test << "C\t1.2\t1.5\n";
     85  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
     86  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
     87  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
     88  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
     89  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
     90  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
     91  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
    10092  test.close();
    10193  BG = new BondGraph(true);
     94  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    10295
    10396  CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
    10497  CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
    105   CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
    106   CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
     98  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
     99  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
    107100
    108101  BG->ConstructBondGraph(TestMolecule);
  • src/unittests/analysisbondsunittest.hpp

    ra7b761b r1024cb  
    3434
    3535      molecule *TestMolecule;
    36       element *hydrogen;
    37       element *carbon;
    38       periodentafel *tafel;
     36      const element *hydrogen;
     37      const element *carbon;
    3938
    4039      BondGraph *BG;
  • src/unittests/bondgraphunittest.cpp

    ra7b761b r1024cb  
    1515#include <stdio.h>
    1616#include <cstring>
     17
     18#include "Helpers/Assert.hpp"
    1719
    1820#include "World.hpp"
     
    4143  atom *Walker = NULL;
    4244
    43   // init private all pointers to zero
    44   TestMolecule = NULL;
    45   hydrogen = NULL;
    46   tafel = NULL;
    47 
    4845  // construct element
    49   hydrogen = new element;
    50   hydrogen->Z = 1;
    51   hydrogen->CovalentRadius = 0.23;
    52   hydrogen->VanDerWaalsRadius = 1.09;
    53   strcpy(hydrogen->name, "hydrogen");
    54   strcpy(hydrogen->symbol, "H");
    55   carbon = new element;
    56   carbon->Z = 2;
    57   carbon->CovalentRadius = 0.68;
    58   carbon->VanDerWaalsRadius = 1.7;
    59   strcpy(carbon->name, "carbon");
    60   strcpy(carbon->symbol, "C");
    61 
    62 
    63   // construct periodentafel
    64   tafel = World::getInstance().getPeriode();
    65   tafel->AddElement(hydrogen);
    66   tafel->AddElement(carbon);
     46  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     47  carbon = World::getInstance().getPeriode()->FindElement(6);
     48  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     49  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
    6750
    6851  // construct molecule (tetraeder of hydrogens)
    6952  TestMolecule = World::getInstance().createMolecule();
     53  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    7054  Walker = World::getInstance().createAtom();
     55  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7156  Walker->type = carbon;
    7257  *Walker->node = Vector(1., 0., 1. );
     
    7459
    7560  Walker = World::getInstance().createAtom();
     61  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7662  Walker->type = carbon;
    7763  *Walker->node = Vector(0., 1., 1. );
     
    7965
    8066  Walker = World::getInstance().createAtom();
     67  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8168  Walker->type = carbon;
    8269  *Walker->node = Vector(1., 1., 0. );
     
    8471
    8572  Walker = World::getInstance().createAtom();
     73  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8674  Walker->type = carbon;
    8775  *Walker->node = Vector(0., 0., 0. );
     
    9381  // create a small file with table
    9482  dummyname = new string("dummy.dat");
     83  CPPUNIT_ASSERT(dummyname != NULL && "could not create string");
    9584  filename = new string("test.dat");
     85  CPPUNIT_ASSERT(filename != NULL && "could not create string");
    9686  ofstream test(filename->c_str());
    97   test << ".\tH\tC\n";
    98   test << "H\t1.\t1.2\n";
    99   test << "C\t1.2\t1.5\n";
     87  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
     88  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
     89  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
     90  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
     91  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
     92  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
     93  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
    10094  test.close();
    10195  BG = new BondGraph(true);
     96  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    10297};
    10398
     
    116111  // are all cleaned when the world is destroyed
    117112  World::purgeInstance();
    118   MemoryUsageObserver::purgeInstance();
    119113  logger::purgeInstance();
    120114};
     
    134128  CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
    135129  CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
    136   CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
    137   CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
     130  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
     131  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
    138132};
    139133
  • src/unittests/bondgraphunittest.hpp

    ra7b761b r1024cb  
    3939
    4040      molecule *TestMolecule;
    41       element *hydrogen;
    42       element *carbon;
    43       periodentafel *tafel;
     41      const element *hydrogen;
     42      const element *carbon;
    4443
    4544      BondGraph *BG;
  • src/unittests/listofbondsunittest.cpp

    ra7b761b r1024cb  
    3838  atom *Walker = NULL;
    3939
    40   // init private all pointers to zero
    41   TestMolecule = NULL;
    42   hydrogen = NULL;
    43   tafel = NULL;
    44 
    4540  // construct element
    46   hydrogen = new element;
    47   hydrogen->Z = 1;
    48   strcpy(hydrogen->name, "hydrogen");
    49   strcpy(hydrogen->symbol, "H");
    50 
    51 
    52   // construct periodentafel
    53   tafel = World::getInstance().getPeriode();
    54   tafel->AddElement(hydrogen);
     41  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     42  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
    5543
    5644  // construct molecule (tetraeder of hydrogens)
    5745  TestMolecule = World::getInstance().createMolecule();
    58   Walker = World::getInstance().createAtom();
     46  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
     47  Walker = World::getInstance().createAtom();
     48  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5949  Walker->type = hydrogen;
    6050  *Walker->node = Vector(1., 0., 1. );
    6151  TestMolecule->AddAtom(Walker);
    6252  Walker = World::getInstance().createAtom();
     53  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6354  Walker->type = hydrogen;
    6455  *Walker->node = Vector(0., 1., 1. );
    6556  TestMolecule->AddAtom(Walker);
    6657  Walker = World::getInstance().createAtom();
     58  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6759  Walker->type = hydrogen;
    6860  *Walker->node = Vector(1., 1., 0. );
    6961  TestMolecule->AddAtom(Walker);
    7062  Walker = World::getInstance().createAtom();
     63  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7164  Walker->type = hydrogen;
    7265  *Walker->node = Vector(0., 0., 0. );
     
    7568  // check that TestMolecule was correctly constructed
    7669  CPPUNIT_ASSERT_EQUAL( TestMolecule->getAtomCount(), 4 );
    77 
    7870};
    7971
     
    8678  // are all cleaned when the world is destroyed
    8779  World::purgeInstance();
    88   MemoryUsageObserver::purgeInstance();
    8980  logger::purgeInstance();
    9081};
  • src/unittests/listofbondsunittest.hpp

    ra7b761b r1024cb  
    4343
    4444      molecule *TestMolecule;
    45       element *hydrogen;
    46       periodentafel *tafel;
     45      const element *hydrogen;
    4746};
    4847
  • src/unittests/memoryallocatorunittest.cpp

    ra7b761b r1024cb  
    1212#include "memoryallocator.hpp"
    1313#include "memoryallocatorunittest.hpp"
     14#include "memoryusageobserver.hpp"
    1415#include "helpers.hpp"
    1516#include "log.hpp"
  • src/unittests/stackclassunittest.cpp

    ra7b761b r1024cb  
    3737  Stack->ClearStack();
    3838  delete(Stack);
    39   MemoryUsageObserver::purgeInstance();
    4039  logger::purgeInstance();
    4140};
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    ra7b761b r1024cb  
    7070    delete tesselpoints[i];
    7171  }
    72   MemoryUsageObserver::purgeInstance();
    7372  logger::purgeInstance();
    7473  errorLogger::purgeInstance();
  • src/unittests/tesselation_insideoutsideunittest.cpp

    ra7b761b r1024cb  
    134134  }
    135135  Corners.clear();
    136   MemoryUsageObserver::purgeInstance();
    137136  logger::purgeInstance();
    138137  errorLogger::purgeInstance();
  • src/unittests/tesselationunittest.cpp

    ra7b761b r1024cb  
    106106  }
    107107  Corners.clear();
    108   MemoryUsageObserver::purgeInstance();
    109108  logger::purgeInstance();
    110109  errorLogger::purgeInstance();
  • src/unittests/vectorunittest.cpp

    ra7b761b r1024cb  
    4949void VectorTest::tearDown()
    5050{
    51   MemoryUsageObserver::purgeInstance();
    5251  logger::purgeInstance();
    5352  errorLogger::purgeInstance();
  • src/vector.cpp

    ra7b761b r1024cb  
    543543  // truncate to [0,1] for each axis
    544544  for (int i=0;i<NDIM;i++) {
    545     x[i] += 0.5;  // set to center of box
     545    //x[i] += 0.5;  // set to center of box
    546546    while (x[i] >= 1.)
    547547      x[i] -= 1.;
  • tests/Makefile.am

    ra7b761b r1024cb  
    1 AUTOM4TE = autom4te
    2 EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in regression
    3 TESTSUITE = $(srcdir)/testsuite
     1SUBDIRS = regression Tesselations
    42
    5 SUBDIRS = Tesselations
    6 
    7 check-local: atconfig atlocal package.m4 $(TESTSUITE)
    8                 $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
    9 
    10 installcheck-local: atconfig atlocal $(TESTSUITE)
    11                 $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
    12                 $(TESTSUITEFLAGS)
    13      
    14 clean-local:
    15                 test ! -f '$(TESTSUITE)' || \
    16                 $(SHELL) '$(TESTSUITE)' --clean
    17 
    18 AUTOTEST = $(AUTOM4TE) --language=autotest
    19 $(TESTSUITE): $(srcdir)/testsuite.at
    20                 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
    21                 mv $@.tmp $@
    22 
    23 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
    24 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
    25                         :;{ \
    26                                         echo '# Signature of the current package.' && \
    27                                         echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])' && \
    28                                         echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])' && \
    29                                         echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])' && \
    30                                         echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])' && \
    31                                         echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
    32                                 } >'$(srcdir)/package.m4'
  • tests/Tesselations/defs.in

    ra7b761b r1024cb  
    3030        CLEANUP="$CLEANUP; rm -rf $testdir"
    3131        cp -r @srcdir@/$testdir/* $testdir/
    32         cd $testdir
    3332        CLEANUP="rm -f stderr stdout diffstderr diffstdout; cd ..; $CLEANUP"
    3433        CLEANUP="rm -f *.conf*; rm -f NonConvexEnvelope*; rm -f ${testdir}.xyz; rm -f ${testdir}.dbond; $CLEANUP"
     
    5251        FILENAME="NonConvexEnvelope"
    5352        exitcode=0
    54         cd $RADIUS
     53        cd $testdir/$RADIUS
    5554        #echo "Current dir is `pwd`, calling $MOLECUILDER $mol.conf -e $exec_prefix -p ../$mol.xyz -N $RADIUS $FILENAME."
    5655        if [ -e $mol.dbond ]; then
     
    6261        #cat stderr
    6362        #cat stdout
    64         diff ${FILENAME}.dat ../@srcdir@/$mol/$2/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$?
     63        grep -E "^[0-9]* [0-9]* [0-9]*$" ../../../../../molecuilder/tests/Tesselations/$mol/$2/${FILENAME}-$mol.dat | sort -n >reference-triangles.dat
     64        grep -E "^[0-9]* [0-9]* [0-9]*$" ${FILENAME}.dat | sort -n >new-triangles.dat
     65        diff reference-triangles.dat new-triangles.dat 2>diffstderr >diffstdout || exitcode=$?
    6566        #echo "Diff done with exitcode $exitcode."
    6667        #cat diffstderr
    6768        #cat diffstdout
    68         cd ..
     69        cd ../..
    6970        test $exitcode = $expected_exitcode || exit 1
    7071}
  • tests/regression/Tesselation/1/post/NonConvexEnvelope.r3d

    ra7b761b r1024cb  
    33# All atoms as spheres
    442
    5   1.37419 -0.26503 -4.44089e-16         0.1     1. 1. 1.
     5  1.24926 -0.240937 -4.44089e-16        0.1     1. 1. 1.
    662
    7   0.12489 0.61837 -4.44089e-16  0.1     1. 1. 1.
     7  -3.63639e-05 0.642463 -4.44089e-16    0.1     1. 1. 1.
    882
    9   -1.12431 -0.26503 -4.44089e-16        0.1     1. 1. 1.
     9  -1.24924 -0.240937 -4.44089e-16       0.1     1. 1. 1.
    10102
    11   1.37419 -0.89433 -0.89        0.1     1. 1. 1.
     11  1.24926 -0.870237 -0.89       0.1     1. 1. 1.
    12122
    13   1.37419 -0.89433 0.89         0.1     1. 1. 1.
     13  1.24926 -0.870237 0.89        0.1     1. 1. 1.
    14142
    15   2.26414 0.364321 -4.44089e-16         0.1     1. 1. 1.
     15  2.13922 0.388414 -4.44089e-16         0.1     1. 1. 1.
    16162
    17   0.12489 1.24767 -0.89         0.1     1. 1. 1.
     17  -3.63639e-05 1.27176 -0.89    0.1     1. 1. 1.
    18182
    19   0.12489 1.24767 0.89  0.1     1. 1. 1.
     19  -3.63639e-05 1.27176 0.89     0.1     1. 1. 1.
    20202
    21   -2.01426 0.364321 -4.44089e-16        0.1     1. 1. 1.
     21  -2.13919 0.388414 -4.44089e-16        0.1     1. 1. 1.
    22222
    23   -1.12431 -0.89433 -0.89       0.1     1. 1. 1.
     23  -1.24924 -0.870237 -0.89      0.1     1. 1. 1.
    24242
    25   -1.12431 -0.89433 0.89        0.1     1. 1. 1.
     25  -1.24924 -0.870237 0.89       0.1     1. 1. 1.
    2626# All tesselation triangles
    27278
     
    3030  BACKFACE  0.3 0.3 1.0   0 0
    31311
    32   1.37419 -0.89433 -0.89        2.26414 0.364321 -4.44089e-16   0.12489 1.24767 -0.89   1. 0. 0.
     32  1.24926 -0.870237 -0.89       2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 -0.89      1. 0. 0.
    33331
    34   1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     34  1.24926 -0.870237 -0.89       -3.63639e-05 1.27176 -0.89      -1.24924 -0.870237 -0.89        1. 0. 0.
    35351
    36   0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
     36  -3.63639e-05 1.27176 -0.89    -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 -0.89        1. 0. 0.
    37371
    38   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
     38  2.13922 0.388414 -4.44089e-16         -3.63639e-05 1.27176 -0.89      -3.63639e-05 1.27176 0.89       1. 0. 0.
    39391
    40   0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
     40  -3.63639e-05 1.27176 -0.89    -3.63639e-05 1.27176 0.89       -2.13919 0.388414 -4.44089e-16  1. 0. 0.
    41411
    42   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     42  1.24926 -0.870237 0.89        2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 0.89       1. 0. 0.
    43431
    44   1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
     44  1.24926 -0.870237 0.89        -3.63639e-05 1.27176 0.89       -1.24924 -0.870237 0.89         1. 0. 0.
    45451
    46   0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     46  -3.63639e-05 1.27176 0.89     -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 0.89         1. 0. 0.
    47471
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     48  -2.13919 0.388414 -4.44089e-16        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    49491
    50   1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     50  1.24926 -0.870237 0.89        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    51511
    52   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     52  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  -1.24924 -0.870237 -0.89        1. 0. 0.
    53531
    54   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     54  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  2.13922 0.388414 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   1.67084 -0.47478 -8.88178e-16 5       1 0 0
     61  1.54591 -0.450686 -8.88178e-16        5       1 0 0
    62629
    6363  terminating special property
  • tests/regression/Tesselation/2/post/ConvexEnvelope.r3d

    ra7b761b r1024cb  
    33# All atoms as spheres
    442
    5   1.37419 -0.26503 -4.44089e-16         0.1     1. 1. 1.
     5  1.24926 -0.240937 -4.44089e-16        0.1     1. 1. 1.
    662
    7   0.12489 0.61837 -4.44089e-16  0.1     1. 1. 1.
     7  -3.63639e-05 0.642463 -4.44089e-16    0.1     1. 1. 1.
    882
    9   -1.12431 -0.26503 -4.44089e-16        0.1     1. 1. 1.
     9  -1.24924 -0.240937 -4.44089e-16       0.1     1. 1. 1.
    10102
    11   1.37419 -0.89433 -0.89        0.1     1. 1. 1.
     11  1.24926 -0.870237 -0.89       0.1     1. 1. 1.
    12122
    13   1.37419 -0.89433 0.89         0.1     1. 1. 1.
     13  1.24926 -0.870237 0.89        0.1     1. 1. 1.
    14142
    15   2.26414 0.364321 -4.44089e-16         0.1     1. 1. 1.
     15  2.13922 0.388414 -4.44089e-16         0.1     1. 1. 1.
    16162
    17   0.12489 1.24767 -0.89         0.1     1. 1. 1.
     17  -3.63639e-05 1.27176 -0.89    0.1     1. 1. 1.
    18182
    19   0.12489 1.24767 0.89  0.1     1. 1. 1.
     19  -3.63639e-05 1.27176 0.89     0.1     1. 1. 1.
    20202
    21   -2.01426 0.364321 -4.44089e-16        0.1     1. 1. 1.
     21  -2.13919 0.388414 -4.44089e-16        0.1     1. 1. 1.
    22222
    23   -1.12431 -0.89433 -0.89       0.1     1. 1. 1.
     23  -1.24924 -0.870237 -0.89      0.1     1. 1. 1.
    24242
    25   -1.12431 -0.89433 0.89        0.1     1. 1. 1.
     25  -1.24924 -0.870237 0.89       0.1     1. 1. 1.
    2626# All tesselation triangles
    27278
     
    3030  BACKFACE  0.3 0.3 1.0   0 0
    31311
    32   1.37419 -0.89433 -0.89        2.26414 0.364321 -4.44089e-16   0.12489 1.24767 -0.89   1. 0. 0.
     32  1.24926 -0.870237 -0.89       2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 -0.89      1. 0. 0.
    33331
    34   1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     34  1.24926 -0.870237 -0.89       -3.63639e-05 1.27176 -0.89      -1.24924 -0.870237 -0.89        1. 0. 0.
    35351
    36   0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
     36  -3.63639e-05 1.27176 -0.89    -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 -0.89        1. 0. 0.
    37371
    38   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
     38  2.13922 0.388414 -4.44089e-16         -3.63639e-05 1.27176 -0.89      -3.63639e-05 1.27176 0.89       1. 0. 0.
    39391
    40   0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
     40  -3.63639e-05 1.27176 -0.89    -3.63639e-05 1.27176 0.89       -2.13919 0.388414 -4.44089e-16  1. 0. 0.
    41411
    42   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     42  1.24926 -0.870237 0.89        2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 0.89       1. 0. 0.
    43431
    44   1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
     44  1.24926 -0.870237 0.89        -3.63639e-05 1.27176 0.89       -1.24924 -0.870237 0.89         1. 0. 0.
    45451
    46   0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     46  -3.63639e-05 1.27176 0.89     -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 0.89         1. 0. 0.
    47471
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     48  -2.13919 0.388414 -4.44089e-16        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    49491
    50   1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     50  1.24926 -0.870237 0.89        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    51511
    52   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     52  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  -1.24924 -0.870237 -0.89        1. 0. 0.
    53531
    54   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     54  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  2.13922 0.388414 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   1.67084 -0.47478 -8.88178e-16 5       1 0 0
     61  1.54591 -0.450686 -8.88178e-16        5       1 0 0
    62629
    6363  terminating special property
  • tests/regression/Tesselation/2/post/NonConvexEnvelope.r3d

    ra7b761b r1024cb  
    33# All atoms as spheres
    442
    5   1.37419 -0.26503 -4.44089e-16         0.1     1. 1. 1.
     5  1.24926 -0.240937 -4.44089e-16        0.1     1. 1. 1.
    662
    7   0.12489 0.61837 -4.44089e-16  0.1     1. 1. 1.
     7  -3.63639e-05 0.642463 -4.44089e-16    0.1     1. 1. 1.
    882
    9   -1.12431 -0.26503 -4.44089e-16        0.1     1. 1. 1.
     9  -1.24924 -0.240937 -4.44089e-16       0.1     1. 1. 1.
    10102
    11   1.37419 -0.89433 -0.89        0.1     1. 1. 1.
     11  1.24926 -0.870237 -0.89       0.1     1. 1. 1.
    12122
    13   1.37419 -0.89433 0.89         0.1     1. 1. 1.
     13  1.24926 -0.870237 0.89        0.1     1. 1. 1.
    14142
    15   2.26414 0.364321 -4.44089e-16         0.1     1. 1. 1.
     15  2.13922 0.388414 -4.44089e-16         0.1     1. 1. 1.
    16162
    17   0.12489 1.24767 -0.89         0.1     1. 1. 1.
     17  -3.63639e-05 1.27176 -0.89    0.1     1. 1. 1.
    18182
    19   0.12489 1.24767 0.89  0.1     1. 1. 1.
     19  -3.63639e-05 1.27176 0.89     0.1     1. 1. 1.
    20202
    21   -2.01426 0.364321 -4.44089e-16        0.1     1. 1. 1.
     21  -2.13919 0.388414 -4.44089e-16        0.1     1. 1. 1.
    22222
    23   -1.12431 -0.89433 -0.89       0.1     1. 1. 1.
     23  -1.24924 -0.870237 -0.89      0.1     1. 1. 1.
    24242
    25   -1.12431 -0.89433 0.89        0.1     1. 1. 1.
     25  -1.24924 -0.870237 0.89       0.1     1. 1. 1.
    2626# All tesselation triangles
    27278
     
    3030  BACKFACE  0.3 0.3 1.0   0 0
    31311
    32   1.37419 -0.89433 -0.89        2.26414 0.364321 -4.44089e-16   0.12489 1.24767 -0.89   1. 0. 0.
     32  1.24926 -0.870237 -0.89       2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 -0.89      1. 0. 0.
    33331
    34   1.37419 -0.89433 -0.89        0.12489 1.24767 -0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     34  1.24926 -0.870237 -0.89       -3.63639e-05 1.27176 -0.89      -1.24924 -0.870237 -0.89        1. 0. 0.
    35351
    36   0.12489 1.24767 -0.89         -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 -0.89         1. 0. 0.
     36  -3.63639e-05 1.27176 -0.89    -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 -0.89        1. 0. 0.
    37371
    38   2.26414 0.364321 -4.44089e-16         0.12489 1.24767 -0.89   0.12489 1.24767 0.89    1. 0. 0.
     38  2.13922 0.388414 -4.44089e-16         -3.63639e-05 1.27176 -0.89      -3.63639e-05 1.27176 0.89       1. 0. 0.
    39391
    40   0.12489 1.24767 -0.89         0.12489 1.24767 0.89    -2.01426 0.364321 -4.44089e-16  1. 0. 0.
     40  -3.63639e-05 1.27176 -0.89    -3.63639e-05 1.27176 0.89       -2.13919 0.388414 -4.44089e-16  1. 0. 0.
    41411
    42   1.37419 -0.89433 0.89         2.26414 0.364321 -4.44089e-16   0.12489 1.24767 0.89    1. 0. 0.
     42  1.24926 -0.870237 0.89        2.13922 0.388414 -4.44089e-16   -3.63639e-05 1.27176 0.89       1. 0. 0.
    43431
    44   1.37419 -0.89433 0.89         0.12489 1.24767 0.89    -1.12431 -0.89433 0.89  1. 0. 0.
     44  1.24926 -0.870237 0.89        -3.63639e-05 1.27176 0.89       -1.24924 -0.870237 0.89         1. 0. 0.
    45451
    46   0.12489 1.24767 0.89  -2.01426 0.364321 -4.44089e-16  -1.12431 -0.89433 0.89  1. 0. 0.
     46  -3.63639e-05 1.27176 0.89     -2.13919 0.388414 -4.44089e-16  -1.24924 -0.870237 0.89         1. 0. 0.
    47471
    48   -2.01426 0.364321 -4.44089e-16        -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     48  -2.13919 0.388414 -4.44089e-16        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    49491
    50   1.37419 -0.89433 0.89         -1.12431 -0.89433 -0.89         -1.12431 -0.89433 0.89  1. 0. 0.
     50  1.24926 -0.870237 0.89        -1.24924 -0.870237 -0.89        -1.24924 -0.870237 0.89         1. 0. 0.
    51511
    52   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   -1.12431 -0.89433 -0.89         1. 0. 0.
     52  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  -1.24924 -0.870237 -0.89        1. 0. 0.
    53531
    54   1.37419 -0.89433 -0.89        1.37419 -0.89433 0.89   2.26414 0.364321 -4.44089e-16   1. 0. 0.
     54  1.24926 -0.870237 -0.89       1.24926 -0.870237 0.89  2.13922 0.388414 -4.44089e-16   1. 0. 0.
    55559
    5656#  terminating special property
     
    5959  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    60602
    61   1.67084 -0.47478 -8.88178e-16 5       1 0 0
     61  1.54591 -0.450686 -8.88178e-16        5       1 0 0
    62629
    6363  terminating special property
  • tests/regression/Tesselation/3/post/NonConvexEnvelope.r3d

    ra7b761b r1024cb  
    33# All atoms as spheres
    442
    5   0.952534 -3.05798 0.420171    0.1     1. 1. 1.
    6 2
    7   -0.139866 -1.98848 0.359771   0.1     1. 1. 1.
    8 2
    9   0.0788342 -1.07508 -0.875229  0.1     1. 1. 1.
    10 2
    11   -1.49147 -2.63828 0.0780712   0.1     1. 1. 1.
    12 2
    13   -0.0588658 -1.09478 1.58347   0.1     1. 1. 1.
    14 2
    15   1.53473 -0.644479 -0.868129   0.1     1. 1. 1.
    16 2
    17   -0.333166 -2.00128 -2.02443   0.1     1. 1. 1.
    18 2
    19   -2.62147 -1.78218 0.653571    0.1     1. 1. 1.
    20 2
    21   -1.60077 -2.70398 -1.46563    0.1     1. 1. 1.
    22 2
    23   1.37913 -0.560579 1.65607     0.1     1. 1. 1.
    24 2
    25   1.75933 0.205421 0.395371     0.1     1. 1. 1.
    26 2
    27   1.79893 0.246421 -2.08883     0.1     1. 1. 1.
    28 2
    29   -2.64037 -0.423279 -0.0491288         0.1     1. 1. 1.
    30 2
    31   -3.96017 -2.48928 0.432671    0.1     1. 1. 1.
    32 2
    33   3.23013 0.593821 0.484471     0.1     1. 1. 1.
    34 2
    35   3.14803 0.889821 -1.96833     0.1     1. 1. 1.
    36 2
    37   -3.79507 0.418021 0.498371    0.1     1. 1. 1.
    38 2
    39   3.36023 1.76962 1.45487       0.1     1. 1. 1.
    40 2
    41   3.78273 1.01752 -0.849429     0.1     1. 1. 1.
    42 2
    43   4.07093 -0.563879 1.01767     0.1     1. 1. 1.
    44 2
    45   -3.81397 1.77692 -0.204329    0.1     1. 1. 1.
    46 2
    47   5.17783 1.62112 -0.842829     0.1     1. 1. 1.
    48 2
    49   5.49863 -0.464179 0.482071    0.1     1. 1. 1.
    50 2
    51   -4.96867 2.61822 0.343171     0.1     1. 1. 1.
    52 2
    53   5.93083 0.990421 0.337371     0.1     1. 1. 1.
    54 2
    55   -4.98757 3.97722 -0.359529    0.1     1. 1. 1.
    56 2
    57   -6.29237 1.89422 0.0890712    0.1     1. 1. 1.
    58 2
    59   7.33693 1.04442 0.0886712     0.1     1. 1. 1.
    60 2
    61   0.790434 -3.69418 1.29027     0.1     1. 1. 1.
    62 2
    63   0.917634 -3.66448 -0.484829   0.1     1. 1. 1.
    64 2
    65   1.92773 -2.57738 0.498071     0.1     1. 1. 1.
    66 2
    67   -0.574266 -0.203779 -0.824729         0.1     1. 1. 1.
    68 2
    69   -1.52417 -3.64138 0.503471    0.1     1. 1. 1.
    70 2
    71   -0.759066 -0.265179 1.48487   0.1     1. 1. 1.
    72 2
    73   -0.287266 -1.67078 2.48017    0.1     1. 1. 1.
    74 2
    75   2.19193 -1.51408 -0.867629    0.1     1. 1. 1.
    76 2
    77   -0.573766 -1.42458 -2.91753   0.1     1. 1. 1.
    78 2
    79   0.450934 -2.72908 -2.23353    0.1     1. 1. 1.
    80 2
    81   -2.45927 -1.63678 1.72157     0.1     1. 1. 1.
    82 2
    83   -1.62867 -3.74268 -1.79493    0.1     1. 1. 1.
    84 2
    85   -2.49667 -2.18078 -1.79993    0.1     1. 1. 1.
    86 2
    87   1.46453 0.112321 2.50927      0.1     1. 1. 1.
    88 2
    89   2.06173 -1.39848 1.79787      0.1     1. 1. 1.
    90 2
    91   1.15633 1.11082 0.326671      0.1     1. 1. 1.
    92 2
    93   1.76663 -0.360379 -2.99373    0.1     1. 1. 1.
    94 2
    95   1.03283 1.01972 -2.14533      0.1     1. 1. 1.
    96 2
    97   -1.69727 0.0925205 0.131971   0.1     1. 1. 1.
    98 2
    99   -2.77417 -0.570279 -1.12083   0.1     1. 1. 1.
    100 2
    101   -4.75167 -1.93408 0.935971    0.1     1. 1. 1.
    102 2
    103   -4.17327 -2.53828 -0.635229   0.1     1. 1. 1.
    104 2
    105   -3.90927 -3.49908 0.839771    0.1     1. 1. 1.
    106 2
    107   3.62023 1.25552 -2.86813      0.1     1. 1. 1.
    108 2
    109   -4.73807 -0.0977795 0.317371  0.1     1. 1. 1.
    110 2
    111   -3.66127 0.565021 1.57007     0.1     1. 1. 1.
    112 2
    113   3.24233 1.41142 2.47757       0.1     1. 1. 1.
    114 2
    115   4.34293 2.22742 1.34117       0.1     1. 1. 1.
    116 2
    117   2.58823 2.50762 1.23707       0.1     1. 1. 1.
    118 2
    119   4.08983 -0.525479 2.10687     0.1     1. 1. 1.
    120 2
    121   3.62993 -1.50808 0.698371     0.1     1. 1. 1.
    122 2
    123   -2.87097 2.29272 -0.0233288   0.1     1. 1. 1.
    124 2
    125   -3.94777 1.63002 -1.27603     0.1     1. 1. 1.
    126 2
    127   5.68853 1.38852 -1.77723      0.1     1. 1. 1.
    128 2
    129   5.11553 2.70122 -0.710229     0.1     1. 1. 1.
    130 2
    131   6.17523 -0.969279 1.17127     0.1     1. 1. 1.
    132 2
    133   5.55043 -0.952879 -0.490929   0.1     1. 1. 1.
    134 2
    135   -4.83487 2.76522 1.41487      0.1     1. 1. 1.
    136 2
    137   5.70193 1.54062 1.25007       0.1     1. 1. 1.
    138 2
    139   -5.81017 4.57652 0.0304712    0.1     1. 1. 1.
    140 2
    141   -4.04457 4.49292 -0.178529    0.1     1. 1. 1.
    142 2
    143   -5.12137 3.83022 -1.43123     0.1     1. 1. 1.
    144 2
    145   -6.27887 0.926121 0.589671    0.1     1. 1. 1.
    146 2
    147   -7.11497 2.49352 0.479071     0.1     1. 1. 1.
    148 2
    149   -6.42617 1.74722 -0.982629    0.1     1. 1. 1.
    150 2
    151   7.56833 1.97852 -0.00632877   0.1     1. 1. 1.
     5  0.939662 -3.01666 0.414493    0.1     1. 1. 1.
     62
     7  -0.152738 -1.94716 0.354093   0.1     1. 1. 1.
     82
     9  0.0659622 -1.03376 -0.880907  0.1     1. 1. 1.
     102
     11  -1.50434 -2.59696 0.0723932   0.1     1. 1. 1.
     122
     13  -0.0717378 -1.05346 1.57779   0.1     1. 1. 1.
     142
     15  1.52186 -0.603155 -0.873807   0.1     1. 1. 1.
     162
     17  -0.346038 -1.95996 -2.03011   0.1     1. 1. 1.
     182
     19  -2.63434 -1.74086 0.647893    0.1     1. 1. 1.
     202
     21  -1.61364 -2.66266 -1.47131    0.1     1. 1. 1.
     222
     23  1.36626 -0.519255 1.65039     0.1     1. 1. 1.
     242
     25  1.74646 0.246745 0.389693     0.1     1. 1. 1.
     262
     27  1.78606 0.287745 -2.09451     0.1     1. 1. 1.
     282
     29  -2.65324 -0.381955 -0.0548068         0.1     1. 1. 1.
     302
     31  -3.97304 -2.44796 0.426993    0.1     1. 1. 1.
     322
     33  3.21726 0.635145 0.478793     0.1     1. 1. 1.
     342
     35  3.13516 0.931145 -1.97401     0.1     1. 1. 1.
     362
     37  -3.80794 0.459345 0.492693    0.1     1. 1. 1.
     382
     39  3.34736 1.81094 1.44919       0.1     1. 1. 1.
     402
     41  3.76986 1.05884 -0.855107     0.1     1. 1. 1.
     422
     43  4.05806 -0.522555 1.01199     0.1     1. 1. 1.
     442
     45  -3.82684 1.81824 -0.210007    0.1     1. 1. 1.
     462
     47  5.16496 1.66244 -0.848507     0.1     1. 1. 1.
     482
     49  5.48576 -0.422855 0.476393    0.1     1. 1. 1.
     502
     51  -4.98154 2.65954 0.337493     0.1     1. 1. 1.
     522
     53  5.91796 1.03174 0.331693      0.1     1. 1. 1.
     542
     55  -5.00044 4.01854 -0.365207    0.1     1. 1. 1.
     562
     57  -6.30524 1.93554 0.0833932    0.1     1. 1. 1.
     582
     59  7.32406 1.08574 0.0829932     0.1     1. 1. 1.
     602
     61  0.777562 -3.65286 1.28459     0.1     1. 1. 1.
     622
     63  0.904762 -3.62316 -0.490507   0.1     1. 1. 1.
     642
     65  1.91486 -2.53606 0.492393     0.1     1. 1. 1.
     662
     67  -0.587138 -0.162455 -0.830407         0.1     1. 1. 1.
     682
     69  -1.53704 -3.60006 0.497793    0.1     1. 1. 1.
     702
     71  -0.771938 -0.223855 1.47919   0.1     1. 1. 1.
     722
     73  -0.300138 -1.62946 2.47449    0.1     1. 1. 1.
     742
     75  2.17906 -1.47276 -0.873307    0.1     1. 1. 1.
     762
     77  -0.586638 -1.38326 -2.92321   0.1     1. 1. 1.
     782
     79  0.438062 -2.68776 -2.23921    0.1     1. 1. 1.
     802
     81  -2.47214 -1.59546 1.71589     0.1     1. 1. 1.
     822
     83  -1.64154 -3.70136 -1.80061    0.1     1. 1. 1.
     842
     85  -2.50954 -2.13946 -1.80561    0.1     1. 1. 1.
     862
     87  1.45166 0.153645 2.50359      0.1     1. 1. 1.
     882
     89  2.04886 -1.35716 1.79219      0.1     1. 1. 1.
     902
     91  1.14346 1.15214 0.320993      0.1     1. 1. 1.
     922
     93  1.75376 -0.319055 -2.99941    0.1     1. 1. 1.
     942
     95  1.01996 1.06104 -2.15101      0.1     1. 1. 1.
     962
     97  -1.71014 0.133845 0.126293    0.1     1. 1. 1.
     982
     99  -2.78704 -0.528955 -1.12651   0.1     1. 1. 1.
     1002
     101  -4.76454 -1.89276 0.930293    0.1     1. 1. 1.
     1022
     103  -4.18614 -2.49696 -0.640907   0.1     1. 1. 1.
     1042
     105  -3.92214 -3.45776 0.834093    0.1     1. 1. 1.
     1062
     107  3.60736 1.29684 -2.87381      0.1     1. 1. 1.
     1082
     109  -4.75094 -0.0564554 0.311693  0.1     1. 1. 1.
     1102
     111  -3.67414 0.606345 1.56439     0.1     1. 1. 1.
     1122
     113  3.22946 1.45274 2.47189       0.1     1. 1. 1.
     1142
     115  4.33006 2.26874 1.33549       0.1     1. 1. 1.
     1162
     117  2.57536 2.54894 1.23139       0.1     1. 1. 1.
     1182
     119  4.07696 -0.484155 2.10119     0.1     1. 1. 1.
     1202
     121  3.61706 -1.46676 0.692693     0.1     1. 1. 1.
     1222
     123  -2.88384 2.33404 -0.0290068   0.1     1. 1. 1.
     1242
     125  -3.96064 1.67134 -1.28171     0.1     1. 1. 1.
     1262
     127  5.67566 1.42984 -1.78291      0.1     1. 1. 1.
     1282
     129  5.10266 2.74254 -0.715907     0.1     1. 1. 1.
     1302
     131  6.16236 -0.927955 1.16559     0.1     1. 1. 1.
     1322
     133  5.53756 -0.911555 -0.496607   0.1     1. 1. 1.
     1342
     135  -4.84774 2.80654 1.40919      0.1     1. 1. 1.
     1362
     137  5.68906 1.58194 1.24439       0.1     1. 1. 1.
     1382
     139  -5.82304 4.61784 0.0247932    0.1     1. 1. 1.
     1402
     141  -4.05744 4.53424 -0.184207    0.1     1. 1. 1.
     1422
     143  -5.13424 3.87154 -1.43691     0.1     1. 1. 1.
     1442
     145  -6.29174 0.967445 0.583993    0.1     1. 1. 1.
     1462
     147  -7.12784 2.53484 0.473393     0.1     1. 1. 1.
     1482
     149  -6.43904 1.78854 -0.988307    0.1     1. 1. 1.
     1502
     151  7.55546 2.01984 -0.0120068    0.1     1. 1. 1.
    152152# All tesselation triangles
    1531538
     
    156156  BACKFACE  0.3 0.3 1.0   0 0
    1571571
    158   7.33693 1.04442 0.0886712     5.68853 1.38852 -1.77723        7.56833 1.97852 -0.00632877     1. 0. 0.
    159 1
    160   7.33693 1.04442 0.0886712     5.68853 1.38852 -1.77723        5.55043 -0.952879 -0.490929     1. 0. 0.
    161 1
    162   7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
    163 1
    164   3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.55043 -0.952879 -0.490929     1. 0. 0.
    165 1
    166   1.76663 -0.360379 -2.99373    3.62023 1.25552 -2.86813        5.55043 -0.952879 -0.490929     1. 0. 0.
    167 1
    168   2.19193 -1.51408 -0.867629    1.76663 -0.360379 -2.99373      5.55043 -0.952879 -0.490929     1. 0. 0.
    169 1
    170   2.19193 -1.51408 -0.867629    0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
    171 1
    172   0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      0.450934 -2.72908 -2.23353      1. 0. 0.
    173 1
    174   0.917634 -3.66448 -0.484829   2.19193 -1.51408 -0.867629      5.55043 -0.952879 -0.490929     1. 0. 0.
    175 1
    176   0.917634 -3.66448 -0.484829   1.92773 -2.57738 0.498071       5.55043 -0.952879 -0.490929     1. 0. 0.
    177 1
    178   1.92773 -2.57738 0.498071     3.62993 -1.50808 0.698371       5.55043 -0.952879 -0.490929     1. 0. 0.
    179 1
    180   3.62993 -1.50808 0.698371     6.17523 -0.969279 1.17127       5.55043 -0.952879 -0.490929     1. 0. 0.
    181 1
    182   0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     1.92773 -2.57738 0.498071       1. 0. 0.
    183 1
    184   0.790434 -3.69418 1.29027     1.92773 -2.57738 0.498071       3.62993 -1.50808 0.698371       1. 0. 0.
    185 1
    186   0.790434 -3.69418 1.29027     2.06173 -1.39848 1.79787        3.62993 -1.50808 0.698371       1. 0. 0.
    187 1
    188   2.06173 -1.39848 1.79787      4.08983 -0.525479 2.10687       3.62993 -1.50808 0.698371       1. 0. 0.
    189 1
    190   4.08983 -0.525479 2.10687     3.62993 -1.50808 0.698371       6.17523 -0.969279 1.17127       1. 0. 0.
    191 1
    192   0.790434 -3.69418 1.29027     -0.287266 -1.67078 2.48017      2.06173 -1.39848 1.79787        1. 0. 0.
    193 1
    194   -0.287266 -1.67078 2.48017    1.46453 0.112321 2.50927        2.06173 -1.39848 1.79787        1. 0. 0.
    195 1
    196   1.46453 0.112321 2.50927      2.06173 -1.39848 1.79787        4.08983 -0.525479 2.10687       1. 0. 0.
    197 1
    198   1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         4.08983 -0.525479 2.10687       1. 0. 0.
    199 1
    200   3.24233 1.41142 2.47757       4.08983 -0.525479 2.10687       5.70193 1.54062 1.25007         1. 0. 0.
    201 1
    202   4.08983 -0.525479 2.10687     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
    203 1
    204   7.33693 1.04442 0.0886712     6.17523 -0.969279 1.17127       5.70193 1.54062 1.25007         1. 0. 0.
    205 1
    206   7.33693 1.04442 0.0886712     5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
    207 1
    208   3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         5.70193 1.54062 1.25007         1. 0. 0.
    209 1
    210   3.24233 1.41142 2.47757       4.34293 2.22742 1.34117         2.58823 2.50762 1.23707         1. 0. 0.
    211 1
    212   4.34293 2.22742 1.34117       2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
    213 1
    214   4.34293 2.22742 1.34117       5.11553 2.70122 -0.710229       7.56833 1.97852 -0.00632877     1. 0. 0.
    215 1
    216   4.34293 2.22742 1.34117       5.70193 1.54062 1.25007         7.56833 1.97852 -0.00632877     1. 0. 0.
    217 1
    218   1.46453 0.112321 2.50927      3.24233 1.41142 2.47757         2.58823 2.50762 1.23707         1. 0. 0.
    219 1
    220   1.46453 0.112321 2.50927      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
    221 1
    222   -0.759066 -0.265179 1.48487   1.46453 0.112321 2.50927        -2.87097 2.29272 -0.0233288     1. 0. 0.
    223 1
    224   -0.759066 -0.265179 1.48487   -3.66127 0.565021 1.57007       -2.87097 2.29272 -0.0233288     1. 0. 0.
    225 1
    226   -3.66127 0.565021 1.57007     -2.87097 2.29272 -0.0233288     -4.83487 2.76522 1.41487        1. 0. 0.
    227 1
    228   -2.87097 2.29272 -0.0233288   -4.83487 2.76522 1.41487        -4.04457 4.49292 -0.178529      1. 0. 0.
    229 1
    230   2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
    231 1
    232   2.58823 2.50762 1.23707       -2.87097 2.29272 -0.0233288     -4.04457 4.49292 -0.178529      1. 0. 0.
    233 1
    234   1.15633 1.11082 0.326671      2.58823 2.50762 1.23707         -2.87097 2.29272 -0.0233288     1. 0. 0.
    235 1
    236   1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        -2.87097 2.29272 -0.0233288     1. 0. 0.
    237 1
    238   1.15633 1.11082 0.326671      1.03283 1.01972 -2.14533        2.58823 2.50762 1.23707         1. 0. 0.
    239 1
    240   1.03283 1.01972 -2.14533      2.58823 2.50762 1.23707         5.11553 2.70122 -0.710229       1. 0. 0.
    241 1
    242   1.03283 1.01972 -2.14533      3.62023 1.25552 -2.86813        5.11553 2.70122 -0.710229       1. 0. 0.
    243 1
    244   -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      -3.66127 0.565021 1.57007       1. 0. 0.
    245 1
    246   -0.759066 -0.265179 1.48487   -0.287266 -1.67078 2.48017      1.46453 0.112321 2.50927        1. 0. 0.
    247 1
    248   -0.287266 -1.67078 2.48017    -2.45927 -1.63678 1.72157       -3.66127 0.565021 1.57007       1. 0. 0.
    249 1
    250   -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.66127 0.565021 1.57007       1. 0. 0.
    251 1
    252   -4.75167 -1.93408 0.935971    -3.66127 0.565021 1.57007       -6.27887 0.926121 0.589671      1. 0. 0.
    253 1
    254   -3.66127 0.565021 1.57007     -4.83487 2.76522 1.41487        -6.27887 0.926121 0.589671      1. 0. 0.
    255 1
    256   -4.83487 2.76522 1.41487      -6.27887 0.926121 0.589671      -7.11497 2.49352 0.479071       1. 0. 0.
    257 1
    258   -2.45927 -1.63678 1.72157     -4.75167 -1.93408 0.935971      -3.90927 -3.49908 0.839771      1. 0. 0.
    259 1
    260   -1.52417 -3.64138 0.503471    -2.45927 -1.63678 1.72157       -3.90927 -3.49908 0.839771      1. 0. 0.
    261 1
    262   -1.52417 -3.64138 0.503471    -0.287266 -1.67078 2.48017      -2.45927 -1.63678 1.72157       1. 0. 0.
    263 1
    264   0.790434 -3.69418 1.29027     -1.52417 -3.64138 0.503471      -0.287266 -1.67078 2.48017      1. 0. 0.
    265 1
    266   -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -4.04457 4.49292 -0.178529      1. 0. 0.
    267 1
    268   -4.83487 2.76522 1.41487      -5.81017 4.57652 0.0304712      -7.11497 2.49352 0.479071       1. 0. 0.
    269 1
    270   1.03283 1.01972 -2.14533      -2.87097 2.29272 -0.0233288     -3.94777 1.63002 -1.27603       1. 0. 0.
    271 1
    272   -2.87097 2.29272 -0.0233288   -3.94777 1.63002 -1.27603       -4.04457 4.49292 -0.178529      1. 0. 0.
    273 1
    274   -3.94777 1.63002 -1.27603     -4.04457 4.49292 -0.178529      -5.12137 3.83022 -1.43123       1. 0. 0.
    275 1
    276   -0.573766 -1.42458 -2.91753   1.03283 1.01972 -2.14533        -3.94777 1.63002 -1.27603       1. 0. 0.
    277 1
    278   -0.573766 -1.42458 -2.91753   1.76663 -0.360379 -2.99373      1.03283 1.01972 -2.14533        1. 0. 0.
    279 1
    280   1.76663 -0.360379 -2.99373    1.03283 1.01972 -2.14533        3.62023 1.25552 -2.86813        1. 0. 0.
    281 1
    282   -0.573766 -1.42458 -2.91753   -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
    283 1
    284   -0.573766 -1.42458 -2.91753   -2.49667 -2.18078 -1.79993      -2.77417 -0.570279 -1.12083     1. 0. 0.
    285 1
    286   -2.49667 -2.18078 -1.79993    -2.77417 -0.570279 -1.12083     -3.94777 1.63002 -1.27603       1. 0. 0.
    287 1
    288   -2.49667 -2.18078 -1.79993    -4.17327 -2.53828 -0.635229     -3.94777 1.63002 -1.27603       1. 0. 0.
    289 1
    290   -4.17327 -2.53828 -0.635229   -3.94777 1.63002 -1.27603       -6.42617 1.74722 -0.982629      1. 0. 0.
    291 1
    292   -3.94777 1.63002 -1.27603     -5.12137 3.83022 -1.43123       -6.42617 1.74722 -0.982629      1. 0. 0.
    293 1
    294   -0.573766 -1.42458 -2.91753   -1.62867 -3.74268 -1.79493      -2.49667 -2.18078 -1.79993      1. 0. 0.
    295 1
    296   -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
    297 1
    298   -0.573766 -1.42458 -2.91753   0.450934 -2.72908 -2.23353      1.76663 -0.360379 -2.99373      1. 0. 0.
    299 1
    300   -1.62867 -3.74268 -1.79493    -2.49667 -2.18078 -1.79993      -4.17327 -2.53828 -0.635229     1. 0. 0.
    301 1
    302   -1.62867 -3.74268 -1.79493    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
    303 1
    304   -1.52417 -3.64138 0.503471    -1.62867 -3.74268 -1.79493      -3.90927 -3.49908 0.839771      1. 0. 0.
    305 1
    306   0.917634 -3.66448 -0.484829   -1.52417 -3.64138 0.503471      -1.62867 -3.74268 -1.79493      1. 0. 0.
    307 1
    308   0.790434 -3.69418 1.29027     0.917634 -3.66448 -0.484829     -1.52417 -3.64138 0.503471      1. 0. 0.
    309 1
    310   0.917634 -3.66448 -0.484829   0.450934 -2.72908 -2.23353      -1.62867 -3.74268 -1.79493      1. 0. 0.
    311 1
    312   -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -3.90927 -3.49908 0.839771      1. 0. 0.
    313 1
    314   -4.75167 -1.93408 0.935971    -4.17327 -2.53828 -0.635229     -6.27887 0.926121 0.589671      1. 0. 0.
    315 1
    316   -4.17327 -2.53828 -0.635229   -6.27887 0.926121 0.589671      -6.42617 1.74722 -0.982629      1. 0. 0.
    317 1
    318   -6.27887 0.926121 0.589671    -7.11497 2.49352 0.479071       -6.42617 1.74722 -0.982629      1. 0. 0.
    319 1
    320   3.62023 1.25552 -2.86813      5.68853 1.38852 -1.77723        5.11553 2.70122 -0.710229       1. 0. 0.
    321 1
    322   5.68853 1.38852 -1.77723      5.11553 2.70122 -0.710229       7.56833 1.97852 -0.00632877     1. 0. 0.
    323 1
    324   -5.12137 3.83022 -1.43123     -7.11497 2.49352 0.479071       -6.42617 1.74722 -0.982629      1. 0. 0.
    325 1
    326   -5.81017 4.57652 0.0304712    -5.12137 3.83022 -1.43123       -7.11497 2.49352 0.479071       1. 0. 0.
    327 1
    328   -5.81017 4.57652 0.0304712    -4.04457 4.49292 -0.178529      -5.12137 3.83022 -1.43123       1. 0. 0.
     158  7.32406 1.08574 0.0829932     5.67566 1.42984 -1.78291        7.55546 2.01984 -0.0120068      1. 0. 0.
     1591
     160  7.32406 1.08574 0.0829932     5.67566 1.42984 -1.78291        5.53756 -0.911555 -0.496607     1. 0. 0.
     1611
     162  7.32406 1.08574 0.0829932     6.16236 -0.927955 1.16559       5.53756 -0.911555 -0.496607     1. 0. 0.
     1631
     164  3.60736 1.29684 -2.87381      5.67566 1.42984 -1.78291        5.53756 -0.911555 -0.496607     1. 0. 0.
     1651
     166  1.75376 -0.319055 -2.99941    3.60736 1.29684 -2.87381        5.53756 -0.911555 -0.496607     1. 0. 0.
     1671
     168  2.17906 -1.47276 -0.873307    1.75376 -0.319055 -2.99941      5.53756 -0.911555 -0.496607     1. 0. 0.
     1691
     170  2.17906 -1.47276 -0.873307    0.438062 -2.68776 -2.23921      1.75376 -0.319055 -2.99941      1. 0. 0.
     1711
     172  0.904762 -3.62316 -0.490507   2.17906 -1.47276 -0.873307      0.438062 -2.68776 -2.23921      1. 0. 0.
     1731
     174  0.904762 -3.62316 -0.490507   2.17906 -1.47276 -0.873307      5.53756 -0.911555 -0.496607     1. 0. 0.
     1751
     176  0.904762 -3.62316 -0.490507   1.91486 -2.53606 0.492393       5.53756 -0.911555 -0.496607     1. 0. 0.
     1771
     178  1.91486 -2.53606 0.492393     3.61706 -1.46676 0.692693       5.53756 -0.911555 -0.496607     1. 0. 0.
     1791
     180  3.61706 -1.46676 0.692693     6.16236 -0.927955 1.16559       5.53756 -0.911555 -0.496607     1. 0. 0.
     1811
     182  0.777562 -3.65286 1.28459     0.904762 -3.62316 -0.490507     1.91486 -2.53606 0.492393       1. 0. 0.
     1831
     184  0.777562 -3.65286 1.28459     1.91486 -2.53606 0.492393       3.61706 -1.46676 0.692693       1. 0. 0.
     1851
     186  0.777562 -3.65286 1.28459     2.04886 -1.35716 1.79219        3.61706 -1.46676 0.692693       1. 0. 0.
     1871
     188  2.04886 -1.35716 1.79219      4.07696 -0.484155 2.10119       3.61706 -1.46676 0.692693       1. 0. 0.
     1891
     190  4.07696 -0.484155 2.10119     3.61706 -1.46676 0.692693       6.16236 -0.927955 1.16559       1. 0. 0.
     1911
     192  0.777562 -3.65286 1.28459     -0.300138 -1.62946 2.47449      2.04886 -1.35716 1.79219        1. 0. 0.
     1931
     194  -0.300138 -1.62946 2.47449    1.45166 0.153645 2.50359        2.04886 -1.35716 1.79219        1. 0. 0.
     1951
     196  1.45166 0.153645 2.50359      2.04886 -1.35716 1.79219        4.07696 -0.484155 2.10119       1. 0. 0.
     1971
     198  1.45166 0.153645 2.50359      3.22946 1.45274 2.47189         4.07696 -0.484155 2.10119       1. 0. 0.
     1991
     200  3.22946 1.45274 2.47189       4.07696 -0.484155 2.10119       5.68906 1.58194 1.24439         1. 0. 0.
     2011
     202  4.07696 -0.484155 2.10119     6.16236 -0.927955 1.16559       5.68906 1.58194 1.24439         1. 0. 0.
     2031
     204  7.32406 1.08574 0.0829932     6.16236 -0.927955 1.16559       5.68906 1.58194 1.24439         1. 0. 0.
     2051
     206  7.32406 1.08574 0.0829932     5.68906 1.58194 1.24439         7.55546 2.01984 -0.0120068      1. 0. 0.
     2071
     208  3.22946 1.45274 2.47189       4.33006 2.26874 1.33549         5.68906 1.58194 1.24439         1. 0. 0.
     2091
     210  3.22946 1.45274 2.47189       4.33006 2.26874 1.33549         2.57536 2.54894 1.23139         1. 0. 0.
     2111
     212  4.33006 2.26874 1.33549       2.57536 2.54894 1.23139         5.10266 2.74254 -0.715907       1. 0. 0.
     2131
     214  4.33006 2.26874 1.33549       5.10266 2.74254 -0.715907       7.55546 2.01984 -0.0120068      1. 0. 0.
     2151
     216  4.33006 2.26874 1.33549       5.68906 1.58194 1.24439         7.55546 2.01984 -0.0120068      1. 0. 0.
     2171
     218  1.45166 0.153645 2.50359      3.22946 1.45274 2.47189         2.57536 2.54894 1.23139         1. 0. 0.
     2191
     220  1.45166 0.153645 2.50359      2.57536 2.54894 1.23139         -2.88384 2.33404 -0.0290068     1. 0. 0.
     2211
     222  -0.771938 -0.223855 1.47919   1.45166 0.153645 2.50359        -2.88384 2.33404 -0.0290068     1. 0. 0.
     2231
     224  -0.771938 -0.223855 1.47919   -3.67414 0.606345 1.56439       -2.88384 2.33404 -0.0290068     1. 0. 0.
     2251
     226  -3.67414 0.606345 1.56439     -2.88384 2.33404 -0.0290068     -4.84774 2.80654 1.40919        1. 0. 0.
     2271
     228  -2.88384 2.33404 -0.0290068   -4.84774 2.80654 1.40919        -4.05744 4.53424 -0.184207      1. 0. 0.
     2291
     230  2.57536 2.54894 1.23139       -2.88384 2.33404 -0.0290068     -4.05744 4.53424 -0.184207      1. 0. 0.
     2311
     232  2.57536 2.54894 1.23139       -2.88384 2.33404 -0.0290068     -4.05744 4.53424 -0.184207      1. 0. 0.
     2331
     234  1.14346 1.15214 0.320993      2.57536 2.54894 1.23139         -2.88384 2.33404 -0.0290068     1. 0. 0.
     2351
     236  1.14346 1.15214 0.320993      1.01996 1.06104 -2.15101        -2.88384 2.33404 -0.0290068     1. 0. 0.
     2371
     238  1.14346 1.15214 0.320993      1.01996 1.06104 -2.15101        2.57536 2.54894 1.23139         1. 0. 0.
     2391
     240  1.01996 1.06104 -2.15101      2.57536 2.54894 1.23139         5.10266 2.74254 -0.715907       1. 0. 0.
     2411
     242  1.01996 1.06104 -2.15101      3.60736 1.29684 -2.87381        5.10266 2.74254 -0.715907       1. 0. 0.
     2431
     244  -0.771938 -0.223855 1.47919   -0.300138 -1.62946 2.47449      -3.67414 0.606345 1.56439       1. 0. 0.
     2451
     246  -0.771938 -0.223855 1.47919   -0.300138 -1.62946 2.47449      1.45166 0.153645 2.50359        1. 0. 0.
     2471
     248  -0.300138 -1.62946 2.47449    -2.47214 -1.59546 1.71589       -3.67414 0.606345 1.56439       1. 0. 0.
     2491
     250  -2.47214 -1.59546 1.71589     -4.76454 -1.89276 0.930293      -3.67414 0.606345 1.56439       1. 0. 0.
     2511
     252  -4.76454 -1.89276 0.930293    -3.67414 0.606345 1.56439       -6.29174 0.967445 0.583993      1. 0. 0.
     2531
     254  -3.67414 0.606345 1.56439     -4.84774 2.80654 1.40919        -6.29174 0.967445 0.583993      1. 0. 0.
     2551
     256  -4.84774 2.80654 1.40919      -6.29174 0.967445 0.583993      -7.12784 2.53484 0.473393       1. 0. 0.
     2571
     258  -2.47214 -1.59546 1.71589     -4.76454 -1.89276 0.930293      -3.92214 -3.45776 0.834093      1. 0. 0.
     2591
     260  -1.53704 -3.60006 0.497793    -2.47214 -1.59546 1.71589       -3.92214 -3.45776 0.834093      1. 0. 0.
     2611
     262  -1.53704 -3.60006 0.497793    -0.300138 -1.62946 2.47449      -2.47214 -1.59546 1.71589       1. 0. 0.
     2631
     264  0.777562 -3.65286 1.28459     -1.53704 -3.60006 0.497793      -0.300138 -1.62946 2.47449      1. 0. 0.
     2651
     266  -4.84774 2.80654 1.40919      -5.82304 4.61784 0.0247932      -4.05744 4.53424 -0.184207      1. 0. 0.
     2671
     268  -4.84774 2.80654 1.40919      -5.82304 4.61784 0.0247932      -7.12784 2.53484 0.473393       1. 0. 0.
     2691
     270  1.01996 1.06104 -2.15101      -2.88384 2.33404 -0.0290068     -3.96064 1.67134 -1.28171       1. 0. 0.
     2711
     272  -2.88384 2.33404 -0.0290068   -3.96064 1.67134 -1.28171       -4.05744 4.53424 -0.184207      1. 0. 0.
     2731
     274  -3.96064 1.67134 -1.28171     -4.05744 4.53424 -0.184207      -5.13424 3.87154 -1.43691       1. 0. 0.
     2751
     276  -0.586638 -1.38326 -2.92321   1.01996 1.06104 -2.15101        -3.96064 1.67134 -1.28171       1. 0. 0.
     2771
     278  -0.586638 -1.38326 -2.92321   1.75376 -0.319055 -2.99941      1.01996 1.06104 -2.15101        1. 0. 0.
     2791
     280  1.75376 -0.319055 -2.99941    1.01996 1.06104 -2.15101        3.60736 1.29684 -2.87381        1. 0. 0.
     2811
     282  -0.586638 -1.38326 -2.92321   -2.78704 -0.528955 -1.12651     -3.96064 1.67134 -1.28171       1. 0. 0.
     2831
     284  -0.586638 -1.38326 -2.92321   -2.50954 -2.13946 -1.80561      -2.78704 -0.528955 -1.12651     1. 0. 0.
     2851
     286  -2.50954 -2.13946 -1.80561    -2.78704 -0.528955 -1.12651     -3.96064 1.67134 -1.28171       1. 0. 0.
     2871
     288  -2.50954 -2.13946 -1.80561    -4.18614 -2.49696 -0.640907     -3.96064 1.67134 -1.28171       1. 0. 0.
     2891
     290  -4.18614 -2.49696 -0.640907   -3.96064 1.67134 -1.28171       -6.43904 1.78854 -0.988307      1. 0. 0.
     2911
     292  -3.96064 1.67134 -1.28171     -5.13424 3.87154 -1.43691       -6.43904 1.78854 -0.988307      1. 0. 0.
     2931
     294  -0.586638 -1.38326 -2.92321   -1.64154 -3.70136 -1.80061      -2.50954 -2.13946 -1.80561      1. 0. 0.
     2951
     296  -0.586638 -1.38326 -2.92321   0.438062 -2.68776 -2.23921      -1.64154 -3.70136 -1.80061      1. 0. 0.
     2971
     298  -0.586638 -1.38326 -2.92321   0.438062 -2.68776 -2.23921      1.75376 -0.319055 -2.99941      1. 0. 0.
     2991
     300  -1.64154 -3.70136 -1.80061    -2.50954 -2.13946 -1.80561      -4.18614 -2.49696 -0.640907     1. 0. 0.
     3011
     302  -1.64154 -3.70136 -1.80061    -4.18614 -2.49696 -0.640907     -3.92214 -3.45776 0.834093      1. 0. 0.
     3031
     304  -1.53704 -3.60006 0.497793    -1.64154 -3.70136 -1.80061      -3.92214 -3.45776 0.834093      1. 0. 0.
     3051
     306  0.904762 -3.62316 -0.490507   -1.53704 -3.60006 0.497793      -1.64154 -3.70136 -1.80061      1. 0. 0.
     3071
     308  0.777562 -3.65286 1.28459     0.904762 -3.62316 -0.490507     -1.53704 -3.60006 0.497793      1. 0. 0.
     3091
     310  0.904762 -3.62316 -0.490507   0.438062 -2.68776 -2.23921      -1.64154 -3.70136 -1.80061      1. 0. 0.
     3111
     312  -4.76454 -1.89276 0.930293    -4.18614 -2.49696 -0.640907     -3.92214 -3.45776 0.834093      1. 0. 0.
     3131
     314  -4.76454 -1.89276 0.930293    -4.18614 -2.49696 -0.640907     -6.29174 0.967445 0.583993      1. 0. 0.
     3151
     316  -4.18614 -2.49696 -0.640907   -6.29174 0.967445 0.583993      -6.43904 1.78854 -0.988307      1. 0. 0.
     3171
     318  -6.29174 0.967445 0.583993    -7.12784 2.53484 0.473393       -6.43904 1.78854 -0.988307      1. 0. 0.
     3191
     320  3.60736 1.29684 -2.87381      5.67566 1.42984 -1.78291        5.10266 2.74254 -0.715907       1. 0. 0.
     3211
     322  5.67566 1.42984 -1.78291      5.10266 2.74254 -0.715907       7.55546 2.01984 -0.0120068      1. 0. 0.
     3231
     324  -5.13424 3.87154 -1.43691     -7.12784 2.53484 0.473393       -6.43904 1.78854 -0.988307      1. 0. 0.
     3251
     326  -5.82304 4.61784 0.0247932    -5.13424 3.87154 -1.43691       -7.12784 2.53484 0.473393       1. 0. 0.
     3271
     328  -5.82304 4.61784 0.0247932    -4.05744 4.53424 -0.184207      -5.13424 3.87154 -1.43691       1. 0. 0.
    3293299
    330330#  terminating special property
     
    333333  25.0    0.6     -1.0 -1.0 -1.0     0.2        0 0 0 0
    3343342
    335   -4.99203 4.29989 -0.526429    5       1 0 0
     335  -5.0049 4.34121 -0.532107     5       1 0 0
    3363369
    337337  terminating special property
Note: See TracChangeset for help on using the changeset viewer.