Changes in / [9757d9:60f50a]


Ignore:
Files:
38 added
46 deleted
52 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r9757d9 r60f50a  
    11ACLOCAL_AMFLAGS = -I m4
    2 SUBDIRS = src src/Actions src/unittests doc tests
     2SUBDIRS = src src/unittests doc tests
    33
    44EXTRA_DIST = autogen.sh
  • configure.ac

    r9757d9 r60f50a  
    9494# test suite
    9595AC_CONFIG_TESTDIR(tests)
    96 AC_CONFIG_FILES([
    97         tests/atlocal
    98         tests/Makefile])
    99 AC_CONFIG_FILES([
    100         tests/Tesselations/Makefile
    101         tests/Tesselations/defs])
     96AC_CONFIG_FILES([tests/atlocal tests/Makefile])
     97AC_CONFIG_FILES([tests/Tesselations/Makefile tests/Tesselations/defs])
    10298AC_CONFIG_FILES([tests/molecuilder], [chmod +x tests/molecuilder])
    103 AC_CONFIG_FILES([
    104         doc/molecuilder.xml])
    105 AC_CONFIG_FILES([
    106         Makefile
    107         doc/Makefile
    108         src/Makefile
    109         src/Actions/Makefile
    110         src/UIElements/Makefile
    111         src/unittests/Makefile])
     99AC_CONFIG_FILES([doc/molecuilder.xml])
     100AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile src/unittests/Makefile])
    112101AC_OUTPUT
  • src/Actions/MapOfActions.cpp

    r9757d9 r60f50a  
    123123  ShortFormMap["suspend-in-water"] = "U";
    124124  ShortFormMap["translate-mol"] = "t";
    125   ShortFormMap["verbose"] = "v";
     125  ShortFormMap["verbose"] = "V";
    126126  ShortFormMap["verlet-integrate"] = "P";
    127   ShortFormMap["version"] = "V";
     127  ShortFormMap["version"] = "v";
    128128
    129129  // value types for the actions
  • src/Helpers/MemDebug.cpp

    r9757d9 r60f50a  
    153153  // build the entry in front of the space
    154154  Memory::entry_t *entry = (Memory::entry_t*) res;
    155   memset(res,0,entrySpace);
    156155  entry->info.nbytes = nbytes;
    157156  entry->info.isUsed = true;
  • src/Makefile.am

    r9757d9 r60f50a  
    11# PLEASE adhere to the alphabetical ordering in this Makefile!
    22# Also indentation by a single tab
    3 
    4 SUBDIRS = Actions UIElements
    53
    64# this includes source files that need to be present at multiple points
     
    5149  analysis_correlation.hpp
    5250
    53 ACTIONSSOURCE = \
    54   Actions/Action.cpp \
     51ACTIONSSOURCE = Actions/Action.cpp \
     52  ${ANALYSISACTIONSOURCE} \
     53  ${ATOMACTIONSOURCE} \
     54  ${CMDACTIONSOURCE} \
     55  ${FRAGMENTATIONACTIONSOURCE} \
     56  ${MOLECULEACTIONSOURCE} \
     57  ${PARSERACTIONSOURCE} \
     58  ${TESSELATIONACTIONSOURCE} \
     59  ${WORLDACTIONSOURCE} \
    5560  Actions/ActionHistory.cpp \
    5661  Actions/ActionRegistry.cpp \
     
    5964  Actions/MakroAction.cpp \
    6065  Actions/ManipulateAtomsProcess.cpp \
     66  Actions/MapOfActions.cpp \
    6167  Actions/MethodAction.cpp \
    6268  Actions/Process.cpp
    6369
    64 ACTIONSHEADER = \
     70ACTIONSHEADER = Actions/Action.hpp \
    6571  ${ANALYSISACTIONHEADER} \
    6672  ${ATOMACTIONHEADER} \
     
    7177  ${TESSELATIONACTIONHEADER} \
    7278  ${WORLDACTIONHEADER} \
    73   Actions/Action.hpp \
    7479  Actions/ActionHistory.hpp \
    7580  Actions/ActionRegistry.hpp \
     
    8489  Actions/Process.hpp
    8590 
     91ANALYSISACTIONSOURCE = \
     92  Actions/AnalysisAction/MolecularVolumeAction.cpp \
     93  Actions/AnalysisAction/PairCorrelationAction.cpp \
     94  Actions/AnalysisAction/PairCorrelationToPointAction.cpp \
     95  Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp \
     96  Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
     97ANALYSISACTIONHEADER = \
     98  Actions/AnalysisAction/MolecularVolumeAction.hpp \
     99  Actions/AnalysisAction/PairCorrelationAction.hpp \
     100  Actions/AnalysisAction/PairCorrelationToPointAction.hpp \
     101  Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp \
     102  Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
     103
     104ATOMACTIONSOURCE = \
     105  Actions/AtomAction/AddAction.cpp \
     106  Actions/AtomAction/ChangeElementAction.cpp \
     107  Actions/AtomAction/RemoveAction.cpp
     108ATOMACTIONHEADER = \
     109  Actions/AtomAction/AddAction.hpp \
     110  Actions/AtomAction/ChangeElementAction.hpp \
     111  Actions/AtomAction/RemoveAction.cpp
     112
     113CMDACTIONSOURCE = \
     114  Actions/CmdAction/BondLengthTableAction.cpp \
     115  Actions/CmdAction/ElementDbAction.cpp \
     116  Actions/CmdAction/FastParsingAction.cpp \
     117  Actions/CmdAction/HelpAction.cpp \
     118  Actions/CmdAction/VerboseAction.cpp \
     119  Actions/CmdAction/VersionAction.cpp
     120CMDACTIONHEADER = \
     121  Actions/CmdAction/BondLengthTableAction.hpp \
     122  Actions/CmdAction/ElementDbAction.hpp \
     123  Actions/CmdAction/FastParsingAction.hpp \
     124  Actions/CmdAction/HelpAction.hpp \
     125  Actions/CmdAction/VerboseAction.hpp \
     126  Actions/CmdAction/VersionAction.hpp
     127
     128FRAGMENTATIONACTIONSOURCE = \
     129  Actions/FragmentationAction/DepthFirstSearchAction.cpp \
     130  Actions/FragmentationAction/FragmentationAction.cpp \
     131  Actions/FragmentationAction/SubgraphDissectionAction.cpp               
     132FRAGMENTATIONACTIONHEADER = \
     133  Actions/FragmentationAction/DepthFirstSearchAction.hpp \
     134  Actions/FragmentationAction/FragmentationAction.hpp \
     135  Actions/FragmentationAction/SubgraphDissectionAction.hpp
     136
     137MOLECULEACTIONSOURCE = \
     138  Actions/MoleculeAction/BondFileAction.cpp \
     139  Actions/MoleculeAction/ChangeNameAction.cpp \
     140  Actions/MoleculeAction/FillWithMoleculeAction.cpp \
     141  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
     142  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
     143  Actions/MoleculeAction/SaveAdjacencyAction.cpp \
     144  Actions/MoleculeAction/SaveBondsAction.cpp \
     145  Actions/MoleculeAction/SaveTemperatureAction.cpp \
     146  Actions/MoleculeAction/SuspendInWaterAction.cpp \
     147  Actions/MoleculeAction/TranslateAction.cpp \
     148  Actions/MoleculeAction/VerletIntegrationAction.cpp
     149MOLECULEACTIONHEADER = \
     150  Actions/MoleculeAction/BondFileAction.hpp \
     151  Actions/MoleculeAction/ChangeNameAction.hpp \
     152  Actions/MoleculeAction/FillWithMoleculeAction.hpp \
     153  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
     154  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
     155  Actions/MoleculeAction/SaveAdjacencyAction.hpp \
     156  Actions/MoleculeAction/SaveBondsAction.hpp \
     157  Actions/MoleculeAction/SaveTemperatureAction.hpp \
     158  Actions/MoleculeAction/SuspendInWaterAction.hpp \
     159  Actions/MoleculeAction/TranslateAction.hpp \
     160  Actions/MoleculeAction/VerletIntegrationAction.hpp
     161                 
     162PARSERACTIONSOURCE = \
     163  Actions/ParserAction/LoadXyzAction.cpp \
     164  Actions/ParserAction/SaveXyzAction.cpp       
     165PARSERACTIONHEADER = \
     166  Actions/ParserAction/LoadXyzAction.hpp \
     167  Actions/ParserAction/SaveXyzAction.hpp
     168
     169TESSELATIONACTIONSOURCE = \
     170  Actions/TesselationAction/ConvexEnvelopeAction.cpp \
     171  Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
     172TESSELATIONACTIONHEADER = \
     173  Actions/TesselationAction/ConvexEnvelopeAction.hpp \
     174  Actions/TesselationAction/NonConvexEnvelopeAction.hpp
     175
     176WORLDACTIONSOURCE = \
     177  Actions/WorldAction/AddEmptyBoundaryAction.cpp \
     178  Actions/WorldAction/BoundInBoxAction.cpp \
     179  Actions/WorldAction/CenterInBoxAction.cpp \
     180  Actions/WorldAction/CenterOnEdgeAction.cpp \
     181  Actions/WorldAction/ChangeBoxAction.cpp \
     182  Actions/WorldAction/RemoveSphereOfAtomsAction.cpp \
     183  Actions/WorldAction/RepeatBoxAction.cpp \
     184  Actions/WorldAction/ScaleBoxAction.cpp \
     185  Actions/WorldAction/SetDefaultNameAction.cpp \
     186  Actions/WorldAction/SetGaussianBasisAction.cpp               
     187WORLDACTIONHEADER = \
     188  Actions/WorldAction/AddEmptyBoundaryAction.hpp \
     189  Actions/WorldAction/BoundInBoxAction.hpp \
     190  Actions/WorldAction/CenterInBoxAction.hpp \
     191  Actions/WorldAction/CenterOnEdgeAction.hpp \
     192  Actions/WorldAction/ChangeBoxAction.hpp \
     193  Actions/WorldAction/RemoveSphereOfAtomsAction.hpp \
     194  Actions/WorldAction/RepeatBoxAction.hpp \
     195  Actions/WorldAction/ScaleBoxAction.hpp \
     196  Actions/WorldAction/SetDefaultNameAction.hpp \
     197  Actions/WorldAction/SetGaussianBasisAction.hpp
     198
     199
    86200
    87201PARSERSOURCE = \
     
    102216  Patterns/Observer.hpp \
    103217  Patterns/Singleton.hpp
     218
     219# Below is all for the User Interface
     220
     221VIEWSOURCE = \
     222  Views/View.cpp \
     223  Views/StringView.cpp \
     224  Views/MethodStringView.cpp \
     225  Views/StreamStringView.cpp
     226VIEWHEADER = \
     227  Views/View.hpp \
     228  Views/StringView.hpp \
     229  Views/MethodStringView.hpp \
     230  Views/StreamStringView.hpp
     231
     232MENUSOURCE = \
     233  Menu/Menu.cpp \
     234  Menu/TextMenu.cpp \
     235  Menu/MenuItem.cpp \
     236  Menu/SubMenuItem.cpp \
     237  Menu/ActionMenuItem.cpp \
     238  Menu/SeperatorItem.cpp \
     239  Menu/DisplayMenuItem.cpp
     240 
     241MENUHEADER = \
     242  Menu/Menu.hpp \
     243  Menu/TextMenu.hpp \
     244  Menu/MenuItem.hpp \
     245  Menu/SubMenuItem.hpp \
     246  Menu/ActionMenuItem.hpp \
     247  Menu/SeperatorItem.hpp \
     248  Menu/DisplayMenuItem.hpp
     249
     250UISOURCE = \
     251  ${ACTIONSSOURCE} \
     252  ${COMMANDLINEUISOURCE} \
     253  ${MENUSOURCE} \
     254  ${TEXTUISOURCE} \
     255  ${VIEWSOURCE} \
     256  UIElements/Dialog.cpp \
     257  UIElements/MainWindow.cpp \
     258  UIElements/UIFactory.cpp
     259 
     260UIHEADER = \
     261  ${ACTIONSHEADER} \
     262  ${COMMANDLINEUIHEADER} \
     263  ${MENUHEADER} \
     264  ${TEXTUIHEADER} \
     265  ${VIEWHEADER} \
     266  UIElements/Dialog.hpp \
     267  UIElements/MainWindow.hpp \
     268  UIElements/UIFactory.hpp
     269
     270TEXTUISOURCE = \
     271  UIElements/TextDialog.cpp \
     272  UIElements/TextStatusIndicator.cpp \
     273  UIElements/TextUIFactory.cpp \
     274  UIElements/TextWindow.cpp
     275TEXTUIHEADER = \
     276  UIElements/TextDialog.hpp \
     277  UIElements/TextStatusIndicator.hpp \
     278  UIElements/TextUIFactory.hpp \
     279  UIElements/TextWindow.hpp
     280
     281COMMANDLINEUISOURCE = \
     282  UIElements/CommandLineDialog.cpp \
     283  UIElements/CommandLineStatusIndicator.cpp \
     284  UIElements/CommandLineUIFactory.cpp \
     285  UIElements/CommandLineWindow.cpp
     286COMMANDLINEUIHEADER = \
     287  UIElements/CommandLineDialog.hpp \
     288  UIElements/CommandLineStatusIndicator.hpp \
     289  UIElements/CommandLineUIFactory.hpp \
     290  UIElements/CommandLineWindow.hpp
    104291
    105292# all these files are only used for legacy reasons while the transition is in progress
     
    134321SOURCE = \
    135322  ${ANALYSISSOURCE} \
    136   ${ACTIONSSOURCE} \
    137323  ${ATOMSOURCE} \
    138324  ${PATTERNSOURCE} \
    139325  ${PARSERSOURCE} \
     326  ${UISOURCE} \
    140327  ${DESCRIPTORSOURCE} \
    141328  ${HELPERSOURCE} \
     
    148335  config.cpp \
    149336  element.cpp \
    150   elements_db.cpp \
    151337  ellipsoid.cpp \
    152338  errorlogger.cpp \
     
    180366HEADER = \
    181367  ${ANALYSISHEADER} \
    182   ${ACTIONSHEADER} \
    183368  ${ATOMHEADER} \
    184369  ${PARSERHEADER} \
    185370  ${PATTERNHEADER} \
     371  ${UIHEADER} \
    186372  ${DESCRIPTORHEADER} \
    187373  ${EXCEPTIONHEADER} \
     
    194380  defs.hpp \
    195381  element.hpp \
    196   elements_db.hpp \
    197382  ellipsoid.hpp \
    198383  errorlogger.hpp \
     
    222407
    223408BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
    224 INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements
     409INCLUDES = -I$(top_srcdir)/src/unittests
    225410
    226411noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a
     
    229414libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
    230415libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
     416molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
    231417molecuilder_LDFLAGS = $(BOOST_LDFLAGS)
    232418molecuilder_SOURCES = builder.cpp
    233 molecuilder_LDADD =  UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
     419molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
    234420joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
    235421joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
  • src/UIElements/Dialog.cpp

    r9757d9 r60f50a  
    88#include <cassert>
    99
    10 #include "Dialog.hpp"
     10#include "UIElements/Dialog.hpp"
    1111
    1212#include "atom.hpp"
  • src/UIElements/MainWindow.cpp

    r9757d9 r60f50a  
    66 */
    77
    8 #include "MainWindow.hpp"
     8#include "UIElements/MainWindow.hpp"
    99
    1010MainWindow::MainWindow()
  • src/UIElements/UIFactory.cpp

    r9757d9 r60f50a  
    99#include <cassert>
    1010#include "Patterns/Singleton_impl.hpp"
    11 #include "UIFactory.hpp"
     11#include "UIElements/UIFactory.hpp"
    1212
    1313// all factories that can be used:
    14 #include "TextUI/TextUIFactory.hpp"
    15 #include "CommandLineUI/CommandLineUIFactory.hpp"
     14#include "UIElements/TextUIFactory.hpp"
     15#include "UIElements/CommandLineUIFactory.hpp"
    1616
    1717UIFactory::UIFactory()
  • src/analysis_bonds.cpp

    r9757d9 r60f50a  
    5151 * \param &Max maximum distance on return, 0 if no bond between the two elements
    5252 */
    53 void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max)
     53void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max)
    5454{
    5555  Min = 2e+6;
     
    124124 * \param *InterfaceElement or NULL
    125125 */
    126 int CountHydrogenBridgeBonds(MoleculeListClass *molecules, const element * InterfaceElement = NULL)
     126int CountHydrogenBridgeBonds(MoleculeListClass *molecules, element * InterfaceElement = NULL)
    127127{
    128128  atom *Walker = NULL;
     
    181181                    // check angle
    182182                    if (CheckHydrogenBridgeBondAngle(Walker, OtherAtom, Runner)) {
    183                       DoLog(1) && (Log() << Verbose(1) << Walker->getName() << ", " << OtherAtom->getName() << " and " << Runner->getName() << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(&OtherAtom->x, &Walker->x, &Runner->x)*(180./M_PI) << "." << endl);
     183                      DoLog(1) && (Log() << Verbose(1) << Walker->Name << ", " << OtherAtom->Name << " and " << Runner->Name << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(&OtherAtom->x, &Walker->x, &Runner->x)*(180./M_PI) << "." << endl);
    184184                      count++;
    185185                      break;
  • src/analysis_bonds.hpp

    r9757d9 r60f50a  
    3131
    3232void GetMaxMinMeanBondCount(const molecule * const mol, double &Min, double &Mean, double &Max);
    33 void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max);
     33void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max);
    3434
    35 int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, const element * InterfaceElement);
     35int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, 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/atom.cpp

    r9757d9 r60f50a  
    4040
    4141atom *atom::clone(){
    42   atom *res = new atom(this);
     42  atom *res = new atom();
    4343  res->previous=0;
    4444  res->next=0;
  • src/atom_bondedparticle.cpp

    r9757d9 r60f50a  
    4444void BondedParticle::OutputBondOfAtom() const
    4545{
    46   DoLog(4) && (Log() << Verbose(4) << "Atom " << getName() << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl);
     46  DoLog(4) && (Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl);
    4747  int TotalDegree = 0;
    4848  for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); ++Runner) {
  • src/atom_graphnode.cpp

    r9757d9 r60f50a  
    2727void GraphNode::OutputGraphInfo() const
    2828{
    29   DoLog(2) && (Log() << Verbose(2) << "Atom " << getName() << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ");
     29  DoLog(2) && (Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ");
    3030  OutputComponentNumber();
    3131  DoLog(3) && (Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl);
  • src/atom_particleinfo.cpp

    r9757d9 r60f50a  
    1111/** Constructor of ParticleInfo.
    1212 */
    13 ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
    14 };
     13ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
    1514
    1615ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
    1716    nr(pointer->nr),
    18     name(pointer->name)
    19     {}
     17    Name(pointer->Name)
     18    {
     19      if (Name == NULL)
     20        Name = " ";
     21    }
    2022
    2123
     
    2325 */
    2426ParticleInfo::~ParticleInfo()
    25 {};
    26 
    27 const string& ParticleInfo::getName() const{
    28   return name;
    29 }
    30 
    31 void ParticleInfo::setName(const string& _name){
    32   name = _name;
    33 }
     27{
     28  Free(&Name);
     29};
    3430
    3531ostream & operator << (ostream &ost, const ParticleInfo &a)
    3632{
    37   ost << "[" << a.getName() << "|" << &a << "]";
     33  if (a.Name == NULL)
     34    ost << "[NULL]";
     35  else
     36    ost << "[" << a.Name << "|" << &a << "]";
    3837  return ost;
    3938};
     
    4140ostream & ParticleInfo::operator << (ostream &ost) const
    4241{
    43   ost << "[" << name << "|" << this << "]";
     42  if (Name == NULL)
     43    ost << "[NULL]";
     44  else
     45    ost << "[" << Name << "|" << this << "]";
    4446  return ost;
    4547};
  • src/atom_particleinfo.hpp

    r9757d9 r60f50a  
    2828public:
    2929  int nr;       // index to easierly identify
     30  char *Name;   // some name to reference to on output
    3031
    3132  ParticleInfo();
     
    3334  ~ParticleInfo();
    3435
    35   const std::string& getName() const;
    36   void setName(const std::string&);
    37 
    3836  ostream & operator << (ostream &ost) const;
    3937
    4038private:
    41   std::string name;   // some name to reference to on output
    4239};
    4340
  • src/bond.cpp

    r9757d9 r60f50a  
    5353ostream & operator << (ostream &ost, const bond &b)
    5454{
    55   ost << "[" << b.leftatom->getName() << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->getName() << "]";
     55  ost << "[" << b.leftatom->Name << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->Name << "]";
    5656  return ost;
    5757};
  • src/builder.cpp

    r9757d9 r60f50a  
    5353
    5454#include <cstring>
    55 #include <cstdlib>
    5655
    5756#include "analysis_bonds.hpp"
     
    15301529            break;
    15311530          case 'v':
    1532             setVerbosity(atoi(argv[argptr]));
     1531            ArgcList.insert(argptr-1);
     1532            return(1);
     1533            break;
     1534          case 'V':
    15331535            ArgcList.insert(argptr-1);
    15341536            ArgcList.insert(argptr);
    15351537            argptr++;
    1536             break;
    1537           case 'V':
    1538             ArgcList.insert(argptr-1);
    1539             return(1);
    15401538            break;
    15411539          case 'B':
     
    24902488  ActionRegistry::purgeInstance();
    24912489  ActionHistory::purgeInstance();
    2492   Memory::getState();
    24932490}
    24942491
     
    25042501    bool ArgumentsCopied = false;
    25052502
    2506     // print version check whether arguments are present at all
    25072503    cout << ESPACKVersion << endl;
    2508     if (argc < 2) {
    2509       cout << "Obtain help with " << argv[0] << " -h." << endl;
    2510       cleanUp();
    2511       Memory::getState();
    2512       return(1);
    2513     }
    2514 
    25152504
    25162505    setVerbosity(0);
    25172506    // need to init the history before any action is created
    25182507    ActionHistory::init();
    2519 
    2520     // from this moment on, we need to be sure to deeinitialize in the correct order
    2521     // this is handled by the cleanup function
    2522     atexit(cleanUp);
    25232508
    25242509    // Parse command line options and if present create respective UI
     
    25722557  }
    25732558
     2559  cleanUp();
     2560  Memory::getState();
    25742561  return (0);
    25752562}
  • src/config.cpp

    r9757d9 r60f50a  
    16801680    Walker = Walker->next;
    16811681    *output << Walker->nr << "\t";
    1682     *output << Walker->getName() << "\t";
     1682    *output << Walker->Name << "\t";
    16831683    *output << mol->name << "\t";
    16841684    *output << 0 << "\t";
     
    17561756        Walker = Walker->next;
    17571757        *output << AtomNo+1 << "\t";
    1758         *output << Walker->getName() << "\t";
     1758        *output << Walker->Name << "\t";
    17591759        *output << (*MolWalker)->name << "\t";
    17601760        *output << MolCounter+1 << "\t";
  • src/elements.db

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

    r9757d9 r60f50a  
    209209 */
    210210void 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 //  }
     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  }
    215215
    216216  exit(255);
  • src/molecule.cpp

    r9757d9 r60f50a  
    135135      if (pointer->type->Z != 1)
    136136        NoNonHydrogen++;
    137       if(pointer->getName() == "Unknown"){
    138         stringstream sstr;
    139         sstr << pointer->type->symbol << pointer->nr+1;
    140         pointer->setName(sstr.str());
     137      if (pointer->Name == NULL) {
     138        Free(&pointer->Name);
     139        pointer->Name = Malloc<char>(6, "molecule::AddAtom: *pointer->Name");
     140        sprintf(pointer->Name, "%2s%02d", pointer->type->symbol, pointer->nr+1);
    141141      }
    142142    }
     
    157157  if (pointer != NULL) {
    158158    atom *walker = pointer->clone();
    159     stringstream sstr;
    160     sstr << pointer->getName();
    161     walker->setName(sstr.str());
     159    walker->Name = Malloc<char>(strlen(pointer->Name) + 1, "atom::atom: *Name");
     160    strcpy (walker->Name, pointer->Name);
    162161    walker->nr = last_atom++;  // increase number within molecule
    163162    add(walker, end);
     
    253252  BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1];
    254253  if (BondRescale == -1) {
    255     DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     254    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    256255    return false;
    257256    BondRescale = bondlength;
     
    276275      InBondvector *= BondRescale;   // rescale the distance vector to Hydrogen bond length
    277276      FirstOtherAtom->x = TopOrigin->x; // set coordination to origin ...
    278       FirstOtherAtom->x += InBondvector;  // ... and add distance vector to replacement atom
     277      FirstOtherAtom->x = InBondvector;  // ... and add distance vector to replacement atom
    279278      AllWentWell = AllWentWell && AddAtom(FirstOtherAtom);
    280279//      Log() << Verbose(4) << "Added " << *FirstOtherAtom << " at: ";
     
    296295            SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin);
    297296          } else {
    298             DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName());
     297            DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name);
    299298          }
    300299        }
     
    340339      bondangle = TopOrigin->type->HBondAngle[1];
    341340      if (bondangle == -1) {
    342         DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     341        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
    343342        return false;
    344343        bondangle = 0;
     
    617616    add(Binder, last);
    618617  } else {
    619     DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->getName() << " and " << atom2->getName() << " as one or both are not present in the molecule." << endl);
     618    DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl);
    620619  }
    621620  return Binder;
     
    696695    AtomCount--;
    697696  } else
    698     DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
     697    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    699698  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    700699    ElementCount--;
     
    714713    ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element
    715714  else
    716     DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
     715    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
    717716  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
    718717    ElementCount--;
     
    916915        if (Walker->type->Z != 1) // count non-hydrogen atoms whilst at it
    917916          NoNonHydrogen++;
    918         stringstream sstr;
    919         sstr << Walker->type->symbol << Walker->nr+1;
    920         Walker->setName(sstr.str());
    921         DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->getName() << "." << endl);
     917        Free(&Walker->Name);
     918        Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
     919        sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1);
     920        DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl);
    922921        i++;
    923922      }
  • src/molecule_fragmentation.cpp

    r9757d9 r60f50a  
    722722    // free memory for bond part
    723723    DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl);
    724     Free(&FragmentList); // remove bond molecule from memory
     724    delete(FragmentList); // remove bond molecule from memory
    725725    Free(&SortIndex);
    726726  } else {
     
    907907      }
    908908    } else {
    909       DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
     909      DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
    910910    }
    911911    if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
  • src/molecule_geometry.cpp

    r9757d9 r60f50a  
    109109
    110110  if (ptr->next != end) {   //list not empty?
    111     while (ptr->next != end) {
     111    while (ptr->next != end) {  // continue with second if present
    112112      ptr = ptr->next;
    113113      Num++;
     
    125125Vector * molecule::DetermineCenterOfAll() const
    126126{
    127   atom *ptr = start;  // start at first in list
     127  atom *ptr = start->next;  // start at first in list
    128128  Vector *a = new Vector();
     129  Vector tmp;
    129130  double Num = 0;
    130131
    131132  a->Zero();
    132133
    133   if (ptr->next != end) {   //list not empty?
    134     while (ptr->next != end) {
     134  if (ptr != end) {   //list not empty?
     135    while (ptr->next != end) {  // continue with second if present
    135136      ptr = ptr->next;
    136137      Num += 1.;
    137       (*a) += ptr->x;
     138      tmp = ptr->x;
     139      (*a) += tmp;
    138140    }
    139141    a->Scale(1./Num); // divide through total mass (and sign for direction)
     
    282284              if ((fabs(tmp)) > BondDistance) {
    283285                flag = false;
    284                 DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->getName() << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
     286                DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
    285287                if (tmp > 0)
    286288                  Translationvector[j] -= 1.;
  • src/molecule_graph.cpp

    r9757d9 r60f50a  
    317317    Walker->GraphNr = DFS.CurrentGraphNr;
    318318    Walker->LowpointNr = DFS.CurrentGraphNr;
    319     DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->getName() << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
     319    DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
    320320    DFS.AtomStack->Push(Walker);
    321321    DFS.CurrentGraphNr++;
     
    348348    Binder->MarkUsed(black);
    349349    OtherAtom = Binder->GetOtherAtom(Walker);
    350     DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->getName() << "." << endl);
     350    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl);
    351351    if (OtherAtom->GraphNr != -1) {
    352352      // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3)
     
    354354      DFS.BackEdgeStack->Push(Binder);
    355355      Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr;
    356       DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->getName() << "] to " << Walker->LowpointNr << "." << endl);
     356      DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl);
    357357    } else {
    358358      // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2)
     
    360360      OtherAtom->Ancestor = Walker;
    361361      Walker = OtherAtom;
    362       DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->getName() << "]'s Ancestor is now " << OtherAtom->Ancestor->getName() << ", Walker is OtherAtom " << OtherAtom->getName() << "." << endl);
     362      DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl);
    363363      break;
    364364    }
     
    382382
    383383  // (5) if Ancestor of Walker is ...
    384   DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "] is " << Walker->Ancestor->GraphNr << "." << endl);
     384  DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl);
    385385
    386386  if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) {
     
    389389      // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8)
    390390      Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr;
    391       DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
     391      DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
    392392    } else {
    393393      // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component
    394394      Walker->Ancestor->SeparationVertex = true;
    395       DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s is a separating vertex, creating component." << endl);
     395      DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl);
    396396      mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber);
    397       DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
     397      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
    398398      mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    399       DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
     399      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    400400      do {
    401401        OtherAtom = DFS.AtomStack->PopLast();
    402402        LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    403403        mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    404         DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
     404        DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    405405      } while (OtherAtom != Walker);
    406406      DFS.ComponentNumber++;
    407407    }
    408408    // (8) Walker becomes its Ancestor, go to (3)
    409     DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->getName() << "] is now its Ancestor " << Walker->Ancestor->getName() << ", backstepping. " << endl);
     409    DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl);
    410410    Walker = Walker->Ancestor;
    411411    DFS.BackStepping = true;
     
    431431    //DFS.AtomStack->Output(out);
    432432    mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber);
    433     DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl);
     433    DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    434434    mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
    435     DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl);
     435    DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
    436436    do {
    437437      OtherAtom = DFS.AtomStack->PopLast();
    438438      LeafWalker->Leaf->AddCopyAtom(OtherAtom);
    439439      mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
    440       DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
     440      DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
    441441    } while (OtherAtom != Walker);
    442442    DFS.ComponentNumber++;
     
    445445    Walker = DFS.Root;
    446446    Binder = mol->FindNextUnused(Walker);
    447     DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->getName() << "], next Unused Bond is " << Binder << "." << endl);
     447    DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl);
    448448    if (Binder != NULL) { // Root is separation vertex
    449449      DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl);
     
    692692        if (OtherAtom->type->Z != 1) {
    693693#endif
    694         DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
     694        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    695695        if (BFS.ColorList[OtherAtom->nr] == white) {
    696696          BFS.TouchedStack->Push(OtherAtom);
     
    698698          BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    699699          BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    700           DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
     700          DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    701701          //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
    702702          DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);
     
    719719    }
    720720    BFS.ColorList[Walker->nr] = black;
    721     DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
     721    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    722722    if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
    723723      // step through predecessor list
     
    770770    Walker = BFS.Root;
    771771    while (Walker != BackEdge->rightatom) {
    772       DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " <-> ");
     772      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> ");
    773773      Walker = BFS.PredecessorList[Walker->nr];
    774774      Walker->GetTrueFather()->IsCyclic = true;
    775775      RingSize++;
    776776    }
    777     DoLog(0) && (Log() << Verbose(0) << Walker->getName() << "  with a length of " << RingSize << "." << endl << endl);
     777    DoLog(0) && (Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl);
    778778    // walk through all and set MinimumRingSize
    779779    Walker = BFS.Root;
     
    12331233  BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
    12341234  BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
    1235   DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
     1235  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
    12361236  if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
    12371237    DoLog(3) && (Log() << Verbose(3));
    12381238    if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far
    12391239      AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom);
    1240       DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->getName());
     1240      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name);
    12411241      AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
    12421242      DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
    12431243    } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place)
    1244       DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName());
     1244      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name);
    12451245      if (AddedBondList[Binder->nr] == NULL) {
    12461246        AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
     
    13221322    // followed by n+1 till top of stack.
    13231323    Walker = BFS.BFSStack->PopFirst(); // pop oldest added
    1324     DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->getName() << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
     1324    DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
    13251325    for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
    13261326      if ((*Runner) != NULL) { // don't look at bond equal NULL
    13271327        Binder = (*Runner);
    13281328        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    1329         DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
     1329        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
    13301330        if (BFS.ColorList[OtherAtom->nr] == white) {
    13311331          BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem);
     
    13361336    }
    13371337    BFS.ColorList[Walker->nr] = black;
    1338     DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
     1338    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
    13391339  }
    13401340  BreadthFirstSearchAdd_Free(BFS);
     
    14031403          OtherAtom = (*Runner)->GetOtherAtom(Walker);
    14041404          if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
    1405             DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->getName() << " and " << ParentList[OtherAtom->nr]->getName() << "." << endl);
     1405            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl);
    14061406            mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree);
    14071407          }
  • src/moleculelist.cpp

    r9757d9 r60f50a  
    677677    while (Walker->next != (*ListRunner)->end) {
    678678      Walker = Walker->next;
    679       DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " ");
     679      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " ");
    680680    }
    681681    DoLog(0) && (Log() << Verbose(0) << endl);
  • src/parser.cpp

    r9757d9 r60f50a  
    3232  if (input == NULL) {
    3333    if (!test)
    34       DoLog(0) && (Log() << Verbose(0) << endl << "FilePresent: Unable to open " << filename << ", is the directory correct?" << endl);
     34      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl);
    3535    return false;
    3636  }
     
    160160  //Log() << Verbose(1) << "Opening " << name << " ... "  << input << endl;
    161161  if (input == NULL) {
    162     DoeLog(1) && (eLog()<< Verbose(1) << endl << "MatrixContainer::ParseMatrix: Unable to open " << name << ", is the directory correct?" << endl);
     162    DoeLog(1) && (eLog()<< Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl);
    163163    //performCriticalExit();
    164164    return false;
     
    269269  input.open(file.str().c_str(), ios::in);
    270270  if (input == NULL) {
    271     DoLog(0) && (Log() << Verbose(0) << endl << "MatrixContainer::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
     271    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    272272    return false;
    273273  }
     
    477477    output.open(line.str().c_str(), ios::out);
    478478    if (output == NULL) {
    479       DoeLog(0) && (eLog()<< Verbose(0) << "MatrixContainer::WriteTotalFragments: Unable to open output energy file " << line.str() << "!" << endl);
     479      DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl);
    480480      performCriticalExit();
    481481      return false;
     
    507507  output.open(line.str().c_str(), ios::out);
    508508  if (output == NULL) {
    509     DoeLog(0) && (eLog()<< Verbose(0) << "MatrixContainer::WriteLastMatrix: Unable to open output matrix file " << line.str() << "!" << endl);
     509    DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl);
    510510    performCriticalExit();
    511511    return false;
     
    621621  //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
    622622  if (input == NULL) {
    623     DoLog(0) && (Log() << Verbose(0) << endl << "ForceMatrix::ParseIndices: Unable to open " << line.str() << ", is the directory correct?" << endl);
     623    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
    624624    return false;
    625625  }
     
    700700    input.open(file.str().c_str(), ios::in);
    701701    if (input == NULL) {
    702       DoLog(0) && (Log() << Verbose(0) << endl << "ForceMatrix::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
     702      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    703703      return false;
    704704    }
     
    759759  //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
    760760  if (input == NULL) {
    761     DoLog(0) && (Log() << Verbose(0) << endl << "HessianMatrix::ParseIndices: Unable to open " << line.str() << ", is the directory correct?" << endl);
     761    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
    762762    return false;
    763763  }
     
    930930    input.open(file.str().c_str(), ios::in);
    931931    if (input == NULL) {
    932       DoLog(0) && (Log() << Verbose(0) << endl << "HessianMatrix::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
     932      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    933933      return false;
    934934    }
     
    10141014  input.open(file.str().c_str(), ios::in);
    10151015  if (input == NULL) {
    1016     DoLog(0) && (Log() << Verbose(0) << endl << "KeySetsContainer::ParseKeySets: Unable to open " << file.str() << ", is the directory correct?" << endl);
     1016    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
    10171017    return false;
    10181018  }
  • src/periodentafel.cpp

    r9757d9 r60f50a  
    88
    99#include <iomanip>
    10 #include <iostream>
    1110#include <fstream>
    1211#include <cstring>
    13 
    14 #include "Helpers/Assert.hpp"
     12#include <cassert>
     13
    1514#include "element.hpp"
    16 #include "elements_db.hpp"
    1715#include "helpers.hpp"
    1816#include "lists.hpp"
     
    2927 */
    3028periodentafel::periodentafel()
    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 };
     29{};
    3830
    3931/** destructor for class periodentafel
     
    4739/** Adds element to period table list
    4840 * \param *pointer element to be added
    49  * \return iterator to added element
     41 * \return true - succeeded, false - does not occur
    5042 */
    5143periodentafel::iterator periodentafel::AddElement(element * const pointer)
    5244{
    5345  atomicNumber_t Z = pointer->getNumber();
    54   ASSERT(!elements.count(Z), "Element is already present.");
     46  assert(!elements.count(Z));
    5547  pointer->sort = &pointer->Z;
    5648  if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS)
     
    6254/** Removes element from list.
    6355 * \param *pointer element to be removed
     56 * \return true - succeeded, false - element not found
    6457 */
    6558void periodentafel::RemoveElement(element * const pointer)
    6659{
    67   RemoveElement(pointer->getNumber());
    68 };
    69 
    70 /** Removes element from list.
    71  * \param Z element to be removed
    72  */
    73 void periodentafel::RemoveElement(atomicNumber_t Z)
    74 {
     60  atomicNumber_t Z = pointer->getNumber();
    7561  elements.erase(Z);
    7662};
    7763
    7864/** Removes every element from the period table.
     65 * \return true - succeeded, false - does not occur
    7966 */
    8067void periodentafel::CleanupPeriodtable()
     
    9178 * \return pointer to element or NULL if not found
    9279 */
    93 element * const periodentafel::FindElement(atomicNumber_t Z) const
     80const element * periodentafel::FindElement(atomicNumber_t Z) const
    9481{
    9582  const_iterator res = elements.find(Z);
     
    10289 * \return pointer to element
    10390 */
    104 element * const periodentafel::FindElement(const char * const shorthand) const
     91const element * periodentafel::FindElement(const char * const shorthand) const
    10592{
    10693  element *res = 0;
     
    115102
    116103/** Asks for element number and returns pointer to element
    117  * \return desired element or NULL
    118  */
    119 element * const periodentafel::AskElement() const
    120 {
    121   element * walker = NULL;
     104 */
     105const element * periodentafel::AskElement() const
     106{
     107  const element *walker = NULL;
    122108  int Z;
    123109  do {
     
    132118 * \return pointer to either present or newly created element
    133119 */
    134 element * const periodentafel::EnterElement()
    135 {
     120const element * periodentafel::EnterElement()
     121{
     122  const element *res = NULL;
    136123  atomicNumber_t Z = 0;
    137124  DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
    138125  cin >> Z;
    139   element * const res = FindElement(Z);
     126  res = FindElement(Z);
    140127  if (!res) {
    141128    // TODO: make this using the constructor
     129    element *tmp;
    142130    DoLog(0) && (Log() << Verbose(0) << "Element not found in database, please enter." << endl);
    143     element *tmp = new element;
     131    tmp = new element;
    144132    tmp->Z = Z;
    145133    DoLog(0) && (Log() << Verbose(0) << "Mass: " << endl);
     
    150138    cin >> tmp->symbol;
    151139    AddElement(tmp);
    152     return tmp;
     140    res = tmp;
    153141  }
    154142  return res;
     
    216204bool periodentafel::LoadPeriodentafel(const char *path)
    217205{
    218   ifstream input;
     206  ifstream infile;
     207  element *ptr;
     208  map<atomicNumber_t,element*> parsedElems;
    219209  bool status = true;
    220210  bool otherstatus = true;
     
    225215  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    226216  strncat(filename, STANDARDELEMENTSDB, MAXSTRINGSIZE-strlen(filename));
    227   input.open(filename);
    228   status = status && LoadElementsDatabase(&input);
    229 
    230   // fill valence DB per element
    231   strncpy(filename, path, MAXSTRINGSIZE);
    232   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    233   strncat(filename, STANDARDVALENCEDB, MAXSTRINGSIZE-strlen(filename));
    234   input.open(filename);
    235   otherstatus = otherstatus && LoadValenceDatabase(&input);
    236 
    237   // fill orbitals DB per element
    238   strncpy(filename, path, MAXSTRINGSIZE);
    239   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    240   strncat(filename, STANDARDORBITALDB, MAXSTRINGSIZE-strlen(filename));
    241   input.open(filename);
    242   otherstatus = otherstatus && LoadOrbitalsDatabase(&input);
    243 
    244   // fill H-BondAngle DB per element
    245   strncpy(filename, path, MAXSTRINGSIZE);
    246   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    247   strncat(filename, STANDARDHBONDANGLEDB, MAXSTRINGSIZE-strlen(filename));
    248   input.open(filename);
    249   otherstatus = otherstatus && LoadHBondAngleDatabase(&input);
    250 
    251   // fill H-BondDistance DB per element
    252   strncpy(filename, path, MAXSTRINGSIZE);
    253   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
    254   strncat(filename, STANDARDHBONDDISTANCEDB, MAXSTRINGSIZE-strlen(filename));
    255   input.open(filename);
    256   otherstatus = otherstatus && LoadHBondLengthsDatabase(&input);
    257 
    258   if (!otherstatus){
    259     DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
    260   }
    261 
    262   return status;
    263 };
    264 
    265 /** load the element info.
    266  * \param *input stream to parse from
    267  * \return true - parsing successful, false - something went wrong
    268  */
    269 bool periodentafel::LoadElementsDatabase(istream *input)
    270 {
    271   if ((*input) != NULL) {
    272     (*input).getline(header1, MAXSTRINGSIZE);
    273     (*input).getline(header2, MAXSTRINGSIZE); // skip first two header lines
     217  infile.open(filename);
     218  if (infile != NULL) {
     219    infile.getline(header1, MAXSTRINGSIZE);
     220    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
    274221    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    275     while (!(*input).eof()) {
     222    while (!infile.eof()) {
    276223      element *neues = new element;
    277       (*input) >> neues->name;
    278       //(*input) >> ws;
    279       (*input) >> neues->symbol;
    280       //(*input) >> ws;
    281       (*input) >> neues->period;
    282       //(*input) >> ws;
    283       (*input) >> neues->group;
    284       //(*input) >> ws;
    285       (*input) >> neues->block;
    286       //(*input) >> ws;
    287       (*input) >> neues->Z;
    288       //(*input) >> ws;
    289       (*input) >> neues->mass;
    290       //(*input) >> ws;
    291       (*input) >> neues->CovalentRadius;
    292       //(*input) >> ws;
    293       (*input) >> neues->VanDerWaalsRadius;
    294       //(*input) >> ws;
    295       (*input) >> ws;
     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;
    296243      DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol);
    297       if (elements.count(neues->Z)) {// if element already present, remove and delete it
    298         element * const Elemental = FindElement(neues->Z);
    299         ASSERT(Elemental != NULL, "element should be present but is not??");
    300         RemoveElement(Elemental);
    301         delete(Elemental);
    302       }
    303244      //neues->Output((ofstream *)&cout);
    304245      if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS))
    305         elements[neues->getNumber()] = neues;
     246        parsedElems[neues->getNumber()] = neues;
    306247      else {
    307248        DoLog(0) && (Log() << Verbose(0) << "Could not parse element: ");
     
    311252    }
    312253    DoLog(0) && (Log() << Verbose(0) << endl);
    313     return true;
    314   } else
    315     return false;
    316 }
    317 
    318 /** load the valence info.
    319  * \param *input stream to parse from
    320  * \return true - parsing successful, false - something went wrong
    321  */
    322 bool periodentafel::LoadValenceDatabase(istream *input)
    323 {
    324   char dummy[MAXSTRINGSIZE];
    325   if ((*input) != NULL) {
    326     (*input).getline(dummy, MAXSTRINGSIZE);
    327     while (!(*input).eof()) {
     254    infile.close();
     255    infile.clear();
     256  } else
     257    status = false;
     258
     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()) {
    328266      atomicNumber_t Z;
    329       (*input) >> Z;
    330       ASSERT(elements.count(Z), "Element not present");
    331       (*input) >> ws;
    332       (*input) >> elements[Z]->Valence;
    333       (*input) >> ws;
     267      infile >> Z;
     268      infile >> ws;
     269      infile >> parsedElems[Z]->Valence;
     270      infile >> ws;
    334271      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;
    335272    }
    336     return true;
    337   } else
    338                 return false;
    339 }
    340 
    341 /** load the orbitals info.
    342  * \param *input stream to parse from
    343  * \return true - parsing successful, false - something went wrong
    344  */
    345 bool periodentafel::LoadOrbitalsDatabase(istream *input)
    346 {
    347   char dummy[MAXSTRINGSIZE];
    348   if ((*input) != NULL) {
    349     (*input).getline(dummy, MAXSTRINGSIZE);
    350     while (!(*input).eof()) {
     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()) {
    351285      atomicNumber_t Z;
    352       (*input) >> Z;
    353       ASSERT(elements.count(Z), "Element not present");
    354       (*input) >> ws;
    355       (*input) >> elements[Z]->NoValenceOrbitals;
    356       (*input) >> ws;
     286      infile >> Z;
     287      infile >> ws;
     288      infile >> parsedElems[Z]->NoValenceOrbitals;
     289      infile >> ws;
    357290      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;
    358291    }
    359     return true;
    360   } else
    361     return false;
    362 }
    363 
    364 /** load the hbond angles info.
    365  * \param *input stream to parse from
    366  * \return true - parsing successful, false - something went wrong
    367  */
    368 bool periodentafel::LoadHBondAngleDatabase(istream *input)
    369 {
    370   char dummy[MAXSTRINGSIZE];
    371   if ((*input) != NULL) {
    372     (*input).getline(dummy, MAXSTRINGSIZE);
    373     while (!(*input).eof()) {
     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()) {
    374304      atomicNumber_t Z;
    375       (*input) >> Z;
    376       ASSERT(elements.count(Z), "Element not present");
    377       (*input) >> ws;
    378       (*input) >> elements[Z]->HBondAngle[0];
    379       (*input) >> elements[Z]->HBondAngle[1];
    380       (*input) >> elements[Z]->HBondAngle[2];
    381       (*input) >> ws;
     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;
     312      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
     313    }
     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;
    382334      //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;
    383335    }
    384     return true;
    385   } else
    386                 return false;
    387 }
    388 
    389 /** load the hbond lengths info.
    390  * \param *input stream to parse from
    391  * \return true - parsing successful, false - something went wrong
    392  */
    393 bool periodentafel::LoadHBondLengthsDatabase(istream *input)
    394 {
    395   char dummy[MAXSTRINGSIZE];
    396   if ((*input) != NULL) {
    397     (*input).getline(dummy, MAXSTRINGSIZE);
    398     while (!(*input).eof()) {
    399       atomicNumber_t Z;
    400       (*input) >> Z;
    401       ASSERT(elements.count(Z), "Element not present");
    402       (*input) >> ws;
    403       (*input) >> elements[Z]->HBondDistance[0];
    404       (*input) >> elements[Z]->HBondDistance[1];
    405       (*input) >> elements[Z]->HBondDistance[2];
    406       (*input) >> ws;
    407       //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
    408     }
    409     return true;
    410   } else
    411                 return false;
    412 }
     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};
    413356
    414357/** Stores element list to file.
     
    431374    }
    432375    f.close();
    433     return true;
    434   } else
    435     return result;
    436 };
     376  } else
     377    result = false;
     378  return result;
     379};
  • src/periodentafel.hpp

    r9757d9 r60f50a  
    1313#include <iterator>
    1414
    15 #include "unittests/periodentafelTest.hpp"
    1615#include "defs.hpp"
    1716#include "types.hpp"
     
    2827class periodentafel {
    2928  /******* Types *********/
    30   friend class periodentafelTest;
    3129  private:
    3230    typedef std::map<atomicNumber_t,element*> elementSet;
     
    4543  iterator AddElement(element * const pointer);
    4644  void RemoveElement(element * const pointer);
    47   void RemoveElement(atomicNumber_t);
    4845  void CleanupPeriodtable();
    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();
     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();
    5350
    5451  const_iterator begin();
     
    6259
    6360  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 
    7161    elementSet elements;
    7262};
  • src/tesselation.cpp

    r9757d9 r60f50a  
    8383ostream & operator <<(ostream &ost, const BoundaryPointSet &a)
    8484{
    85   ost << "[" << a.Nr << "|" << a.node->getName() << " at " << *a.node->node << "]";
     85  ost << "[" << a.Nr << "|" << a.node->Name << " at " << *a.node->node << "]";
    8686  return ost;
    8787}
     
    321321ostream & operator <<(ostream &ost, const BoundaryLineSet &a)
    322322{
    323   ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << " at " << *a.endpoints[0]->node->node << "," << a.endpoints[1]->node->getName() << " at " << *a.endpoints[1]->node->node << "]";
     323  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << "," << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "]";
    324324  return ost;
    325325}
     
    688688ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a)
    689689{
    690   ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << "," << a.endpoints[1]->node->getName() << "," << a.endpoints[2]->node->getName() << "]";
     690  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << "," << a.endpoints[1]->node->Name << "," << a.endpoints[2]->node->Name << "]";
    691691  //  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << ","
    692692  //      << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "," << a.endpoints[2]->node->Name << " at " << *a.endpoints[2]->node->node << "]";
     
    948948  ost << "[" << a.Nr << "|";
    949949  for (PointSet::const_iterator Runner = a.endpoints.begin(); Runner != a.endpoints.end();) {
    950     ost << (*Runner)->node->getName();
     950    ost << (*Runner)->node->Name;
    951951    Runner++;
    952952    if (Runner != a.endpoints.end())
     
    967967  node = NULL;
    968968  nr = -1;
     969  Name = NULL;
    969970}
    970971;
     
    982983ostream & operator <<(ostream &ost, const TesselPoint &a)
    983984{
    984   ost << "[" << a.getName() << "|" << *a.node << "]";
     985  ost << "[" << (a.Name) << "|" << a.Name << " at " << *a.node << "]";
    985986  return ost;
    986987}
     
    11341135ostream & operator <<(ostream &ost, const CandidateForTesselation &a)
    11351136{
    1136   ost << "[" << a.BaseLine->Nr << "|" << a.BaseLine->endpoints[0]->node->getName() << "," << a.BaseLine->endpoints[1]->node->getName() << "] with ";
     1137  ost << "[" << a.BaseLine->Nr << "|" << a.BaseLine->endpoints[0]->node->Name << "," << a.BaseLine->endpoints[1]->node->Name << "] with ";
    11371138  if (a.pointlist.empty())
    11381139    ost << "no candidate.";
     
    13471348      if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
    13481349        continue;
    1349       DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->getName() << " yields distance of " << distance << "." << endl);
     1350      DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl);
    13501351      tmp = distance / fabs(distance);
    13511352      // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle)
    13521353      if ((sign != 0) && (tmp != sign)) {
    13531354        // 4c. If so, break 4. loop and continue with next candidate in 1. loop
    1354         DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leaves " << checker->second->node->getName() << " outside the convex hull." << endl);
     1355        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl);
    13551356        break;
    13561357      } else { // note the sign for later
    1357         DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leave " << checker->second->node->getName() << " inside the convex hull." << endl);
     1358        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl);
    13581359        sign = tmp;
    13591360      }
     
    42914292        DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
    42924293        DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl);
    4293         DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->getName() << ", " << (*MiddleNode)->getName() << " and " << (*EndNode)->getName() << "." << endl);
     4294        DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl);
    42944295        TriangleCandidates[0] = *StartNode;
    42954296        TriangleCandidates[1] = *MiddleNode;
     
    47134714    return;
    47144715  }
    4715   DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->getName() << "." << endl);
     4716  DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl);
    47164717
    47174718  // go through its lines and find the best one to split
     
    47984799  ofstream *tempstream = NULL;
    47994800  string NameofTempFile;
    4800   string NumberName;
     4801  char NumberName[255];
    48014802
    48024803  if (LastTriangle != NULL) {
    4803     stringstream sstr;
    4804     sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->endpoints[0]->node->getName() << "_" << LastTriangle->endpoints[1]->node->getName() << "_" << LastTriangle->endpoints[2]->node->getName();
    4805     NumberName = sstr.str();
     4804    sprintf(NumberName, "-%04d-%s_%s_%s", (int) TrianglesOnBoundary.size(), LastTriangle->endpoints[0]->node->Name, LastTriangle->endpoints[1]->node->Name, LastTriangle->endpoints[2]->node->Name);
    48064805    if (DoTecplotOutput) {
    48074806      string NameofTempFile(filename);
  • src/tesselationhelpers.cpp

    r9757d9 r60f50a  
    829829      if (TesselStruct->LastTriangle != NULL) {
    830830        for (int i=0;i<3;i++)
    831           *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->getName();
     831          *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name;
    832832      } else {
    833833        *tecplot << "none";
     
    852852    DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl);
    853853    for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) {
    854       DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->getName() << "<->" << runner->second->endpoints[1]->node->getName() << "<->" << runner->second->endpoints[2]->node->getName() << endl);
     854      DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl);
    855855      *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl;
    856856    }
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r9757d9 r60f50a  
    1717#include "AnalysisCorrelationToPointUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
     21#include "boundary.hpp"
    2022#include "element.hpp"
    2123#include "molecule.hpp"
    2224#include "linkedcell.hpp"
    2325#include "periodentafel.hpp"
     26#include "tesselation.hpp"
    2427#include "World.hpp"
    2528
     
    4043  TestList = NULL;
    4144  TestMolecule = NULL;
     45  hydrogen = NULL;
     46  tafel = NULL;
    4247  pointmap = NULL;
    4348  binmap = NULL;
    4449  point = NULL;
    4550
     51  // construct element
     52  hydrogen = new element;
     53  hydrogen->Z = 1;
     54  strcpy(hydrogen->name, "hydrogen");
     55  strcpy(hydrogen->symbol, "H");
     56
     57
     58  // construct periodentafel
     59  tafel = World::getInstance().getPeriode();
     60  tafel->AddElement(hydrogen);
     61
    4662  // construct molecule (tetraeder of hydrogens)
    47   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    48   CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
    4963  TestMolecule = World::getInstance().createMolecule();
    5064  Walker = World::getInstance().createAtom();
  • src/unittests/AnalysisCorrelationToPointUnitTest.hpp

    r9757d9 r60f50a  
    1212
    1313class element;
     14class LinkedCell;
    1415class molecule;
    1516class MoleculeListClass;
     17class periodentafel;
     18class Tesselation;
    1619class Vector;
    1720
     
    3740      MoleculeListClass *TestList;
    3841      molecule *TestMolecule;
    39       const element *hydrogen;
     42      element *hydrogen;
     43      periodentafel *tafel;
    4044
    4145      CorrelationToPointMap *pointmap;
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r9757d9 r60f50a  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
     19#include "World.hpp"
    1920#include "atom.hpp"
    2021#include "boundary.hpp"
     
    4647  TestList = NULL;
    4748  TestSurfaceMolecule = NULL;
     49  hydrogen = NULL;
     50  tafel = NULL;
    4851  surfacemap = NULL;
    4952  binmap = NULL;
     
    5154  LC = NULL;
    5255
     56  // construct element
     57  hydrogen = new element;
     58  hydrogen->Z = 1;
     59  strcpy(hydrogen->name, "hydrogen");
     60  strcpy(hydrogen->symbol, "H");
     61  carbon = new element;
     62  carbon->Z = 6;
     63  strcpy(carbon->name, "carbon");
     64  strcpy(carbon->symbol, "C");
     65
     66  // construct periodentafel
     67  tafel = World::getInstance().getPeriode();
     68  tafel->AddElement(hydrogen);
     69  tafel->AddElement(carbon);
     70
    5371  // construct molecule (tetraeder of hydrogens) base
    54   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    5572  TestSurfaceMolecule = World::getInstance().createMolecule();
    5673  Walker = World::getInstance().createAtom();
     
    85102
    86103  // add outer atoms
    87   carbon = World::getInstance().getPeriode()->FindElement(6);
    88104  TestSurfaceMolecule = World::getInstance().createMolecule();
    89105  Walker = World::getInstance().createAtom();
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp

    r9757d9 r60f50a  
    4545      MoleculeListClass *TestList;
    4646      molecule *TestSurfaceMolecule;
    47       const element *hydrogen;
    48       const element *carbon;
     47      element *hydrogen;
     48      element *carbon;
     49      periodentafel *tafel;
    4950
    5051      CorrelationToSurfaceMap *surfacemap;
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r9757d9 r60f50a  
    4444  TestList = NULL;
    4545  TestMolecule = NULL;
     46  hydrogen = NULL;
     47  tafel = NULL;
    4648  correlationmap = NULL;
    4749  binmap = NULL;
    4850
     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
    4961  // construct molecule (tetraeder of hydrogens)
    50   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    5162  TestMolecule = World::getInstance().createMolecule();
    5263  Walker = World::getInstance().createAtom();
  • src/unittests/AnalysisPairCorrelationUnitTest.hpp

    r9757d9 r60f50a  
    1212
    1313class element;
     14class LinkedCell;
    1415class molecule;
    1516class MoleculeListClass;
     17class periodentafel;
     18class Tesselation;
    1619class Vector;
    1720
     
    3740      MoleculeListClass *TestList;
    3841      molecule *TestMolecule;
    39       const element *hydrogen;
     42      element *hydrogen;
     43      periodentafel *tafel;
    4044
    4145      PairCorrelationMap *correlationmap;
  • src/unittests/CountBondsUnitTest.cpp

    r9757d9 r60f50a  
    1616#include <stdio.h>
    1717#include <cstring>
    18 
    19 #include "Helpers/Assert.hpp"
    2018
    2119#include "analysis_bonds.hpp"
     
    4240{
    4341  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;
    4452
    4553  // construct element
    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");
     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);
    5069
    5170  // construct molecule (water molecule)
    5271  TestMolecule1 = World::getInstance().createMolecule();
    53   CPPUNIT_ASSERT(TestMolecule1 != NULL && "could not create first molecule");
    54   Walker = World::getInstance().createAtom();
    55   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
     72  Walker = World::getInstance().createAtom();
    5673  Walker->type = hydrogen;
    5774  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    5875  TestMolecule1->AddAtom(Walker);
    5976  Walker = World::getInstance().createAtom();
    60   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6177  Walker->type = hydrogen;
    6278  *Walker->node = Vector(0.9658, 0., 0. );
    6379  TestMolecule1->AddAtom(Walker);
    6480  Walker = World::getInstance().createAtom();
    65   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6681  Walker->type = oxygen;
    6782  *Walker->node = Vector(0., 0., 0. );
     
    6984
    7085  TestMolecule2 = World::getInstance().createMolecule();
    71   CPPUNIT_ASSERT(TestMolecule2 != NULL && "could not create second molecule");
    72   Walker = World::getInstance().createAtom();
    73   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
     86  Walker = World::getInstance().createAtom();
    7487  Walker->type = hydrogen;
    7588  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    7689  TestMolecule2->AddAtom(Walker);
    7790  Walker = World::getInstance().createAtom();
    78   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7991  Walker->type = hydrogen;
    8092  *Walker->node = Vector(0.9658, 0., 0. );
    8193  TestMolecule2->AddAtom(Walker);
    8294  Walker = World::getInstance().createAtom();
    83   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    8495  Walker->type = oxygen;
    8596  *Walker->node = Vector(0., 0., 0. );
     
    8798
    8899  molecules = World::getInstance().getMolecules();
    89   CPPUNIT_ASSERT(molecules != NULL && "could not obtain list of molecules");
    90100  molecules->insert(TestMolecule1);
    91101  molecules->insert(TestMolecule2);
     
    101111  // create a small file with table
    102112  BG = new BondGraph(true);
    103   CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    104113
    105114  // construct bond graphs
     
    149158{
    150159  double *mirror = new double[3];
    151   CPPUNIT_ASSERT(mirror != NULL && "could not create array of doubles");
    152160  for (int i=0;i<3;i++)
    153161    mirror[i] = -1.;
  • src/unittests/CountBondsUnitTest.hpp

    r9757d9 r60f50a  
    3939      molecule *TestMolecule1;
    4040      molecule *TestMolecule2;
    41       const element *hydrogen;
    42       const element *oxygen;
     41      element *hydrogen;
     42      element *oxygen;
     43      periodentafel *tafel;
    4344
    4445      BondGraph *BG;
  • src/unittests/LinkedCellUnitTest.cpp

    r9757d9 r60f50a  
    3838  atom *Walker = NULL;
    3939
     40  // init private all pointers to zero
     41  TestMolecule = NULL;
     42  hydrogen = NULL;
     43  tafel = NULL;
     44
    4045  // construct element
    41   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    42   CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     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);
    4355
    4456  // construct molecule (water molecule)
    4557  TestMolecule = World::getInstance().createMolecule();
    46   CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    4758  for (double x=0.5;x<3;x+=1.)
    4859    for (double y=0.5;y<3;y+=1.)
    4960      for (double z=0.5;z<3;z+=1.) {
    5061        Walker = World::getInstance().createAtom();
    51         CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5262        Walker->type = hydrogen;
    5363        *Walker->node = Vector(x, y, z );
     
    5767  // construct linked cell
    5868  LC = new LinkedCell (TestMolecule, 1.);
    59   CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
    6069
    6170  // check that TestMolecule was correctly constructed
     
    196205  // check internal vectors, returns false, because this atom is not in LC-list!
    197206  Walker = World::getInstance().createAtom();
    198   Walker->setName("test");
     207  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
     208  strcpy(Walker->Name, "test");
    199209  Walker->x= Vector(1,1,1);
    200210  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
     
    203213  // check out of bounds vectors
    204214  Walker = World::getInstance().createAtom();
    205   Walker->setName("test");
     215  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
     216  strcpy(Walker->Name, "test");
    206217  Walker->x = Vector(0,-1,0);
    207218  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
  • src/unittests/LinkedCellUnitTest.hpp

    r9757d9 r60f50a  
    4848
    4949      molecule *TestMolecule;
    50       const element *hydrogen;
     50      element *hydrogen;
     51      periodentafel *tafel;
    5152      LinkedCell *LC;
    5253};
  • src/unittests/Makefile.am

    r9757d9 r60f50a  
    3333  MemoryAllocatorUnitTest \
    3434  MoleculeDescriptorTest \
     35  PlaneUnittest \
    3536  ObserverTest \
    3637  ParserUnitTest \
    37   periodentafelTest \
    38   PlaneUnittest \
    3938  SingletonTest \
    4039  StackClassUnitTest \
     
    7675  memoryusageobserverunittest.cpp \
    7776  MoleculeDescriptorTest.cpp \
     77  PlaneUnittest.cpp \
    7878  ObserverTest.cpp \
    7979  ParserUnitTest.cpp \
    80   periodentafelTest.cpp \
    81   PlaneUnittest.cpp \
    8280  SingletonTest.cpp \
    8381  stackclassunittest.cpp \
     
    111109  memoryusageobserverunittest.hpp \
    112110  MoleculeDescriptorTest.hpp \
    113   periodentafelTest.hpp \
    114111  PlaneUnittest.hpp \
    115112  ObserverTest.hpp \
     
    197194ParserUnitTest_LDADD = ${ALLLIBS}
    198195
    199 periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
    200 periodentafelTest_LDADD = ${ALLLIBS}
    201 
    202196PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
    203197PlaneUnittest_LDADD = ${ALLLIBS}
  • src/unittests/ParserUnitTest.cpp

    r9757d9 r60f50a  
    3131
    3232void ParserUnitTest::setUp() {
    33   World::getInstance();
     33  element* oxygen = new element();
     34  oxygen->symbol[0] = 'O';
     35  oxygen->Z = 8;
     36  World::getInstance().getPeriode()->AddElement(oxygen);
     37
     38  element* hydrogen = new element();
     39  hydrogen->symbol[0] = 'H';
     40  hydrogen->Z = 1;
     41  World::getInstance().getPeriode()->AddElement(hydrogen);
    3442}
    3543
  • src/unittests/analysisbondsunittest.cpp

    r9757d9 r60f50a  
    4040  atom *Walker = NULL;
    4141
    42   // get elements
    43   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    44   carbon = World::getInstance().getPeriode()->FindElement(6);
    45   CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
    46   CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
     42  // init private all pointers to zero
     43  TestMolecule = NULL;
     44  hydrogen = NULL;
     45  tafel = NULL;
     46
     47  // construct element
     48  hydrogen = new element;
     49  hydrogen->Z = 1;
     50  hydrogen->Valence = 1;
     51  hydrogen->NoValenceOrbitals = 1;
     52  strcpy(hydrogen->name, "hydrogen");
     53  strcpy(hydrogen->symbol, "H");
     54  carbon = new element;
     55  carbon->Z = 2;
     56  carbon->Valence = 4;
     57  carbon->NoValenceOrbitals = 4;
     58  strcpy(carbon->name, "carbon");
     59  strcpy(carbon->symbol, "C");
     60
     61
     62  // construct periodentafel
     63  tafel = World::getInstance().getPeriode();
     64  tafel->AddElement(hydrogen);
     65  tafel->AddElement(carbon);
    4766
    4867  // construct molecule (tetraeder of hydrogens)
    4968  TestMolecule = World::getInstance().createMolecule();
    50   CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    5169  Walker = World::getInstance().createAtom();
    52   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5370  Walker->type = hydrogen;
    5471  *Walker->node = Vector(1.5, 0., 1.5 );
    5572  TestMolecule->AddAtom(Walker);
    5673  Walker = World::getInstance().createAtom();
    57   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5874  Walker->type = hydrogen;
    5975  *Walker->node = Vector(0., 1.5, 1.5 );
    6076  TestMolecule->AddAtom(Walker);
    6177  Walker = World::getInstance().createAtom();
    62   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6378  Walker->type = hydrogen;
    6479  *Walker->node = Vector(1.5, 1.5, 0. );
    6580  TestMolecule->AddAtom(Walker);
    6681  Walker = World::getInstance().createAtom();
    67   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6882  Walker->type = hydrogen;
    6983  *Walker->node = Vector(0., 0., 0. );
    7084  TestMolecule->AddAtom(Walker);
    7185  Walker = World::getInstance().createAtom();
    72   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7386  Walker->type = carbon;
    7487  *Walker->node = Vector(0.5, 0.5, 0.5 );
     
    8093  // create a small file with table
    8194  filename = new string("test.dat");
    82   CPPUNIT_ASSERT(filename != NULL && "could not create string");
    8395  ofstream test(filename->c_str());
    84   test << ".\tH\tHe\tLi\tBe\tB\tC\n";
    85   test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
    86   test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
    87   test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
    88   test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
    89   test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
    90   test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
     96  test << ".\tH\tC\n";
     97  test << "H\t1.\t1.2\n";
     98  test << "C\t1.2\t1.5\n";
    9199  test.close();
    92100  BG = new BondGraph(true);
    93   CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    94101
    95102  CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
    96103  CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
    97   CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
    98   CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
     104  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
     105  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
    99106
    100107  BG->ConstructBondGraph(TestMolecule);
  • src/unittests/analysisbondsunittest.hpp

    r9757d9 r60f50a  
    3434
    3535      molecule *TestMolecule;
    36       const element *hydrogen;
    37       const element *carbon;
     36      element *hydrogen;
     37      element *carbon;
     38      periodentafel *tafel;
    3839
    3940      BondGraph *BG;
  • src/unittests/bondgraphunittest.cpp

    r9757d9 r60f50a  
    1515#include <stdio.h>
    1616#include <cstring>
    17 
    18 #include "Helpers/Assert.hpp"
    1917
    2018#include "World.hpp"
     
    4341  atom *Walker = NULL;
    4442
     43  // init private all pointers to zero
     44  TestMolecule = NULL;
     45  hydrogen = NULL;
     46  tafel = NULL;
     47
    4548  // construct element
    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");
     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);
    5067
    5168  // construct molecule (tetraeder of hydrogens)
    5269  TestMolecule = World::getInstance().createMolecule();
    53   CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    5470  Walker = World::getInstance().createAtom();
    55   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5671  Walker->type = carbon;
    5772  *Walker->node = Vector(1., 0., 1. );
     
    5974
    6075  Walker = World::getInstance().createAtom();
    61   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6276  Walker->type = carbon;
    6377  *Walker->node = Vector(0., 1., 1. );
     
    6579
    6680  Walker = World::getInstance().createAtom();
    67   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6881  Walker->type = carbon;
    6982  *Walker->node = Vector(1., 1., 0. );
     
    7184
    7285  Walker = World::getInstance().createAtom();
    73   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    7486  Walker->type = carbon;
    7587  *Walker->node = Vector(0., 0., 0. );
     
    8193  // create a small file with table
    8294  dummyname = new string("dummy.dat");
    83   CPPUNIT_ASSERT(dummyname != NULL && "could not create string");
    8495  filename = new string("test.dat");
    85   CPPUNIT_ASSERT(filename != NULL && "could not create string");
    8696  ofstream test(filename->c_str());
    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";
     97  test << ".\tH\tC\n";
     98  test << "H\t1.\t1.2\n";
     99  test << "C\t1.2\t1.5\n";
    94100  test.close();
    95101  BG = new BondGraph(true);
    96   CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
    97102};
    98103
     
    121126  CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
    122127  CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
    123   CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
    124   CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
     128  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
     129  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
    125130};
    126131
  • src/unittests/bondgraphunittest.hpp

    r9757d9 r60f50a  
    3737
    3838      molecule *TestMolecule;
    39       const element *hydrogen;
    40       const element *carbon;
     39      element *hydrogen;
     40      element *carbon;
     41      periodentafel *tafel;
    4142
    4243      BondGraph *BG;
  • src/unittests/listofbondsunittest.cpp

    r9757d9 r60f50a  
    3838  atom *Walker = NULL;
    3939
     40  // init private all pointers to zero
     41  TestMolecule = NULL;
     42  hydrogen = NULL;
     43  tafel = NULL;
     44
    4045  // construct element
    41   hydrogen = World::getInstance().getPeriode()->FindElement(1);
    42   CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
     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);
    4355
    4456  // construct molecule (tetraeder of hydrogens)
    4557  TestMolecule = World::getInstance().createMolecule();
    46   CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
    47   Walker = World::getInstance().createAtom();
    48   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
     58  Walker = World::getInstance().createAtom();
    4959  Walker->type = hydrogen;
    5060  *Walker->node = Vector(1., 0., 1. );
    5161  TestMolecule->AddAtom(Walker);
    5262  Walker = World::getInstance().createAtom();
    53   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5463  Walker->type = hydrogen;
    5564  *Walker->node = Vector(0., 1., 1. );
    5665  TestMolecule->AddAtom(Walker);
    5766  Walker = World::getInstance().createAtom();
    58   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    5967  Walker->type = hydrogen;
    6068  *Walker->node = Vector(1., 1., 0. );
    6169  TestMolecule->AddAtom(Walker);
    6270  Walker = World::getInstance().createAtom();
    63   CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    6471  Walker->type = hydrogen;
    6572  *Walker->node = Vector(0., 0., 0. );
     
    6875  // check that TestMolecule was correctly constructed
    6976  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
     77
    7078};
    7179
  • src/unittests/listofbondsunittest.hpp

    r9757d9 r60f50a  
    4141
    4242      molecule *TestMolecule;
    43       const element *hydrogen;
     43      element *hydrogen;
     44      periodentafel *tafel;
    4445};
    4546
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r9757d9 r60f50a  
    3737  tesselpoints[0] = new TesselPoint;
    3838  tesselpoints[0]->node = new Vector(0., 0., 0.);
    39   tesselpoints[0]->setName("1");
     39  tesselpoints[0]->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
     40  strcpy(tesselpoints[0]->Name, "1");
    4041  tesselpoints[0]->nr = 1;
    4142  points[0] = new BoundaryPointSet(tesselpoints[0]);
    4243  tesselpoints[1] = new TesselPoint;
    4344  tesselpoints[1]->node = new Vector(0., 1., 0.);
    44   tesselpoints[1]->setName("2");
     45  tesselpoints[1]->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
     46  strcpy(tesselpoints[1]->Name, "2");
    4547  tesselpoints[1]->nr = 2;
    4648  points[1] = new BoundaryPointSet(tesselpoints[1]);
    4749  tesselpoints[2] = new TesselPoint;
    48   tesselpoints[2]->node = new Vector(1., 0., 0.);
    49   tesselpoints[2]->setName("3");
    50   tesselpoints[2]->nr = 3;
     50  tesselpoints[2] ->node = new Vector(1., 0., 0.);
     51  tesselpoints[2] ->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
     52  strcpy(tesselpoints[2] ->Name, "3");
     53  tesselpoints[2] ->nr = 3;
    5154  points[2] = new BoundaryPointSet(tesselpoints[2] );
    5255
  • src/unittests/tesselation_insideoutsideunittest.cpp

    r9757d9 r60f50a  
    3838  Walker = new TesselPoint;
    3939  Walker->node = new Vector(0., 0., 0.);
    40   Walker->setName("1");
     40  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     41  strcpy(Walker->Name, "1");
    4142  Walker->nr = 1;
    4243  Corners.push_back(Walker);
    4344  Walker = new TesselPoint;
    4445  Walker->node = new Vector(0., 1., 0.);
    45   Walker->setName("2");
     46  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     47  strcpy(Walker->Name, "2");
    4648  Walker->nr = 2;
    4749  Corners.push_back(Walker);
    4850  Walker = new TesselPoint;
    4951  Walker->node = new Vector(1., 0., 0.);
    50   Walker->setName("3");
     52  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     53  strcpy(Walker->Name, "3");
    5154  Walker->nr = 3;
    5255  Corners.push_back(Walker);
    5356  Walker = new TesselPoint;
    5457  Walker->node = new Vector(1., 1., 0.);
    55   Walker->setName("4");
     58  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     59  strcpy(Walker->Name, "4");
    5660  Walker->nr = 4;
    5761  Corners.push_back(Walker);
    5862  Walker = new TesselPoint;
    5963  Walker->node = new Vector(0., 0., 1.);
    60   Walker->setName("5");
     64  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     65  strcpy(Walker->Name, "5");
    6166  Walker->nr = 5;
    6267  Corners.push_back(Walker);
    6368  Walker = new TesselPoint;
    6469  Walker->node = new Vector(0., 1., 1.);
    65   Walker->setName("6");
     70  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     71  strcpy(Walker->Name, "6");
    6672  Walker->nr = 6;
    6773  Corners.push_back(Walker);
    6874  Walker = new TesselPoint;
    6975  Walker->node = new Vector(1., 0., 1.);
    70   Walker->setName("7");
     76  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     77  strcpy(Walker->Name, "7");
    7178  Walker->nr = 7;
    7279  Corners.push_back(Walker);
    7380  Walker = new TesselPoint;
    7481  Walker->node = new Vector(1., 1., 1.);
    75   Walker->setName("8");
     82  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
     83  strcpy(Walker->Name, "8");
    7684  Walker->nr = 8;
    7785  Corners.push_back(Walker);
  • src/unittests/tesselationunittest.cpp

    r9757d9 r60f50a  
    3737  Walker = new TesselPoint;
    3838  Walker->node = new Vector(1., 0., -1.);
    39   Walker->setName("1");
     39  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
     40  strcpy(Walker->Name, "1");
    4041  Walker->nr = 1;
    4142  Corners.push_back(Walker);
    4243  Walker = new TesselPoint;
    4344  Walker->node = new Vector(-1., 1., -1.);
    44   Walker->setName("2");
     45  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
     46  strcpy(Walker->Name, "2");
    4547  Walker->nr = 2;
    4648  Corners.push_back(Walker);
    4749  Walker = new TesselPoint;
    4850  Walker->node = new Vector(-1., -1., -1.);
    49   Walker->setName("3");
     51  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
     52  strcpy(Walker->Name, "3");
    5053  Walker->nr = 3;
    5154  Corners.push_back(Walker);
    5255  Walker = new TesselPoint;
    5356  Walker->node = new Vector(-1., 0., 1.);
    54   Walker->setName("4");
     57  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
     58  strcpy(Walker->Name, "4");
    5559  Walker->nr = 4;
    5660  Corners.push_back(Walker);
  • tests/testsuite.at

    r9757d9 r60f50a  
    1111AT_KEYWORDS([options])
    1212AT_CHECK([pwd],[ignore],[ignore])
    13 AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
     13AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore])
    1414AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
    1515AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore])
     
    1717AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr])
    1818AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore])
     19AT_CHECK([../../molecuilder test.conf], 0, [stdout], [stderr])
     20AT_CHECK([fgrep "Element list loading failed" stdout], 0, [ignore], [ignore])
    1921AT_CLEANUP
    2022
     
    103105AT_KEYWORDS([graph])
    104106AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0)
    105 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 3 -D 2.], 0, [stdout], [stderr])
     107AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -vvv -D 2.], 0, [stdout], [stderr])
    106108AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1
    107109], [ignore])
Note: See TracChangeset for help on using the changeset viewer.