Changes in / [5d6f38:dd97a9]


Ignore:
Files:
146 added
256 deleted
61 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r5d6f38 rdd97a9  
    134134AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
    135135AC_CONFIG_FILES([
    136         tests/CodeChecks/atlocal
    137         tests/CodeChecks/Makefile])
    138 AC_CONFIG_FILES([
    139136        tests/Tesselations/Makefile
    140137        tests/Tesselations/defs])
     
    148145        src/Makefile
    149146        src/Actions/Makefile
    150         src/Exceptions/Makefile
    151         src/Helpers/Makefile
    152         src/LinearAlgebra/Makefile
    153         src/Parser/Makefile
     147  src/Exceptions/Makefile
     148  src/Helpers/Makefile
     149  src/LinearAlgebra/Makefile
     150  src/Parser/Makefile
    154151        src/UIElements/Makefile
    155 ])
    156 AC_CONFIG_FILES([
    157         src/unittests/Makefile
    158         src/Actions/unittests/Makefile
    159         src/Descriptors/unittests/Makefile
    160         src/Helpers/unittests/Makefile
    161         src/LinearAlgebra/unittests/Makefile
    162   src/Parser/unittests/Makefile
    163         src/Patterns/unittests/Makefile
    164   src/UIElements/Menu/unittests/Makefile
    165 ])
     152        src/unittests/Makefile])
    166153AC_OUTPUT
  • src/Actions/CommandAction/BondLengthTableAction.cpp

    r5d6f38 rdd97a9  
    4747  if (configuration->BG == NULL) {
    4848    configuration->BG = new BondGraph(configuration->GetIsAngstroem());
    49     if ((!params.BondGraphFileName.empty())
    50         && boost::filesystem::exists(params.BondGraphFileName)
    51         && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) {
     49    if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) {
    5250      DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
    5351      return Action::success;
  • src/Actions/Makefile.am

    r5d6f38 rdd97a9  
    1515  ${MOLECULEACTIONSOURCE} \
    1616  ${PARSERACTIONSOURCE} \
    17   ${SELECTIONATOMACTIONSOURCE} \
    18   ${SELECTIONMOLECULEACTIONSOURCE} \
     17  ${SELECTIONACTIONSOURCE} \
    1918  ${TESSELATIONACTIONSOURCE} \
    2019  ${WORLDACTIONSOURCE} \
     
    3029  ${MOLECULEACTIONHEADER} \
    3130  ${PARSERACTIONHEADER} \
    32   ${SELECTIONATOMACTIONHEADER} \
    33   ${SELECTIONMOLECULEACTIONHEADER} \
     31  ${SELECTIONACTIONHEADER} \
    3432  ${TESSELATIONACTIONHEADER} \
    3533  ${WORLDACTIONHEADER} \
     
    124122  MoleculeAction/VerletIntegrationAction.hpp
    125123                 
    126 SELECTIONATOMACTIONSOURCE = \
    127         SelectionAction/Atoms/AllAtomsAction.cpp \
    128         SelectionAction/Atoms/AllAtomsInsideCuboidAction.cpp \
    129         SelectionAction/Atoms/AllAtomsInsideSphereAction.cpp \
    130         SelectionAction/Atoms/AllAtomsOfMoleculeAction.cpp \
    131         SelectionAction/Atoms/AtomByElementAction.cpp \
    132         SelectionAction/Atoms/AtomByIdAction.cpp \
    133         SelectionAction/Atoms/ClearAllAtomsAction.cpp \
    134         SelectionAction/Atoms/NotAllAtomsAction.cpp \
    135         SelectionAction/Atoms/NotAllAtomsInsideCuboidAction.cpp \
    136         SelectionAction/Atoms/NotAllAtomsInsideSphereAction.cpp \
    137         SelectionAction/Atoms/NotAllAtomsOfMoleculeAction.cpp \
    138         SelectionAction/Atoms/NotAtomByElementAction.cpp \
    139         SelectionAction/Atoms/NotAtomByIdAction.cpp
    140 SELECTIONATOMACTIONHEADER = \
    141         SelectionAction/Atoms/AllAtomsAction.hpp \
    142         SelectionAction/Atoms/AllAtomsInsideCuboidAction.hpp \
    143         SelectionAction/Atoms/AllAtomsInsideSphereAction.hpp \
    144         SelectionAction/Atoms/AllAtomsOfMoleculeAction.hpp \
    145         SelectionAction/Atoms/AtomByElementAction.hpp \
    146         SelectionAction/Atoms/AtomByIdAction.hpp \
    147         SelectionAction/Atoms/ClearAllAtomsAction.hpp \
    148         SelectionAction/Atoms/NotAllAtomsAction.hpp \
    149         SelectionAction/Atoms/NotAllAtomsInsideCuboidAction.hpp \
    150         SelectionAction/Atoms/NotAllAtomsInsideSphereAction.hpp \
    151         SelectionAction/Atoms/NotAllAtomsOfMoleculeAction.hpp \
    152         SelectionAction/Atoms/NotAtomByElementAction.hpp \
    153         SelectionAction/Atoms/NotAtomByIdAction.hpp
    154 
    155 SELECTIONMOLECULEACTIONSOURCE = \
    156         SelectionAction/Molecules/AllMoleculesAction.cpp \
    157         SelectionAction/Molecules/ClearAllMoleculesAction.cpp \
    158         SelectionAction/Molecules/MoleculeByFormulaAction.cpp \
    159         SelectionAction/Molecules/MoleculeByIdAction.cpp \
    160         SelectionAction/Molecules/MoleculeByNameAction.cpp \
    161         SelectionAction/Molecules/MoleculeByOrderAction.cpp \
    162         SelectionAction/Molecules/MoleculeOfAtomAction.cpp \
    163         SelectionAction/Molecules/NotAllMoleculesAction.cpp \
    164         SelectionAction/Molecules/NotMoleculeByFormulaAction.cpp \
    165         SelectionAction/Molecules/NotMoleculeByIdAction.cpp \
    166         SelectionAction/Molecules/NotMoleculeByNameAction.cpp \
    167         SelectionAction/Molecules/NotMoleculeByOrderAction.cpp \
    168         SelectionAction/Molecules/NotMoleculeOfAtomAction.cpp
    169 SELECTIONMOLECULEACTIONHEADER = \
    170         SelectionAction/Molecules/AllMoleculesAction.hpp \
    171         SelectionAction/Molecules/ClearAllMoleculesAction.hpp \
    172         SelectionAction/Molecules/MoleculeByFormulaAction.hpp \
    173         SelectionAction/Molecules/MoleculeByIdAction.hpp \
    174         SelectionAction/Molecules/MoleculeByNameAction.hpp \
    175         SelectionAction/Molecules/MoleculeByOrderAction.hpp \
    176         SelectionAction/Molecules/MoleculeOfAtomAction.hpp \
    177         SelectionAction/Molecules/NotAllMoleculesAction.hpp \
    178         SelectionAction/Molecules/NotMoleculeByFormulaAction.hpp \
    179         SelectionAction/Molecules/NotMoleculeByIdAction.hpp \
    180         SelectionAction/Molecules/NotMoleculeByNameAction.hpp \
    181         SelectionAction/Molecules/NotMoleculeByOrderAction.hpp \
    182         SelectionAction/Molecules/NotMoleculeOfAtomAction.hpp
    183        
     124SELECTIONACTIONSOURCE = \
     125        SelectionAction/AllAtomsAction.cpp \
     126        SelectionAction/AllAtomsInsideCuboidAction.cpp \
     127        SelectionAction/AllAtomsInsideSphereAction.cpp \
     128        SelectionAction/AllAtomsOfMoleculeAction.cpp \
     129        SelectionAction/AllMoleculesAction.cpp \
     130        SelectionAction/AtomByElementAction.cpp \
     131        SelectionAction/AtomByIdAction.cpp \
     132        SelectionAction/ClearAllAtomsAction.cpp \
     133        SelectionAction/ClearAllMoleculesAction.cpp \
     134        SelectionAction/MoleculeByFormulaAction.cpp \
     135        SelectionAction/MoleculeByIdAction.cpp \
     136        SelectionAction/MoleculeByOrderAction.cpp \
     137        SelectionAction/MoleculeOfAtomAction.cpp \
     138        SelectionAction/NotAllAtomsAction.cpp \
     139        SelectionAction/NotAllAtomsInsideCuboidAction.cpp \
     140        SelectionAction/NotAllAtomsInsideSphereAction.cpp \
     141        SelectionAction/NotAllAtomsOfMoleculeAction.cpp \
     142        SelectionAction/NotAllMoleculesAction.cpp \
     143        SelectionAction/NotAtomByElementAction.cpp \
     144        SelectionAction/NotAtomByIdAction.cpp \
     145        SelectionAction/NotMoleculeByFormulaAction.cpp \
     146        SelectionAction/NotMoleculeByIdAction.cpp \
     147        SelectionAction/NotMoleculeOfAtomAction.cpp
     148SELECTIONACTIONHEADER = \
     149        SelectionAction/AllAtomsAction.hpp \
     150        SelectionAction/AllAtomsInsideCuboidAction.hpp \
     151        SelectionAction/AllAtomsInsideSphereAction.hpp \
     152        SelectionAction/AllAtomsOfMoleculeAction.hpp \
     153        SelectionAction/AllMoleculesAction.hpp \
     154        SelectionAction/AtomByElementAction.hpp \
     155        SelectionAction/AtomByIdAction.hpp \
     156        SelectionAction/ClearAllAtomsAction.hpp \
     157        SelectionAction/ClearAllMoleculesAction.hpp \
     158        SelectionAction/MoleculeByFormulaAction.hpp \
     159        SelectionAction/MoleculeByIdAction.hpp \
     160        SelectionAction/MoleculeByOrderAction.hpp \
     161        SelectionAction/MoleculeOfAtomAction.hpp \
     162        SelectionAction/NotAllAtomsAction.hpp \
     163        SelectionAction/NotAllAtomsInsideCuboidAction.hpp \
     164        SelectionAction/NotAllAtomsInsideSphereAction.hpp \
     165        SelectionAction/NotAllAtomsOfMoleculeAction.hpp \
     166        SelectionAction/NotAllMoleculesAction.hpp \
     167        SelectionAction/NotAtomByElementAction.hpp \
     168        SelectionAction/NotAtomByIdAction.hpp \
     169        SelectionAction/NotMoleculeByFormulaAction.hpp \
     170        SelectionAction/NotMoleculeByIdAction.hpp \
     171        SelectionAction/NotMoleculeOfAtomAction.cpp
     172
    184173TESSELATIONACTIONSOURCE = \
    185174  TesselationAction/ConvexEnvelopeAction.cpp \
  • src/Actions/MoleculeAction/LoadAction.cpp

    r5d6f38 rdd97a9  
    6464    boost::filesystem::ifstream input;
    6565    input.open(params.filename);
    66     FormatParserStorage::getInstance().load(input, FilenameSuffix);
     66    FormatParserStorage::getInstance().get(input, FilenameSuffix);
    6767    input.close();
    6868
  • src/Actions/MoleculeAction/SaveAction.cpp

    r5d6f38 rdd97a9  
    6060  output.open(params.filename);
    6161  if (!output.fail()) {
    62     FormatParserStorage::getInstance().saveSelectedMolecules(output, FilenameSuffix);
     62    FormatParserStorage::getInstance().put(output, FilenameSuffix);
    6363  } else {
    6464    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
     
    6666  output.close();
    6767
    68   return Action::success;
     68  return Action::failure;
    6969}
    7070
  • src/Actions/MoleculeAction/SaveAction.def

    r5d6f38 rdd97a9  
    3030
    3131// finally the information stored in the ActionTrait specialization
    32 #define DESCRIPTION "save selected molecules as file of certain type"
     32#define DESCRIPTION "save world as file of certain type"
    3333#define SHORTFORM "s"
  • src/Actions/WorldAction/InputAction.cpp

    r5d6f38 rdd97a9  
    7171    // parse the file
    7272    test.open(params.filename);
    73     FormatParserStorage::getInstance().load(test, FilenameSuffix);
     73    FormatParserStorage::getInstance().get(test, FilenameSuffix);
    7474    test.close();
    7575
  • src/Actions/WorldAction/OutputAction.cpp

    r5d6f38 rdd97a9  
    2020#include "Helpers/MemDebug.hpp"
    2121
    22 #include "Parser/FormatParserStorage.hpp"
     22#include "Parser/ChangeTracker.hpp"
    2323#include "Helpers/Log.hpp"
    2424#include "Helpers/Verbose.hpp"
     
    2727#include <iostream>
    2828#include <string>
    29 
    30 #include <boost/filesystem/fstream.hpp>
    3129
    3230using namespace std;
     
    4240  getParametersfromValueStorage();
    4341
    44   DoLog(1) && (Log() << Verbose(1) << "Storing world to file " << params.filename << "." << endl);
    45 
    46   // extract suffix
    47   std::string FilenameSuffix;
    48   std::string FilenamePrefix;
    49   if (params.filename.has_filename()) {
    50     // get suffix
    51     FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
    52     FilenamePrefix = params.filename.stem();
    53   } else {
    54     DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl);
    55     return Action::failure;
    56   }
    57 
    58   // store file
    59   // parse the file
    60   boost::filesystem::ofstream output;
    61   output.open(params.filename);
    62   if (!output.fail()) {
    63     FormatParserStorage::getInstance().saveWorld(output, FilenameSuffix);
    64   } else {
    65     DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl);
    66   }
    67   output.close();
    68 
     42  DoLog(0) && (Log() << Verbose(0) << "Saving world to files." << endl);
     43  ChangeTracker::getInstance().saveStatus();
    6944  return Action::success;
    7045}
  • src/Actions/WorldAction/OutputAction.def

    r5d6f38 rdd97a9  
    77
    88// all includes and forward declarations necessary for non-integral types below
    9 #
     9
    1010
    1111// i.e. there is an integer with variable name Z that can be found in
    1212// ValueStorage by the token "Z" -> first column: int, Z, "Z"
    1313// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
    14 #define paramtypes (boost::filesystem::path)
    15 #define paramtokens ("output")
    16 #define paramdescriptions ("filename to write to")
     14#undef paramtypes
     15#undef paramtokens
     16#undef paramdescriptions
    1717#undef paramdefaults
    18 #define paramreferences (filename)
     18#undef paramreferences
    1919
    2020#undef statetypes
     
    3030
    3131// finally the information stored in the ActionTrait specialization
    32 #define DESCRIPTION "write all atoms to given file"
     32#define DESCRIPTION "write output files"
    3333#undef SHORTFORM
  • src/Descriptors/MoleculeNameDescriptor.cpp

    r5d6f38 rdd97a9  
    5353
    5454vector<molecule*> MoleculeNameDescriptor_impl::findAll(){
    55   vector<molecule *> foundMolecules;
    56   World::MoleculeSet &molecules = getMolecules();
    57   World::MoleculeSet::iterator res = molecules.begin();
    58   for (; res != molecules.end(); res++)
    59     if (res->second->name == name)
    60       foundMolecules.push_back(res->second);
    61   return foundMolecules;
     55  molecule *res = find();
     56  return (res)?(vector<molecule*>(1,res)):(vector<molecule*>());
    6257}
  • src/Helpers/MemDebug.cpp

    r5d6f38 rdd97a9  
    380380  // mark the block as not in the list (will be changed by addEntry)
    381381  entry->isIgnored = true;
    382   if (line != 0)  { // indicator that we do not know the source
    383     Memory::addEntry(entry);
    384   }
     382  Memory::addEntry(entry);
    385383
    386384  // get the checksum...
     
    426424  // mark the block as not in the list (will be changed by addEntry)
    427425  entry->isIgnored = true;
    428   if (line != 0)  { // indicator that we do not know the source
    429     Memory::addEntry(entry);
    430   }
     426  Memory::addEntry(entry);
    431427
    432428  // get the checksum...
     
    509505void operator delete(void *ptr) throw() {
    510506  if(!ptr){
    511     //cerr << "Warning: Deleting NULL pointer" << endl;
     507    cerr << "Warning: Deleting NULL pointer" << endl;
    512508    return;
    513509  }
  • src/Helpers/MemDebug.hpp

    r5d6f38 rdd97a9  
    5252#include <boost/shared_ptr.hpp>
    5353#include <boost/function.hpp>
     54#include <boost/program_options.hpp>
    5455
    5556
  • src/LinearAlgebra/Makefile.am

    r5d6f38 rdd97a9  
    1717  LineSegment.cpp \
    1818  LineSegmentSet.cpp \
    19   LinearSystemOfEquations.cpp \
     19  linearsystemofequations.cpp \
    2020  MatrixContent.cpp \
    2121  MatrixVector_ops.cpp \
     
    3636  LineSegment.hpp \
    3737  LineSegmentSet.hpp \
    38   LinearSystemOfEquations.hpp \
     38  linearsystemofequations.hpp \
    3939  MatrixContent.hpp \
    4040  MatrixVector_ops.hpp \
  • src/LinearAlgebra/Subspace.hpp

    r5d6f38 rdd97a9  
    1515#include "MatrixContent.hpp"
    1616#include "VectorContent.hpp"
    17 #include "unittests/SubspaceFactorizerUnitTest.hpp"
     17#include "unittests/SubspaceFactorizerUnittest.hpp"
    1818
    1919/** A subset of eigenvectors from an Eigenspace.
  • src/Makefile.am

    r5d6f38 rdd97a9  
    8484
    8585 
    86 DESCRIPTORSOURCE = \
    87         Descriptors/AtomDescriptor.cpp \
     86DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \
    8887  Descriptors/AtomIdDescriptor.cpp \
    89   Descriptors/AtomOfMoleculeSelectionDescriptor.cpp \
    9088  Descriptors/AtomSelectionDescriptor.cpp \
    9189  Descriptors/AtomShapeDescriptor.cpp \
     
    9593  Descriptors/MoleculeIdDescriptor.cpp \
    9694  Descriptors/MoleculeNameDescriptor.cpp \
    97   Descriptors/MoleculeOfAtomSelectionDescriptor.cpp \
    98   Descriptors/MoleculeOrderDescriptor.cpp \
    9995  Descriptors/MoleculePtrDescriptor.cpp \
    10096  Descriptors/MoleculeSelectionDescriptor.cpp
    10197                                   
    10298
    103 DESCRIPTORHEADER = \
    104         Descriptors/AtomDescriptor.hpp \
     99DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \
    105100  Descriptors/AtomIdDescriptor.hpp \
    106   Descriptors/AtomOfMoleculeSelectionDescriptor.hpp \
    107101  Descriptors/AtomSelectionDescriptor.hpp \
    108102  Descriptors/AtomShapeDescriptor.hpp \
     
    112106  Descriptors/MoleculeIdDescriptor.hpp \
    113107  Descriptors/MoleculeNameDescriptor.hpp \
    114   Descriptors/MoleculeOfAtomSelectionDescriptor.hpp \
    115   Descriptors/MoleculeOrderDescriptor.hpp \
    116108  Descriptors/MoleculePtrDescriptor.hpp \
    117   Descriptors/MoleculeSelectionDescriptor.hpp
    118  
    119 DESCRIPTORIMPLHEADER = \
    120         Descriptors/AtomDescriptor_impl.hpp \
    121   Descriptors/AtomIdDescriptor_impl.hpp \
    122   Descriptors/AtomOfMoleculeSelectionDescriptor_impl.hpp \
    123   Descriptors/AtomSelectionDescriptor_impl.hpp \
    124   Descriptors/AtomShapeDescriptor_impl.hpp \
    125   Descriptors/AtomTypeDescriptor_impl.hpp \
    126   Descriptors/MoleculeDescriptor_impl.hpp \
    127   Descriptors/MoleculeFormulaDescriptor_impl.hpp \
    128   Descriptors/MoleculeIdDescriptor_impl.hpp \
    129   Descriptors/MoleculeNameDescriptor_impl.hpp \
    130   Descriptors/MoleculeOfAtomSelectionDescriptor_impl.hpp \
    131   Descriptors/MoleculeOrderDescriptor_impl.hpp \
    132   Descriptors/MoleculePtrDescriptor_impl.hpp \
    133   Descriptors/MoleculeSelectionDescriptor_impl.hpp
     109  Descriptors/MoleculeSelectionDescriptor.cpp
    134110 
    135111THERMOSTATSOURCE = \
     
    215191  ${SHAPEHEADER} \
    216192  ${DESCRIPTORHEADER} \
    217   ${DESCRIPTORIMPLHEADER} \
    218193  ${THERMOSTATHEADER} \
    219194  ${TESSELATIONHEADER} \
     
    317292#molecuilder_CXXFLAGS += -DNO_CACHING
    318293molecuilder_LDFLAGS = $(BOOST_LIB)
    319 molecuilder_SOURCES = builder.cpp builder_init.cpp builder_init.hpp
     294molecuilder_SOURCES = builder.cpp
    320295molecuilder_LDADD = \
    321296        UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
     
    329304
    330305#Stuff for building the GUI using Qt
    331 molecuildergui_SOURCES = builder.cpp builder_init.cpp builder_init.hpp
     306molecuildergui_SOURCES = builder.cpp
    332307molecuildergui_CXXFLAGS = $(BOOST_CPPFLAGS) -DUSE_GUI_QT
    333308molecuildergui_LDFLAGS = $(BOOST_LIB)
  • src/Parser/FormatParser.cpp

    r5d6f38 rdd97a9  
    5252  }
    5353
    54   std::vector<atom *> atoms = World::getInstance().getAllAtoms();
    55   save(saveStream, atoms);
     54  save(saveStream);
    5655}
    5756
  • src/Parser/FormatParser.hpp

    r5d6f38 rdd97a9  
    1313#include "parser.hpp"
    1414
    15 class atom;
    16 
    1715/**
    1816 * General parser which observes the change tracker.
     
    2220  FormatParser();
    2321  virtual ~FormatParser();
    24   virtual void save(std::ostream* file, const std::vector<atom *> &atoms)=0;
     22  virtual void save(std::ostream* file)=0;
    2523  virtual void load(std::istream* file)=0;
    2624  void setOstream(std::ostream* file);
  • src/Parser/FormatParserStorage.cpp

    r5d6f38 rdd97a9  
    3636
    3737#include "Helpers/Assert.hpp"
    38 
    39 #include "molecule.hpp"
    4038
    4139#include "Patterns/Singleton_impl.hpp"
     
    226224 * \return true - parsing ok, false - suffix unknown
    227225 */
    228 bool FormatParserStorage::load(std::istream &input, std::string suffix)
     226bool FormatParserStorage::get(std::istream &input, std::string suffix)
    229227{
    230228  if (suffix == ParserSuffixes[mpqc]) {
     
    245243}
    246244
    247 /** Stores all selected atoms in an ostream depending on its suffix
    248  * \param &output output stream
    249  * \param suffix
    250  * \return true - storing ok, false - suffix unknown
    251  */
    252 bool FormatParserStorage::saveSelectedAtoms(std::ostream &output, std::string suffix)
    253 {
    254   std::vector<atom *> atoms = World::getInstance().getSelectedAtoms();
    255   return save(output, suffix, atoms);
    256 }
    257 
    258 /** Stores all selected atoms in an ostream depending on its suffix
    259  * We store in the order of the atomic ids, not in the order they appear in the molecules.
    260  * Hence, we first create a vector from all selected molecules' atoms.
    261  * \param &output output stream
    262  * \param suffix
    263  * \return true - storing ok, false - suffix unknown
    264  */
    265 bool FormatParserStorage::saveSelectedMolecules(std::ostream &output, std::string suffix)
    266 {
    267   std::vector<molecule *> molecules = World::getInstance().getSelectedMolecules();
    268   std::map<size_t, atom *> IdAtoms;
    269   for (std::vector<molecule *>::const_iterator MolIter = molecules.begin();
    270       MolIter != molecules.end();
    271       ++MolIter) {
    272     for(molecule::atomSet::const_iterator AtomIter = (*MolIter)->begin();
    273         AtomIter != (*MolIter)->end();
    274         ++AtomIter) {
    275       IdAtoms.insert( make_pair((*AtomIter)->getId(), (*AtomIter)) );
    276     }
    277   }
    278   std::vector<atom *> atoms;
    279   atoms.reserve(IdAtoms.size());
    280   for (std::map<size_t, atom *>::const_iterator iter = IdAtoms.begin();
    281       iter != IdAtoms.end();
    282       ++iter) {
    283     atoms.push_back(iter->second);
    284   }
    285   return save(output, suffix, atoms);
    286 }
    287245
    288246/** Stores world in an ostream depending on its suffix
     
    291249 * \return true - storing ok, false - suffix unknown
    292250 */
    293 bool FormatParserStorage::saveWorld(std::ostream &output, std::string suffix)
    294 {
    295   std::vector<atom *> atoms = World::getInstance().getAllAtoms();
    296   return save(output, suffix, atoms);
    297 }
    298 
    299 /** Stores a given vector of \a atoms in an ostream depending on its suffix
    300  * \param &output output stream
    301  * \param suffix
    302  * \return true - storing ok, false - suffix unknown
    303  */
    304 bool FormatParserStorage::save(std::ostream &output, std::string suffix, const std::vector<atom *> &atoms)
     251bool FormatParserStorage::put(std::ostream &output, std::string suffix)
    305252{
    306253  if (suffix == ParserSuffixes[mpqc]) {
    307     getMpqc().save(&output, atoms);
     254    getMpqc().save(&output);
    308255  } else if (suffix == ParserSuffixes[pcp]) {
    309     getPcp().save(&output, atoms);
     256    getPcp().save(&output);
    310257  } else if (suffix == ParserSuffixes[pdb]) {
    311     getPdb().save(&output, atoms);
     258    getPdb().save(&output);
    312259  } else if (suffix == ParserSuffixes[tremolo]) {
    313     getTremolo().save(&output, atoms);
     260    getTremolo().save(&output);
    314261  } else if (suffix == ParserSuffixes[xyz]) {
    315     getXyz().save(&output, atoms);
     262    getXyz().save(&output);
    316263  } else {
    317264    DoeLog(1) && (eLog() << Verbose(1) << "Unknown suffix " << suffix << " to for FormatParserStorage::put()." << endl);
  • src/Parser/FormatParserStorage.hpp

    r5d6f38 rdd97a9  
    2020#include <vector>
    2121
    22 class atom;
    2322class FormatParser;
    2423class MpqcParser;
     
    4645  bool add(ParserTypes type);
    4746
    48   bool load(std::istream &input, std::string suffix);
    49   bool save(std::ostream &output, std::string suffix, const std::vector<atom *> &atoms);
    50   bool saveSelectedAtoms(std::ostream &output, std::string suffix);
    51   bool saveSelectedMolecules(std::ostream &output, std::string suffix);
    52   bool saveWorld(std::ostream &output, std::string suffix);
     47  bool get(std::istream &input, std::string suffix);
     48  bool put(std::ostream &output, std::string suffix);
    5349  MpqcParser &getMpqc();
    5450  PcpParser &getPcp();
  • src/Parser/MpqcParser.cpp

    r5d6f38 rdd97a9  
    5353}
    5454
    55 /**
    56  * Saves the \a atoms into as a MPQC file.
    57  *
    58  * \param file where to save the state
    59  * \param atoms atoms to store
    60  */
    61 void MpqcParser::save(ostream *file, const std::vector<atom *> &atoms)
     55void MpqcParser::save(ostream *file)
    6256{
    6357  DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl);
    6458
    6559  if (HessianPresent)
    66     saveHessian(file, atoms);
     60    saveHessian(file);
    6761  else
    68     saveSimple(file, atoms);
     62    saveSimple(file);
    6963}
    7064
    7165/** Saves all atoms and data into a MPQC config file without hessian.
    7266 * \param *file output stream
    73  * \param atoms atoms to store
    7467 */
    75 void MpqcParser::saveSimple(ostream *file, const std::vector<atom *> &atoms)
     68void MpqcParser::saveSimple(ostream *file)
    7669{
    7770  Vector center;
     
    119112/** Saves all atoms and data into a MPQC config file with hessian.
    120113 * \param *file output stream
    121  * \param atoms atoms to store
    122114 */
    123 void MpqcParser::saveHessian(ostream *file, const std::vector<atom *> &atoms)
     115void MpqcParser::saveHessian(ostream *file)
    124116{
    125117  Vector center;
  • src/Parser/MpqcParser.hpp

    r5d6f38 rdd97a9  
    2222  ~MpqcParser();
    2323  void load(std::istream* file);
    24   void save(std::ostream* file, const std::vector<atom *> &atoms);
     24  void save(std::ostream* file);
    2525
    2626  void setHessian(bool hessian);
     
    3030  bool HessianPresent;
    3131
    32   void saveSimple(std::ostream *file, const std::vector<atom *> &atoms);
    33   void saveHessian(std::ostream *file, const std::vector<atom *> &atoms);
     32  void saveSimple(std::ostream *file);
     33  void saveHessian(std::ostream *file);
    3434};
    3535
  • src/Parser/PcpParser.cpp

    r5d6f38 rdd97a9  
    368368}
    369369
    370 /**
    371  * Saves the \a atoms into as a PCP file.
    372  *
    373  * \param file where to save the state
    374  * \param atoms atoms to store
    375  */
    376 void PcpParser::save(std::ostream* file, const std::vector<atom *> &atoms)
     370/** Saves the World into a PCP config file.
     371 * \param *file output stream to save to
     372 */
     373void PcpParser::save(std::ostream* file)
    377374{
    378375  DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl);
     
    382379  if (!file->fail()) {
    383380    // calculate number of Psis
    384     CalculateOrbitals(atoms);
     381    vector<atom *> allatoms = World::getInstance().getAllAtoms();
     382    CalculateOrbitals(allatoms);
    385383    *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl;
    386384    *file << endl;
     
    470468    *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl;
    471469    map<int, int> ZtoIndexMap;
    472     OutputElements(file, atoms, ZtoIndexMap);
    473     OutputAtoms(file, atoms, ZtoIndexMap);
     470    OutputElements(file, allatoms, ZtoIndexMap);
     471    OutputAtoms(file, allatoms, ZtoIndexMap);
    474472  } else {
    475473    DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl);
     
    481479 * \param &allatoms all atoms to store away
    482480 */
    483 void PcpParser::CalculateOrbitals(const std::vector<atom *> &allatoms)
     481void PcpParser::CalculateOrbitals(vector<atom *> &allatoms)
    484482{
    485483  PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0;
    486   for (vector<atom *>::const_iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
     484  for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
    487485    PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals();
    488486  }
     
    514512 * \param &ZtoIndexMap map of which atoms belong to which ion number
    515513 */
    516 void PcpParser::OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
     514void PcpParser::OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
    517515{
    518516  map<int, int> PresentElements;
    519517  pair <   map<int, int>::iterator, bool > Inserter;
    520518  // insert all found elements into the map
    521   for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
     519  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
    522520    Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1));
    523521    if (!Inserter.second) // increase if present
     
    544542 * \param &ZtoIndexMap map of which atoms belong to which ion number
    545543 */
    546 void PcpParser::OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
     544void PcpParser::OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
    547545{
    548546  *file << "#Ion_TypeNr._Nr.R[0]    R[1]    R[2]    MoveType (0 MoveIon, 1 FixedIon)" << endl;
     
    550548  pair <   map<int, int>::iterator, bool > Inserter;
    551549  int nr = 0;
    552   for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
     550  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
    553551    Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1) );
    554552    if (!Inserter.second)
  • src/Parser/PcpParser.hpp

    r5d6f38 rdd97a9  
    2020  ~PcpParser();
    2121  void load(std::istream* file);
    22   void save(std::ostream* file, const std::vector<atom *> &atoms);
     22  void save(std::ostream* file);
    2323
    2424  bool operator==(const PcpParser& b) const;
     
    2727
    2828  void ParseThermostats(class ConfigFileBuffer * const fb);
    29   void OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
    30   void OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
    31   void CalculateOrbitals(const std::vector<atom *> &allatoms);
     29  void OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
     30  void OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
     31  void CalculateOrbitals(vector<atom *> &allatoms);
    3232
    3333  class StructParallelization {
  • src/Parser/PdbAtomInfoContainer.cpp

    r5d6f38 rdd97a9  
    2424#include "Helpers/toString.hpp"
    2525//#include "Helpers/Verbose.hpp"
    26 #include "LinearAlgebra/Vector.hpp"
    2726#include "PdbAtomInfoContainer.hpp"
    2827
    2928
    3029PdbAtomInfoContainer::PdbAtomInfoContainer() :
    31   token("ATOM"),
    3230  serial(0),
    3331  name("-"),
    34   altLoc('0'),
     32  altloc('0'),
    3533  resName("-"),
    3634  chainID('0'),
     
    3937  occupancy(0.),
    4038  tempFactor(0.),
    41   element(""),
    4239  charge(0)
    4340{}
     
    4946{
    5047  switch (key) {
    51     case PdbKey::token :
    52       ScanKey(token, value);
    53       break;
    5448    case PdbKey::serial :
    5549      ScanKey(serial, value);
     
    5852      ScanKey(name, value);
    5953      break;
    60     case PdbKey::altLoc :
    61       ScanKey(altLoc, value);
     54    case PdbKey::altloc :
     55      ScanKey(altloc, value);
    6256      break;
    6357    case PdbKey::resName :
     
    7367      ScanKey(iCode, value);
    7468      break;
    75     case PdbKey::X :
    76       ScanKey(XYZ[0], value);
    77       break;
    78     case PdbKey::Y :
    79       ScanKey(XYZ[1], value);
    80       break;
    81     case PdbKey::Z :
    82       ScanKey(XYZ[2], value);
    83       break;
    8469    case PdbKey::occupancy :
    8570      ScanKey(occupancy, value);
     
    8772    case PdbKey::tempFactor :
    8873      ScanKey(tempFactor, value);
    89       break;
    90     case PdbKey::element :
    91       ScanKey(element, value);
    9274      break;
    9375    case PdbKey::charge :
     
    10082}
    10183
    102 template <>
    103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const
     84std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const
    10485{
    10586  switch (key) {
    106     case PdbKey::token :
    107       return toString(token);
    10887    case PdbKey::serial :
    10988      return toString(serial);
    11089    case PdbKey::name :
    11190      return toString(name);
    112     case PdbKey::altLoc :
    113       return toString(altLoc);
     91    case PdbKey::altloc :
     92      return toString(altloc);
    11493    case PdbKey::resName :
    11594      return toString(resName);
     
    12099    case PdbKey::iCode :
    121100      return toString(iCode);
    122     case PdbKey::X :
    123       return toString(XYZ[0]);
    124     case PdbKey::Y :
    125       return toString(XYZ[1]);
    126     case PdbKey::Z :
    127       return toString(XYZ[2]);
    128101    case PdbKey::occupancy :
    129102      return toString(occupancy);
    130103    case PdbKey::tempFactor :
    131104      return toString(tempFactor);
    132     case PdbKey::element :
    133       return toString(element);
    134105    case PdbKey::charge :
    135106      return toString(charge);
     
    140111}
    141112
    142 template <>
    143 int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const
    144 {
    145   switch (key) {
    146     case PdbKey::serial :
    147       return serial;
    148     case PdbKey::resSeq :
    149       return resSeq;
    150     case PdbKey::charge :
    151       return charge;
    152     default :
    153       std::cout << "Unknown key or not presentable as int: " << key << std::endl;
    154       return 0;
    155   }
    156 }
    157 
    158 template <>
    159 double PdbAtomInfoContainer::get<double>(const PdbKey::PdbDataKey key) const
    160 {
    161   switch (key) {
    162     case PdbKey::X :
    163       return XYZ[0];
    164     case PdbKey::Y :
    165       return XYZ[1];
    166     case PdbKey::Z :
    167       return XYZ[2];
    168     case PdbKey::occupancy :
    169       return occupancy;
    170     case PdbKey::tempFactor :
    171       return tempFactor;
    172     default :
    173       std::cout << "Unknown key or not presentable as double: " << key << std::endl;
    174       return 0.;
    175   }
    176 }
  • src/Parser/PdbAtomInfoContainer.hpp

    r5d6f38 rdd97a9  
    1111#include "PdbKey.hpp"
    1212
    13 class Vector;
    14 
    1513#include <string>
    16 #include <typeinfo>
    1714
    1815/**
     
    2522
    2623  // getter and setter
    27   template <class T> T get(const PdbKey::PdbDataKey key) const  {
    28     switch (key) {
    29       default :
    30         std::cout << "Unknown key or not representable as " << typeid(T).name() << ": " << key << std::endl;
    31         break;
    32     }
    33     return (T)NULL;
    34   }
     24  std::string get(const PdbKey::PdbDataKey key) const;
    3525  void set(const PdbKey::PdbDataKey key, std::string value);
    3626
     
    5646
    5747private:
    58   std::string token;
    5948  int serial;
    6049  std::string name;
    61   char altLoc;
     50  char altloc;
    6251  std::string resName;
    6352  char chainID;
    6453  int resSeq;
    6554  char iCode;
    66   Vector XYZ;
    6755  float occupancy;
    6856  float tempFactor;
    69   std::string element;
    7057  int charge;
    7158};
    7259
    73 template <>
    74 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const;
    75 template <>
    76 int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const;
    77 template <>
    78 double PdbAtomInfoContainer::get<double>(const PdbKey::PdbDataKey key) const;
    79 
    8060#endif /* PDBATOMINFOCONTAINER_HPP_ */
  • src/Parser/PdbKey.hpp

    r5d6f38 rdd97a9  
    1818  enum PdbDataKey {
    1919    noKey,
    20     token,
    2120    serial,
    2221    name,
    23     altLoc,
     22    altloc,
    2423    resName,
    2524    chainID,
    2625    resSeq,
    2726    iCode,
    28     X,
    29     Y,
    30     Z,
    3127    occupancy,
    3228    tempFactor,
    33     element,
    3429    charge
    3530  };
  • src/Parser/PdbParser.cpp

    r5d6f38 rdd97a9  
    4646PdbParser::PdbParser() {
    4747  knownTokens["ATOM"] = PdbKey::Atom;
    48   knownTokens["HETATM"] = PdbKey::Atom;
    4948  knownTokens["TER"] = PdbKey::Filler;
    5049  knownTokens["END"] = PdbKey::EndOfFile;
     
    5251  knownTokens["REMARK"] = PdbKey::Remark;
    5352  knownTokens[""] = PdbKey::EndOfFile;
    54 
    55   // argh, why can't just PdbKey::X+(size_t)i
    56   PositionEnumMap[0] = PdbKey::X;
    57   PositionEnumMap[1] = PdbKey::Y;
    58   PositionEnumMap[2] = PdbKey::Z;
    5953}
    6054
     
    10599  size_t linecount  = 0;
    106100  enum PdbKey::KnownTokens token;
    107 
    108   // reset atomIdMap for this file (to correctly parse CONECT entries)
    109   atomIdMap.clear();
    110101
    111102  molecule *newmol = World::getInstance().createMolecule();
     
    145136
    146137/**
    147  * Saves the \a atoms into as a PDB file.
     138 * Saves the World's current state into as a PDB file.
    148139 *
    149140 * \param file where to save the state
    150  * \param atoms atoms to store
    151  */
    152 void PdbParser::save(ostream* file, const std::vector<atom *> &AtomList)
    153 {
     141 */
     142void PdbParser::save(ostream* file) {
    154143  DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl);
     144
    155145  {
    156146    // add initial remark
     
    167157  }
    168158
    169   // we distribute serials, hence clear map beforehand
     159  // we distribute new atom numbers, hence clear map beforehand
    170160  atomIdMap.clear();
    171161  {
    172     std::map<size_t,size_t> MolIdMap;
    173     size_t MolNo = 1;  // residue number starts at 1 in pdb
    174     for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
    175       const molecule *mol = (*atomIt)->getMolecule();
    176       if ((mol != NULL) && (MolIdMap.find(mol->getId()) == MolIdMap.end())) {
    177         MolIdMap[mol->getId()] = MolNo++;
    178       }
    179     }
    180     const size_t MaxMol = MolNo;
    181 
    182     // have a count per element and per molecule (0 is for all homeless atoms)
    183     std::vector<int> **elementNo = new std::vector<int>*[MaxMol];
    184     for (size_t i = 0; i < MaxMol; ++i)
    185       elementNo[i] = new std::vector<int>(MAX_ELEMENTS,1);
     162    vector<atom *> AtomList = World::getInstance().getAllAtoms();
     163
     164    std::vector<int> elementNo(MAX_ELEMENTS,1);
    186165    char name[MAXSTRINGSIZE];
    187     std::string ResidueName;
    188166
    189167    // write ATOMs
    190168    int AtomNo = 1; // serial number starts at 1 in pdb
    191     for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
    192       PdbAtomInfoContainer &atomInfo = getadditionalAtomData(*atomIt);
    193       // gather info about residue
     169    int MolNo = 1;  // residue number starts at 1 in pdb
     170    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
     171      const size_t  Z = (*atomIt)->getType()->getAtomicNumber();
     172      sprintf(name, "%2s%02d",(*atomIt)->getType()->getSymbol().c_str(), elementNo[Z]);
     173      elementNo[Z] = (elementNo[Z]+1) % 100;   // confine to two digits
    194174      const molecule *mol = (*atomIt)->getMolecule();
    195       if (mol == NULL) {
    196         MolNo = 0;
    197         atomInfo.set(PdbKey::resSeq, "0");
     175      if (mol == NULL) {  // for homeless atoms, MolNo = -1 is reserved
     176        MolNo = -1;
    198177      } else {
    199         ASSERT(MolIdMap.find(mol->getId()) != MolIdMap.end(),
    200             "PdbParser::save() - Mol id "+toString(mol->getId())+" not present despite we set it?!");
    201         MolNo = MolIdMap[mol->getId()];
    202         atomInfo.set(PdbKey::resSeq, toString(MolIdMap[mol->getId()]));
    203         if (atomInfo.get<std::string>(PdbKey::resName) == "-")
    204           atomInfo.set(PdbKey::resName, mol->getName().substr(0,3));
     178        MolNo = mol->getId();
    205179      }
    206       // get info about atom
    207       const size_t  Z = (*atomIt)->getType()->getAtomicNumber();
    208       if (atomInfo.get<std::string>(PdbKey::name) == "-") {  // if no name set, give it a new name
    209         sprintf(name, "%2s%02d",(*atomIt)->getType()->getSymbol().c_str(), (*elementNo[MolNo])[Z]);
    210         (*elementNo[MolNo])[Z] = ((*elementNo[MolNo])[Z]+1) % 100;   // confine to two digits
    211         atomInfo.set(PdbKey::name, name);
    212       }
    213       // set position
    214       for (size_t i=0; i<NDIM;++i) {
    215         stringstream position;
    216         position << setw(8) << fixed << setprecision(3) << (*atomIt)->getPosition().at(i);
    217         atomInfo.set(PositionEnumMap[i], position.str());
    218       }
    219       // change element and charge if changed
    220       if (atomInfo.get<std::string>(PdbKey::element) != (*atomIt)->getType()->getSymbol())
    221         atomInfo.set(PdbKey::element, (*atomIt)->getType()->getSymbol());
    222       setSerial((*atomIt)->getId(), AtomNo);
    223       atomInfo.set(PdbKey::serial, toString(AtomNo));
    224 
    225       // finally save the line
    226       saveLine(file, atomInfo);
     180      saveLine(file, *atomIt, name, AtomNo, MolNo);
     181      setAtomId((*atomIt)->getId(), AtomNo);
    227182      AtomNo++;
    228183    }
    229     for (size_t i = 0; i < MaxMol; ++i)
    230       delete elementNo[i];
    231     delete elementNo;
    232184
    233185    // write CONECTs
    234     for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
     186    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
    235187      writeNeighbors(file, 4, *atomIt);
    236188    }
     
    241193}
    242194
    243 /** Either returns reference to present entry or creates new with default values.
    244  *
    245  * @param _atom atom whose entry we desire
    246  * @return
    247  */
    248 PdbAtomInfoContainer& PdbParser::getadditionalAtomData(atom *_atom)
    249 {
    250   if (additionalAtomData.find(_atom->getId()) != additionalAtomData.end()) {
    251   } else if (additionalAtomData.find(_atom->father->getId()) != additionalAtomData.end()) {
    252     // use info from direct father
    253     additionalAtomData[_atom->getId()] = additionalAtomData[_atom->father->getId()];
    254   } else if (additionalAtomData.find(_atom->GetTrueFather()->getId()) != additionalAtomData.end()) {
    255     // use info from topmost father
    256     additionalAtomData[_atom->getId()] = additionalAtomData[_atom->GetTrueFather()->getId()];
    257   } else {
    258     // create new entry use default values if nothing else is known
    259     additionalAtomData[_atom->getId()] = defaultAdditionalData;
    260   }
    261   return additionalAtomData[_atom->getId()];
    262 }
    263 
    264195/**
    265196 * Writes one line of PDB-formatted data to the provided stream.
     
    267198 * \param stream where to write the line to
    268199 * \param *currentAtom the atom of which information should be written
     200 * \param *name name of atom, i.e. H01
    269201 * \param AtomNo serial number of atom
    270  * \param *name name of atom, i.e. H01
    271  * \param ResidueName Name of molecule
    272202 * \param ResidueNo number of residue
    273203 */
    274 void PdbParser::saveLine(
    275     ostream* file,
    276     const PdbAtomInfoContainer &atomInfo)
    277 {
    278   *file << setfill(' ') << left << setw(6)
    279       << atomInfo.get<std::string>(PdbKey::token);
    280   *file << setfill(' ') << right << setw(5)
    281       << atomInfo.get<int>(PdbKey::serial); /* atom serial number */
    282   *file << " "; /* char 12 is empty */
    283   *file << setfill(' ') << left << setw(4)
    284       << atomInfo.get<std::string>(PdbKey::name);  /* atom name */
    285   *file << setfill(' ') << left << setw(1)
    286       << atomInfo.get<std::string>(PdbKey::altLoc); /* alternate location/conformation */
    287   *file << setfill(' ') << left << setw(3)
    288       << atomInfo.get<std::string>(PdbKey::resName);  /* residue name */
    289   *file << " "; /* char 21 is empty */
    290   *file << setfill(' ') << left << setw(1)
    291       << atomInfo.get<std::string>(PdbKey::chainID); /* chain identifier */
    292   *file << setfill(' ') << left << setw(4)
    293       << atomInfo.get<int>(PdbKey::resSeq); /* residue sequence number */
    294   *file << setfill(' ') << left << setw(1)
    295       << atomInfo.get<std::string>(PdbKey::iCode); /* iCode */
    296   *file << "   "; /* char 28-30 are empty */
    297   // have the following operate on stringstreams such that format specifiers
    298   // only act on these
    299   for (size_t i=0;i<NDIM;++i) {
    300     stringstream position;
    301     position << fixed << setprecision(3) << showpoint
    302         << atomInfo.get<double>(PositionEnumMap[i]);
    303     *file << setfill(' ') << right << setw(8) << position.str();
    304   }
    305   {
    306     stringstream occupancy;
    307     occupancy << fixed << setprecision(2) << showpoint
    308         << atomInfo.get<double>(PdbKey::occupancy); /* occupancy */
    309     *file << setfill(' ') << right << setw(6) << occupancy.str();
    310   }
    311   {
    312     stringstream tempFactor;
    313     tempFactor << fixed << setprecision(2) << showpoint
    314         << atomInfo.get<double>(PdbKey::tempFactor); /* temperature factor */
    315     *file << setfill(' ') << right << setw(6) << tempFactor.str();
    316   }
    317   *file << "          "; /* char 68-76 are empty */
    318   *file << setfill(' ') << right << setw(2) << atomInfo.get<std::string>(PdbKey::element); /* element */
    319   *file << setfill(' ') << right << setw(2) << atomInfo.get<int>(PdbKey::charge); /* charge */
     204void PdbParser::saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResidueNo) {
     205  *file << "ATOM ";
     206  *file << setw(6) << AtomNo; /* atom serial number */
     207  *file << setw(1) << " ";
     208  *file << setfill(' ') << left << setw(4) << name << right;  /* atom name */
     209  *file << setw(1) << " ";
     210  *file << setfill(' ') << setw(3) << ((currentAtom->getMolecule() != NULL) ? currentAtom->getMolecule()->getName().substr(0,3) : "-");  /* residue name */
     211  *file << setw(1) << " ";
     212  *file << setfill(' ') << setw(1) << (char)('a'+(unsigned char)(AtomNo % 26)); /* letter for chain */
     213  *file << setw(4) << ResidueNo; /* residue sequence number */
     214  *file << setw(4) << "    ";
     215  for (int i=0;i<NDIM;i++) {
     216    *file << setw(8) << setprecision(3) << showpoint << currentAtom->at(i); /* positional coordinate in Angstroem */
     217  }
     218  *file << setw(6) << setprecision(2) << showpoint << (double)currentAtom->getType()->getValence(); /* occupancy */
     219  *file << setw(6) << setprecision(2) << showpoint << (double)currentAtom->getType()->getNoValenceOrbitals(); /* temperature factor */
     220  *file << noshowpoint;
     221  *file << setw(6) << "      ";
     222  *file << setw(4) << "0";
     223  *file << setfill(' ') << setw(2) << currentAtom->getType()->getSymbol();
     224  *file << setw(2) << "0";
    320225
    321226  *file << endl;
     
    335240      if (MaxNo >= MaxnumberOfNeighbors) {
    336241        *file << "CONECT";
    337         *file << setw(5) << getSerial(currentAtom->getId());
     242        *file << setw(5) << getAtomId(currentAtom->getId());
    338243        MaxNo = 0;
    339244      }
    340       *file << setw(5) << getSerial((*currentBond)->GetOtherAtom(currentAtom)->getId());
     245      *file << setw(5) << getAtomId((*currentBond)->GetOtherAtom(currentAtom)->getId());
    341246      MaxNo++;
    342247      if (MaxNo == MaxnumberOfNeighbors)
     
    348253}
    349254
     255
    350256/** Retrieves a value from PdbParser::atomIdMap.
    351257 * \param atomid key
     
    353259 */
    354260size_t PdbParser::getSerial(const size_t atomid) const
     261{
     262  ConvertTo<size_t> toSize_t;
     263  ASSERT(additionalAtomData.find(atomid) != additionalAtomData.end(),
     264      "PdbParser::getSerial: atomid "+toString(atomid)+" not present in Map.");
     265  const PdbAtomInfoContainer &atomInfo = additionalAtomData.at(atomid);
     266
     267  return toSize_t(atomInfo.get(PdbKey::serial));
     268}
     269
     270/** Retrieves a value from PdbParser::atomIdMap.
     271 * \param atomid key
     272 * \return value
     273 */
     274size_t PdbParser::getAtomId(const size_t atomid) const
    355275{
    356276  ASSERT(atomIdMap.find(atomid) != atomIdMap.end(), "PdbParser::getAtomId: atomid not present in Map.");
     
    363283 * \return true - key not present, false - value present
    364284 */
    365 void PdbParser::setSerial(const size_t localatomid, const size_t atomid)
     285void PdbParser::setAtomId(const size_t localatomid, const size_t atomid)
    366286{
    367287  pair<std::map<size_t,size_t>::iterator, bool > inserter;
    368 //  DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting ("
    369 //      << localatomid << " -> " << atomid << ")." << std::endl);
     288  DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting ("
     289      << localatomid << " -> " << atomid << ")." << std::endl);
    370290  inserter = atomIdMap.insert( make_pair(localatomid, atomid) );
    371291  ASSERT(inserter.second, "PdbParser::setAtomId: atomId already present in Map.");
     
    387307  stringstream lineStream;
    388308  atom* newAtom = World::getInstance().createAtom();
    389   PdbAtomInfoContainer &atomInfo = getadditionalAtomData(newAtom);
     309  additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer);
     310  PdbAtomInfoContainer &atomInfo = additionalAtomData[newAtom->getId()];
    390311  string word;
    391312  ConvertTo<size_t> toSize_t;
     
    393314
    394315  lineStream << line;
    395   atomInfo.set(PdbKey::token, line.substr(0,6));
    396316  atomInfo.set(PdbKey::serial, line.substr(6,5));
    397317  std::pair< std::set<size_t>::const_iterator, bool> Inserter =
    398     SerialSet.insert(toSize_t(atomInfo.get<std::string>(PdbKey::serial)));
     318    SerialSet.insert(toSize_t(atomInfo.get(PdbKey::serial)));
    399319  ASSERT(Inserter.second,
    400320      "PdbParser::readAtomDataLine() - ATOM contains entry with serial "
    401       +atomInfo.get<std::string>(PdbKey::serial)+" already present!");
     321      +atomInfo.get(PdbKey::serial)+" already present!");
    402322  // assign hightest+1 instead, but then beware of CONECT entries! Another map needed!
    403323//  if (!Inserter.second) {
     
    406326//    atomInfo.set(PdbKey::serial, toString(id));
    407327//    DoeLog(2) && (eLog() << Verbose(2)
    408 //        << "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, "
     328//        << "Serial " << atomInfo.get(PdbKey::serial) << " already present, "
    409329//        << "assigning " << toString(id) << " instead." << std::endl);
    410330//  }
     
    428348//      << line.substr(78,2) << std::endl);
    429349
    430   setSerial(toSize_t(atomInfo.get<std::string>(PdbKey::serial)), newAtom->getId());
     350  setAtomId(toSize_t(atomInfo.get(PdbKey::serial)), newAtom->getId());
    431351  atomInfo.set(PdbKey::name, line.substr(12,4));
    432   atomInfo.set(PdbKey::altLoc, line.substr(16,1));
     352  atomInfo.set(PdbKey::altloc, line.substr(16,1));
    433353  atomInfo.set(PdbKey::resName, line.substr(17,3));
    434354  atomInfo.set(PdbKey::chainID, line.substr(21,1));
     
    444364  atomInfo.set(PdbKey::tempFactor, line.substr(60,6));
    445365  atomInfo.set(PdbKey::charge, line.substr(78,2));
    446   atomInfo.set(PdbKey::element, line.substr(76,2));
    447   const element *elem = World::getInstance().getPeriode()
    448       ->FindElement(atomInfo.get<std::string>(PdbKey::element));
    449   ASSERT(elem != NULL,
    450       "PdbParser::readAtomDataLine() - element "+atomInfo.get<std::string>(PdbKey::element)+" is unknown!");
    451   newAtom->setType(elem);
     366  PdbAtomInfoContainer::ScanKey(word, line.substr(76,2));
     367  newAtom->setType(World::getInstance().getPeriode()->FindElement(word));
    452368
    453369  if (newmol != NULL)
     
    465381
    466382  DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << std::endl);
    467   DoLog(1) && (Log() << Verbose(1) << "\ttoken is " << atomInfo.get<std::string>(PdbKey::token) << std::endl);
    468   DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get<int>(PdbKey::serial) << std::endl);
    469   DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get<std::string>(PdbKey::name) << std::endl);
    470   DoLog(1) && (Log() << Verbose(1) << "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc) << std::endl);
    471   DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get<std::string>(PdbKey::resName) << std::endl);
    472   DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID) << std::endl);
    473   DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq) << std::endl);
    474   DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode) << std::endl);
    475   DoLog(1) && (Log() << Verbose(1) << "\tX is " << atomInfo.get<double>(PdbKey::X) << std::endl);
    476   DoLog(1) && (Log() << Verbose(1) << "\tY is " << atomInfo.get<double>(PdbKey::Y) << std::endl);
    477   DoLog(1) && (Log() << Verbose(1) << "\tZ is " << atomInfo.get<double>(PdbKey::Z) << std::endl);
    478   DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy) << std::endl);
    479   DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor) << std::endl);
     383  DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get(PdbKey::serial) << std::endl);
     384  DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get(PdbKey::name) << std::endl);
     385  DoLog(1) && (Log() << Verbose(1) << "\taltloc is " << atomInfo.get(PdbKey::altloc) << std::endl);
     386  DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get(PdbKey::resName) << std::endl);
     387  DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get(PdbKey::chainID) << std::endl);
     388  DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get(PdbKey::resSeq) << std::endl);
     389  DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get(PdbKey::iCode) << std::endl);
     390  DoLog(1) && (Log() << Verbose(1) << "\tx is " << newAtom->getPosition() << std::endl);
     391  DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get(PdbKey::occupancy) << std::endl);
     392  DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get(PdbKey::tempFactor) << std::endl);
    480393  DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl);
    481   DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get<int>(PdbKey::charge) << std::endl);
     394  DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get(PdbKey::charge) << std::endl);
    482395}
    483396
     
    513426
    514427  // add neighbours
    515   atom *_atom = World::getInstance().getAtom(AtomById(getSerial(id)));
     428  atom *_atom = World::getInstance().getAtom(AtomById(getAtomId(id)));
    516429  for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin();
    517430      iter != ListOfNeighbors.end();
    518431      ++iter) {
    519432//    DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl);
    520     atom * const _Otheratom = World::getInstance().getAtom(AtomById(getSerial(*iter)));
     433    atom * const _Otheratom = World::getInstance().getAtom(AtomById(getAtomId(*iter)));
    521434    _atom->addBond(_Otheratom);
    522435  }
     
    565478      const PdbAtomInfoContainer &OtheratomInfo = b.additionalAtomData.at((*iter)->getId());
    566479
    567       status = status && (atomInfo.get<std::string>(PdbKey::serial) == OtheratomInfo.get<std::string>(PdbKey::serial));
     480      status = status && (atomInfo.get(PdbKey::serial) == OtheratomInfo.get(PdbKey::serial));
    568481      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl);
    569       status = status && (atomInfo.get<std::string>(PdbKey::name) == OtheratomInfo.get<std::string>(PdbKey::name));
     482      status = status && (atomInfo.get(PdbKey::name) == OtheratomInfo.get(PdbKey::name));
    570483      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl);
    571       status = status && (atomInfo.get<std::string>(PdbKey::altLoc) == OtheratomInfo.get<std::string>(PdbKey::altLoc));
    572       if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altLocs!" << std::endl);
    573       status = status && (atomInfo.get<std::string>(PdbKey::resName) == OtheratomInfo.get<std::string>(PdbKey::resName));
     484      status = status && (atomInfo.get(PdbKey::altloc) == OtheratomInfo.get(PdbKey::altloc));
     485      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altlocs!" << std::endl);
     486      status = status && (atomInfo.get(PdbKey::resName) == OtheratomInfo.get(PdbKey::resName));
    574487      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl);
    575       status = status && (atomInfo.get<std::string>(PdbKey::chainID) == OtheratomInfo.get<std::string>(PdbKey::chainID));
     488      status = status && (atomInfo.get(PdbKey::chainID) == OtheratomInfo.get(PdbKey::chainID));
    576489      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl);
    577       status = status && (atomInfo.get<std::string>(PdbKey::resSeq) == OtheratomInfo.get<std::string>(PdbKey::resSeq));
     490      status = status && (atomInfo.get(PdbKey::resSeq) == OtheratomInfo.get(PdbKey::resSeq));
    578491      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl);
    579       status = status && (atomInfo.get<std::string>(PdbKey::iCode) == OtheratomInfo.get<std::string>(PdbKey::iCode));
     492      status = status && (atomInfo.get(PdbKey::iCode) == OtheratomInfo.get(PdbKey::iCode));
    580493      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl);
    581       status = status && (atomInfo.get<std::string>(PdbKey::occupancy) == OtheratomInfo.get<std::string>(PdbKey::occupancy));
     494      status = status && (atomInfo.get(PdbKey::occupancy) == OtheratomInfo.get(PdbKey::occupancy));
    582495      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl);
    583       status = status && (atomInfo.get<std::string>(PdbKey::tempFactor) == OtheratomInfo.get<std::string>(PdbKey::tempFactor));
     496      status = status && (atomInfo.get(PdbKey::tempFactor) == OtheratomInfo.get(PdbKey::tempFactor));
    584497      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl);
    585       status = status && (atomInfo.get<std::string>(PdbKey::charge) == OtheratomInfo.get<std::string>(PdbKey::charge));
     498      status = status && (atomInfo.get(PdbKey::charge) == OtheratomInfo.get(PdbKey::charge));
    586499      if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl);
    587500    }
  • src/Parser/PdbParser.hpp

    r5d6f38 rdd97a9  
    2323  ~PdbParser();
    2424  void load(std::istream* file);
    25   void save(std::ostream* file, const std::vector<atom *> &atoms);
     25  void save(std::ostream* file);
    2626
    2727  bool operator==(const PdbParser& b) const;
     
    3838  bool isUsedField(std::string fieldName);
    3939  void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom);
    40   void saveLine(ostream* file, const PdbAtomInfoContainer &atomInfo);
     40  void saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResdueNo);
    4141
    4242  // internal getter and setter
    43   PdbAtomInfoContainer& getadditionalAtomData(atom *_atom);
    4443  size_t getSerial(const size_t atomid) const;
    45   void setSerial(const size_t localatomid, const size_t atomid);
    46 
    47   /**
    48    * argh, why can't just PdbKey::X+(size_t)i
    49    */
    50   std::map<size_t, PdbKey::PdbDataKey> PositionEnumMap;
     44  size_t getAtomId(const size_t atomid) const;
     45  void setAtomId(const size_t localatomid, const size_t atomid);
    5146
    5247  /**
  • src/Parser/TremoloAtomInfoContainer.cpp

    r5d6f38 rdd97a9  
    4242  GrpTypeNo("0"),
    4343  torsion("-"),
    44   neighbors(std::vector<int>(0, 5)),
    45   neighbors_processed(false)
     44  neighbors(std::vector<int>(0, 5))
    4645{}
    4746
  • src/Parser/TremoloAtomInfoContainer.hpp

    r5d6f38 rdd97a9  
    3939  std::string torsion;
    4040  std::vector<int> neighbors;
    41   bool neighbors_processed;
    4241};
    4342
  • src/Parser/TremoloParser.cpp

    r5d6f38 rdd97a9  
    9090  string::size_type location;
    9191
    92   // reset atomIdMap, for we now get new serials
    93   atomIdMap.clear();
    9492  usedFields.clear();
    95 
    9693  molecule *newmol = World::getInstance().createMolecule();
    9794  newmol->ActiveFlag = true;
     
    117114
    118115/**
    119  * Saves the \a atoms into as a tremolo file.
     116 * Saves the World's current state into as a tremolo file.
    120117 *
    121118 * \param file where to save the state
    122  * \param atoms atoms to store
    123  */
    124 void TremoloParser::save(ostream* file, const std::vector<atom *> &AtomList) {
     119 */
     120void TremoloParser::save(ostream* file) {
    125121  DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);
    126122
    127   vector<atom*>::const_iterator atomIt;
     123  vector<atom*>::iterator atomIt;
    128124  vector<string>::iterator it;
    129125
     
    133129  }
    134130  *file << endl;
     131  vector<atom *> AtomList = World::getInstance().getAllAtoms();
    135132  for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
    136133    saveLine(file, *atomIt);
     
    223220        ? (*currentBond)->GetOtherAtom(currentAtom)->getId()+1 : 0) << "\t";
    224221    if (currentBond != currentAtom->ListOfBonds.end())
    225       ++currentBond;
     222      currentBond++;
    226223  }
    227224}
     
    262259  atom* newAtom = World::getInstance().createAtom();
    263260  TremoloAtomInfoContainer *atomInfo = NULL;
    264   additionalAtomData[newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values
     261  additionalAtomData[newAtom->getId()] = *(new TremoloAtomInfoContainer);
    265262  atomInfo = &additionalAtomData[newAtom->getId()];
    266263  TremoloKey::atomDataKey currentField;
     
    313310 * Reads neighbor information for one atom from the input.
    314311 *
    315  * \param line stream where to read the information from
    316  * \param numberOfNeighbors number of neighbors to read
    317  * \param atomid world id of the atom the information belongs to
     312 * \param stream where to read the information from
     313 * \param number of neighbors to read
     314 * \param world id of the atom the information belongs to
    318315 */
    319316void TremoloParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) {
     
    323320    // 0 is used to fill empty neighbor positions in the tremolo file.
    324321    if (neighborId > 0) {
    325 //      std::cout << "Atom with global id " << atomId << " has neighbour with serial " << neighborId << std::endl;
    326322      additionalAtomData[atomId].neighbors.push_back(neighborId);
    327323    }
     
    360356    currentInfo != additionalAtomData.end(); currentInfo++
    361357  ) {
    362     if (!currentInfo->second.neighbors_processed) {
    363       for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin();
    364         neighbor != currentInfo->second.neighbors.end(); neighbor++
    365       ) {
    366 //        std::cout << "Creating bond between ("
    367 //            << currentInfo->first
    368 //            << ") and ("
    369 //            << atomIdMap[*neighbor] << "|" << *neighbor << ")" << std::endl;
    370         World::getInstance().getAtom(AtomById(currentInfo->first))
    371             ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
    372       }
    373       currentInfo->second.neighbors_processed = true;
     358    for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin();
     359      neighbor != currentInfo->second.neighbors.end(); neighbor++
     360    ) {
     361      World::getInstance().getAtom(AtomById(currentInfo->first))
     362          ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
    374363    }
    375364  }
  • src/Parser/TremoloParser.hpp

    r5d6f38 rdd97a9  
    2626  ~TremoloParser();
    2727  void load(std::istream* file);
    28   void save(std::ostream* file, const std::vector<atom *> &atoms);
     28  void save(std::ostream* file);
    2929  void setFieldsForSave(std::string atomDataLine);
    3030
  • src/Parser/XyzParser.cpp

    r5d6f38 rdd97a9  
    7878
    7979/**
    80  * Saves the \a atoms into as a XYZ file.
     80 * Saves the current state of the World into the given XYZ file.
    8181 *
    82  * \param file where to save the state
    83  * \param atoms atoms to store
     82 * \param XYZ file
    8483 */
    85 void XyzParser::save(ostream* file, const std::vector<atom *> &atoms) {
     84void XyzParser::save(ostream* file) {
    8685  DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl);
    8786  //if (comment == "") {
     
    9695      comment += time;
    9796  //}
    98   *file << atoms.size() << endl << "\t" << comment << endl;
     97  *file << World::getInstance().numAtoms() << endl << "\t" << comment << endl;
    9998
    100   for(vector<atom*>::const_iterator it = atoms.begin(); it != atoms.end(); it++) {
     99  vector<atom*> atoms = World::getInstance().getAllAtoms();
     100  for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
    101101    *file << noshowpoint << (*it)->getType()->getSymbol() << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
    102102  }
  • src/Parser/XyzParser.hpp

    r5d6f38 rdd97a9  
    2020  ~XyzParser();
    2121  void load(std::istream* file);
    22   void save(std::ostream* file, const std::vector<atom *> &atoms);
     22  void save(std::ostream* file);
    2323
    2424private:
  • src/Patterns/Singleton_impl.hpp

    r5d6f38 rdd97a9  
    99#define SINGLETON_IMPL_HPP_
    1010
    11 #include "Helpers/Assert.hpp"
    1211#include "Patterns/Singleton.hpp"
    1312
  • src/ThermoStatContainer.cpp

    r5d6f38 rdd97a9  
    5454  ThermostatTraits<Thermostat> *WoodcockTrait = new ThermostatTraits<Woodcock>();
    5555  availThermostats[WoodcockTrait->getName()] = WoodcockTrait;
    56 
    57   // for debugging: list all thermostats
    58 //  cout << "List of known thermostats: ";
    59 //  for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){
    60 //    cout << iter->first << " ";
    61 //  }
    62 //  cout << endl;
    63 
     56  for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){
     57    cout << iter->first << endl;
     58  }
    6459  ASSERT(availThermostats.size()==6,"Not all implemented thermostats referenced!\nDid you check the names in the traits?");
    6560  activeThermostat=new Berendsen();
  • src/UIElements/CommandLineUI/CommandLineParser.cpp

    r5d6f38 rdd97a9  
    9797      const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first);
    9898      // add the option
    99 //      std::cout << "Registering Option "
    100 //          << currentOption->getName()
    101 //          << " with type '" << currentOption->getTypeName() << "' "
    102 //          << " with description '" << currentOption->getDescription() << "' ";
    103 //      if (currentOption->hasShortForm())
    104 //        std::cout << ", with short form " << currentOption->getShortForm();
    105 //      else
    106 //        std::cout << ", with no short form ";
    107 //      if (currentOption->hasDefaultValue())
    108 //        std::cout << ", with default value " << currentOption->getDefaultValue();
    109 //      else
    110 //        std::cout << ", with no default value ";
    111 //      std::cout << std::endl;
     99      std::cout << "Registering Option "
     100          << currentOption->getName()
     101          << " with type '" << currentOption->getTypeName() << "' "
     102          << " with description '" << currentOption->getDescription() << "' ";
     103      if (currentOption->hasShortForm())
     104        std::cout << ", with short form " << currentOption->getShortForm();
     105      else
     106        std::cout << ", with no short form ";
     107      if (currentOption->hasDefaultValue())
     108        std::cout << ", with default value " << currentOption->getDefaultValue();
     109      else
     110        std::cout << ", with no default value ";
     111      std::cout << std::endl;
    112112
    113113      AddOptionToParser(currentOption, (CmdParserLookup["options"]));
     
    116116    if (!ActionAlreadyAdded_flag) {
    117117      // add the action
    118 //      std::cout << "Registering Action "
    119 //          << currentAction->Traits.getName()
    120 //          << " in menu " << currentAction->Traits.getMenuName()
    121 //          << " with type '" << currentAction->Traits.getTypeName() << "' "
    122 //          << " with description '" << currentAction->Traits.getDescription() << "' ";
    123 //      if (currentAction->Traits.hasShortForm())
    124 //        std::cout << ", with short form " << currentAction->Traits.getShortForm();
    125 //      else
    126 //        std::cout << ", with no short form ";
    127 //      if (currentAction->Traits.hasDefaultValue())
    128 //        std::cout << ", with default value " << currentAction->Traits.getDefaultValue();
    129 //      else
    130 //        std::cout << ", with no default value ";
    131 //      std::cout  << std::endl;
     118      std::cout << "Registering Action "
     119          << currentAction->Traits.getName()
     120          << " in menu " << currentAction->Traits.getMenuName()
     121          << " with type '" << currentAction->Traits.getTypeName() << "' "
     122          << " with description '" << currentAction->Traits.getDescription() << "' ";
     123      if (currentAction->Traits.hasShortForm())
     124        std::cout << ", with short form " << currentAction->Traits.getShortForm();
     125      else
     126        std::cout << ", with no short form ";
     127      if (currentAction->Traits.hasDefaultValue())
     128        std::cout << ", with default value " << currentAction->Traits.getDefaultValue();
     129      else
     130        std::cout << ", with no default value ";
     131      std::cout  << std::endl;
    132132
    133133      ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(),
     
    156156  ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!");
    157157  // add other options
    158   //std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;
     158  std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;
    159159  switch(TypeToEnums.getEnumforType(currentOption->getType())) {
    160160    default:
     
    369369{
    370370  std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
    371   DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl);
    372371  // go through all arguments
    373372  for (int i=1;i<argc;i++) {
    374     DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl);
     373    (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);
    375374    // check whether they
    376375    if (argv[i][0] == '-') { // .. begin with -
    377       DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl);
     376      (cout << Verbose(1) << "Possible argument: " << argv[i] << endl);
    378377      if (argv[i][1] == '-') { // .. or --
    379         DoLog(1) && (Log() << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
     378        (cout << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
    380379        SequenceOfActions.push_back(&(argv[i][2]));
    381380        //  .. and check that next letter is not numeric, if so insert
     
    383382        std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
    384383        if (iter != ShortFormToActionMap.end()) {
    385           DoLog(1) && (Log() << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
     384          (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
    386385          SequenceOfActions.push_back(iter->second);
    387386        }
     
    405404 * \return map from Action's ShortForm to token.
    406405 */
    407 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() const
     406std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap()
    408407{
    409408  std::map <std::string, std::string> result;
  • src/UIElements/CommandLineUI/CommandLineParser.hpp

    r5d6f38 rdd97a9  
    143143
    144144  // creates a map from short forms to action tokens needed to parse command line
    145   std::map <std::string, std::string> getShortFormToActionMap() const;
     145  std::map <std::string, std::string> getShortFormToActionMap();
    146146
    147147  // lookup list from "configmenus" to the ones of CommandLineParser
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    r5d6f38 rdd97a9  
    2525#include "CommandLineUI/CommandLineStatusIndicator.hpp"
    2626
    27 #include "Helpers/Log.hpp"
    28 #include "Helpers/Verbose.hpp"
    29 
    3027#include "Actions/Action.hpp"
    3128#include "Actions/ActionRegistry.hpp"
     
    5350
    5451  // go through all possible actions
    55   DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl);
    5652  for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) {
     53    cout << "Checking presence of " << *CommandRunner << ": ";
    5754    if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) {
    58       DoLog(1) && (Log() << Verbose(1)
    59           << "Checking presence of " << *CommandRunner << ": "
    60           << "calling " << *CommandRunner << endl);
     55      cout << "calling " << *CommandRunner << endl;
    6156      ActionRegistry::getInstance().getActionByName(*CommandRunner)->call();
    6257    } else {
    63       DoLog(1) && (Log() << Verbose(1)
    64           << "Checking presence of " << *CommandRunner << ": "
    65           << "absent." << endl);
     58      cout << "absent." << endl;
    6659    }
    6760  }
  • src/UIElements/CommandLineUI/TypeEnumContainer.cpp

    r5d6f38 rdd97a9  
    6464  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType;
    6565
    66   // for debugging: list all stored types
    67   //ListAllKnownTypes();
     66  ListAllKnownTypes();
    6867};
    6968
     
    8483    std::cout << " Known type is " << (iter->first)->name() << " or enum " << iter->second << std::endl;
    8584  }
     85  std::cout << "BoxVector type is " << typeid(BoxVector).name() << std::endl;
     86  std::cout << "Vector type is " << typeid(Vector).name() << std::endl;
     87  std::cout << "VectorValue type is " << typeid(VectorValue).name() << std::endl;
    8688}
    8789
     
    9294enum TypeEnumContainer::EnumOfTypes TypeEnumContainer::getEnumforType(const std::type_info *_type)
    9395{
    94   //std::cout << "Looking for type " << _type->name() << std::endl;
     96  std::cout << "Looking for type " << _type->name() << std::endl;
    9597  ASSERT(TypeEnumMap.find(_type) != TypeEnumMap.end(),
    9698      "CommandLineParser::getEnumforType() - cannot find the type as enum!.");
  • src/UIElements/Menu/Menu.cpp

    r5d6f38 rdd97a9  
    7676        const std::string &TopName = iter->second.first;
    7777        const int &MenuPosition = iter->second.second;
    78 //        std::cout << "MenuName is " << MenuName
    79 //            << ", TopName is " << TopName
    80 //            << " and Position is " << MenuPosition
    81 //            << std::endl;
     78        std::cout << "MenuName is " << MenuName
     79            << ", TopName is " << TopName
     80            << " and Position is " << MenuPosition
     81            << std::endl;
    8282
    8383        // does it belong to us?
     
    125125void Menu::addSeparator()
    126126{
    127 //  std::cout << "Creating separator at position " << TopPosition << std::endl;
     127  std::cout << "Creating separator at position " << TopPosition << std::endl;
    128128  ASSERT( LastItem != SeparatorItem,
    129129      "Menu::populate() - adding another separator after a separator!");
     
    135135void Menu::addSubmenu(const std::string &MenuName, const int MenuPosition)
    136136{
    137 //  std::cout << "Creating top-level menu " << MenuName
    138 //      << " at position " << TopPosition << std::endl;
     137  std::cout << "Creating top-level menu " << MenuName
     138      << " at position " << TopPosition << std::endl;
    139139  ASSERT (!isPresent(MenuName),
    140140      "Menu::addSubmenu() - trying to add menu "+MenuName+" with already present token!");
  • src/UIElements/Menu/MenuDescription.cpp

    r5d6f38 rdd97a9  
    8989MenuDescription::~MenuDescription()
    9090{
    91   //std::cout << "MenuDescription: clearing maps ... " << std::endl;
     91  std::cout << "MenuDescription: clearing maps ... " << std::endl;
    9292  for (IterableMap::iterator iter = MenuPositionMap->begin(); !MenuPositionMap->empty(); iter = MenuPositionMap->begin())
    9393    MenuPositionMap->erase(iter);
  • src/UIElements/Menu/Qt4/QtMenu.hpp

    r5d6f38 rdd97a9  
    7272        CharRunner != ActionName.end();
    7373        ++CharRunner) {
    74 //      std::cout << "Current char is " << *CharRunner << std::endl;
     74      std::cout << "Current char is " << *CharRunner << std::endl;
    7575      if (!Inserted) {
    7676        Inserter = ShortcutMap.insert(
     
    7878            );
    7979        if (Inserter.second) {
    80 //          std::cout << "Accelerator is " << *CharRunner << std::endl;
     80          std::cout << "Accelerator is " << *CharRunner << std::endl;
    8181          newname += '&';
    8282          Inserted = true;
  • src/builder.cpp

    r5d6f38 rdd97a9  
    7373#endif
    7474
    75 #include "builder_init.hpp"
     75#include "Helpers/MemDebug.hpp"
     76
     77#include "bondgraph.hpp"
     78#include "config.hpp"
     79#include "Helpers/Log.hpp"
     80#include "molecule.hpp"
     81#include "periodentafel.hpp"
     82#include "tesselationhelpers.hpp"
     83#include "UIElements/UIFactory.hpp"
     84#include "UIElements/Menu/MenuDescription.hpp"
     85#include "UIElements/TextUI/TextUIFactory.hpp"
     86#include "UIElements/CommandLineUI/CommandLineUIFactory.hpp"
     87#include "UIElements/CommandLineUI/CommandLineParser.hpp"
     88#ifdef USE_GUI_QT
     89#include "UIElements/Qt4/QtUIFactory.hpp"
     90#endif
     91#include "UIElements/MainWindow.hpp"
     92#include "UIElements/Dialog.hpp"
     93//#include "Menu/ActionMenuItem.hpp"
     94#include "Helpers/Verbose.hpp"
     95#include "World.hpp"
     96
     97#include "Actions/ActionRegistry.hpp"
     98#include "Actions/ActionHistory.hpp"
     99
     100#include "Parser/ChangeTracker.hpp"
     101#include "Parser/FormatParserStorage.hpp"
     102
     103#include "UIElements/UIFactory.hpp"
     104#include "UIElements/TextUI/TextUIFactory.hpp"
     105#include "UIElements/CommandLineUI/CommandLineUIFactory.hpp"
     106#include "UIElements/MainWindow.hpp"
     107#include "UIElements/Dialog.hpp"
     108
     109#include "version.h"
     110
    76111
    77112/********************************************** Main routine **************************************/
     113
     114/** In this function all dynamicly allocated member variables to static/global
     115 * variables are added to the ignore list of Memory/MemDebug.
     116 *
     117 * Use this to prevent their listing in the Memory::getState() at the end of the
     118 * program. Check with valgrind that truely no memory leak occurs!
     119 */
     120void AddStaticEntitiestoIgnoreList()
     121{
     122  // zeroVec and unitVec are global variables (on the stack) but vectorContent
     123  // within is situated on the heap and has to be ignored
     124  Memory::ignore(zeroVec.get());
     125  Memory::ignore(unitVec[0].get());
     126  Memory::ignore(unitVec[1].get());
     127  Memory::ignore(unitVec[2].get());
     128}
     129
     130/** Cleans all singleton instances in an orderly fashion.
     131 * C++ does not guarantee any specific sequence of removal of single instances
     132 * which have static/global variables. Some singletons depend on others hence we
     133 * acertain a specific ordering here, which is is used via the atexit() hook.
     134 */
     135void cleanUp(){
     136  FormatParserStorage::purgeInstance();
     137  ChangeTracker::purgeInstance();
     138  World::purgeInstance();
     139  MenuDescription::purgeInstance();
     140  UIFactory::purgeInstance();
     141  ValueStorage::purgeInstance();
     142  CommandLineParser::purgeInstance();
     143  ActionRegistry::purgeInstance();
     144  OptionRegistry::purgeInstance();
     145  ActionHistory::purgeInstance();
     146  // we have to remove these two static as otherwise their boost::shared_ptrs are still present
     147  Action::removeStaticStateEntities();
     148  // put some static variables' dynamic contents on the Memory::ignore map to avoid their
     149  // admonishing lateron
     150  AddStaticEntitiestoIgnoreList();
     151  logger::purgeInstance();
     152  errorLogger::purgeInstance();
     153#ifdef LOG_OBSERVER
     154  cout << observerLog().getLog();
     155#endif
     156  Memory::getState();
     157}
     158
     159void dumpMemory(){
     160  ofstream ost("molecuilder.memdump");
     161  Memory::dumpMemory(ost);
     162}
    78163
    79164int main(int argc, char **argv)
    80165{
    81   initGeneral();
    82 
    83   initUI(argc,argv);
    84 
    85   doUI();
    86 
    87   return saveAll();
     166  // while we are non interactive, we want to abort from asserts
     167  ASSERT_DO(Assert::Abort);
     168  ASSERT_HOOK(dumpMemory);
     169  string line;
     170  char **Arguments = NULL;
     171  int ArgcSize = 0;
     172  int ExitFlag = 0;
     173  bool ArgumentsCopied = false;
     174  std::string BondGraphFileName("\n");
     175
     176  // print version check and copyright notice
     177  cout << MOLECUILDERVERSION << endl;
     178  cout << "MoleCuilder comes with ABSOLUTELY NO WARRANTY; for details type" << endl;
     179  cout << "`molecuilder --warranty'." << endl;
     180  cout << "`MoleCuilder - to create and alter molecular systems." << endl;
     181  cout << "Copyright (C) 2010  University Bonn. All rights reserved." << endl;
     182
     183  setVerbosity(0);
     184  // need to init the history before any action is created
     185  ActionHistory::init();
     186
     187  // from this moment on, we need to be sure to deeinitialize in the correct order
     188  // this is handled by the cleanup function
     189  atexit(cleanUp);
     190
     191  // Parse command line options and if present create respective UI
     192  {
     193    // construct bond graph
     194    if (World::getInstance().getConfig()->BG == NULL) {
     195      World::getInstance().getConfig()->BG = new BondGraph(World::getInstance().getConfig()->GetIsAngstroem());
     196      if (World::getInstance().getConfig()->BG->LoadBondLengthTable(BondGraphFileName)) {
     197        DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);
     198      } else {
     199        DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
     200      }
     201    }
     202    // handle remaining arguments by CommandLineParser
     203    if (argc>1) {
     204      CommandLineParser::getInstance().InitializeCommandArguments();
     205      CommandLineParser::getInstance().Run(argc,argv);
     206      DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl);
     207      UIFactory::registerFactory(new CommandLineUIFactory::description());
     208      UIFactory::makeUserInterface("CommandLine");
     209    } else {
     210      // In the interactive mode, we can leave the user the choice in case of error
     211      ASSERT_DO(Assert::Ask);
     212      #ifdef USE_GUI_QT
     213        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Qt4." << endl);
     214        UIFactory::registerFactory(new QtUIFactory::description());
     215        UIFactory::makeUserInterface("Qt4");
     216      #else
     217        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
     218        cout << MOLECUILDERVERSION << endl;
     219        UIFactory::registerFactory(new TextUIFactory::description());
     220        UIFactory::makeUserInterface("Text");
     221      #endif
     222    }
     223  }
     224
     225  {
     226    MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow();
     227    mainWindow->display();
     228    delete mainWindow;
     229  }
     230
     231  FormatParserStorage::getInstance().SaveAll();
     232  ChangeTracker::getInstance().saveStatus();
     233
     234  // free the new argv
     235  if (ArgumentsCopied) {
     236    for (int i=0; i<ArgcSize;i++)
     237      delete[](Arguments[i]);
     238    delete[](Arguments);
     239  }
     240  //delete[](ConfigFileName);
     241
     242  ExitFlag = World::getInstance().getExitFlag();
     243  return (ExitFlag == 1 ? 0 : ExitFlag);
    88244}
    89245
  • src/molecule_dynamics.cpp

    r5d6f38 rdd97a9  
    484484           atoms.end(),
    485485           boost::bind(&atom::EvaluateConstrainedForce,_1,startstep,endstep,PermutationMap,Force));
     486  //ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force );
    486487  DoLog(1) && (Log() << Verbose(1) << "done." << endl);
    487488};
     
    616617    // and perform Verlet integration for each atom with position, velocity and force vector
    617618    // check size of vectors
     619    //ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 );
    618620    for_each(atoms.begin(),
    619621             atoms.end(),
  • src/periodentafel.cpp

    r5d6f38 rdd97a9  
    307307    //cout << "First header: " << header1tmp << endl;
    308308    //cout << "Second header: " << header2tmp << endl;
    309 //    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
     309    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    310310    while (!input.eof()) {
    311311      element *neues = new element;
     
    332332      if ((neues->getNumber() > 0) && (neues->getNumber() < MAX_ELEMENTS)) {
    333333        parsedElements[neues->Z] = neues;
    334 //        DoLog(0) && (Log() << Verbose(0) << " " << *neues);
     334        DoLog(0) && (Log() << Verbose(0) << " " << *neues);
    335335      } else {
    336336        DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl);
     
    345345      }
    346346    }
    347 //    DoLog(0) && (Log() << Verbose(0) << endl);
     347    DoLog(0) && (Log() << Verbose(0) << endl);
    348348  } else {
    349349    DoeLog(1) && (eLog() << Verbose(1) << "Could not open the database." << endl);
  • src/periodentafel.hpp

    r5d6f38 rdd97a9  
    1313#include <string>
    1414
    15 #include "unittests/PeriodentafelUnitTest.hpp"
     15#include "unittests/periodentafelTest.hpp"
    1616#include "Helpers/defs.hpp"
    1717#include "types.hpp"
  • src/tesselationhelpers.cpp

    r5d6f38 rdd97a9  
    2929#include "Helpers/Info.hpp"
    3030#include "linkedcell.hpp"
    31 #include "LinearAlgebra/LinearSystemOfEquations.hpp"
     31#include "LinearAlgebra/linearsystemofequations.hpp"
    3232#include "Helpers/Log.hpp"
    3333#include "tesselation.hpp"
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r5d6f38 rdd97a9  
    2727
    2828#include "analysis_correlation.hpp"
     29#include "AnalysisCorrelationToPointUnitTest.hpp"
    2930
    3031#include "Descriptors/MoleculeDescriptor.hpp"
     
    3637#include "periodentafel.hpp"
    3738#include "World.hpp"
    38 
    39 #include "AnalysisCorrelationToPointUnitTest.hpp"
    4039
    4140#ifdef HAVE_TESTRUNNER
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r5d6f38 rdd97a9  
    2727
    2828#include "analysis_correlation.hpp"
     29#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
     30
    2931#include "Descriptors/MoleculeDescriptor.hpp"
    3032
     
    3941#include "Helpers/Assert.hpp"
    4042
    41 #include "AnalysisCorrelationToSurfaceUnitTest.hpp"
     43#include "Helpers/Assert.hpp"
    4244
    4345#ifdef HAVE_TESTRUNNER
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r5d6f38 rdd97a9  
    2727
    2828#include "analysis_correlation.hpp"
     29#include "AnalysisPairCorrelationUnitTest.hpp"
     30
    2931#include "Descriptors/MoleculeDescriptor.hpp"
    3032
     
    3840#include "tesselation.hpp"
    3941#include "World.hpp"
    40 
    41 #include "AnalysisPairCorrelationUnitTest.hpp"
    4242
    4343#ifdef HAVE_TESTRUNNER
  • src/unittests/CountBondsUnitTest.cpp

    r5d6f38 rdd97a9  
    3838#include "periodentafel.hpp"
    3939#include "World.hpp"
    40 
    4140#include "CountBondsUnitTest.hpp"
    4241
  • src/unittests/LinkedCellUnitTest.cpp

    r5d6f38 rdd97a9  
    3333#include "molecule.hpp"
    3434#include "periodentafel.hpp"
     35#include "LinkedCellUnitTest.hpp"
    3536#include "World.hpp"
    36 
    37 #include "LinkedCellUnitTest.hpp"
    3837
    3938#ifdef HAVE_TESTRUNNER
  • src/unittests/Makefile.am

    r5d6f38 rdd97a9  
    11# PLEASE adhere to the alphabetical ordering in this Makefile!
    22# Also indentation by a single tab
    3 
    4 SUBDIRS = \
    5         ../Actions/unittests \
    6         ../Descriptors/unittests \
    7         ../Helpers/unittests \
    8         ../LinearAlgebra/unittests \
    9         ../Parser/unittests \
    10         ../Patterns/unittests \
    11         ../UIElements/Menu/unittests
    123
    134INCLUDES = -I$(top_srcdir)/src
     
    189
    1910TESTS = \
    20   AnalysisBondsUnitTest \
     11  ActionSequenceTest \
     12  ActOnAllUnitTest \
     13  AnalysisBondsUnitTests \
    2114  AnalysisCorrelationToPointUnitTest \
    2215  AnalysisCorrelationToSurfaceUnitTest \
    2316  AnalysisPairCorrelationUnitTest \
     17  atomsCalculationTest \
     18  AtomDescriptorTest \
    2419  BondGraphUnitTest \
    25   BoxUnitTest \
     20  BoxUnittest \
     21  CacheableTest \
    2622  CountBondsUnitTest \
    2723  FormulaUnittest \
     24  InfoUnitTest \
     25  LinearSystemOfEquationsUnitTest \
     26  LineUnittest \
    2827  LinkedCellUnitTest \
    2928  ListOfBondsUnitTest \
    30   PeriodentafelUnitTest \
     29  LogUnitTest \
     30  manipulateAtomsTest \
     31  MatrixContentSymmetricUnitTest \
     32  MatrixContentUnitTest \
     33  MatrixUnittest \
     34  MenuDescriptionUnitTest \
     35  MoleculeDescriptorTest \
     36  ObserverTest \
     37  ParserCommonUnitTest \
     38  ParserTremoloUnitTest \
     39  periodentafelTest \
     40  PlaneUnittest \
     41  Registry \
     42  ShapeUnittest \
     43  SingletonTest \
    3144  SubspaceFactorizerUnitTest \
    3245  TesselationUnitTest \
    3346  Tesselation_BoundaryTriangleUnitTest \
    34   Tesselation_InOutsideUnitTest
     47  Tesselation_InOutsideUnitTest \
     48  VectorContentUnitTest \
     49  VectorUnitTest
    3550
    3651
     
    5570
    5671TESTSOURCES = \
    57   ../Actions/unittests/ActionRegistryUnitTest.cpp \
    58   ../Actions/unittests/ActionSequenceUnitTest.cpp \
    59   AnalysisBondsUnitTest.cpp \
     72  ActOnAllUnitTest.cpp \
     73  ActionSequenceTest.cpp \
     74  analysisbondsunittest.cpp \
    6075  AnalysisCorrelationToPointUnitTest.cpp \
    6176  AnalysisCorrelationToSurfaceUnitTest.cpp  \
    6277  AnalysisPairCorrelationUnitTest.cpp \
    63   ../Descriptors/unittests/AtomDescriptorUnitTest.cpp \
    64   ../Actions/unittests/AtomsCalculationUnitTest.cpp \
    65   BondGraphUnitTest.cpp \
    66   BoxUnitTest.cpp \
    67   ../Patterns/unittests/CacheableUnitTest.cpp \
     78  AtomDescriptorTest.cpp \
     79  atomsCalculationTest.cpp \
     80  bondgraphunittest.cpp \
     81  BoxUnittest.cpp \
     82  CacheableTest.cpp \
    6883  CountBondsUnitTest.cpp \
    69   FormulaUnitTest.cpp \
    70   ../Helpers/unittests/InfoUnitTest.cpp \
    71   ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.cpp \
    72   ../LinearAlgebra/unittests/LineUnitTest.cpp \
     84  FormulaUnittest.cpp \
     85  infounittest.cpp \
     86  linearsystemofequationsunittest.cpp \
     87  LineUnittest.cpp \
    7388  LinkedCellUnitTest.cpp \
    74   ListOfBondsUnitTest.cpp \
    75   ../Helpers/unittests/LogUnitTest.cpp \
    76   ../Actions/unittests/ManipulateAtomsUnitTest.cpp \
    77   ../LinearAlgebra/unittests/MatrixContentSymmetricUnitTest.cpp \
    78   ../LinearAlgebra/unittests/MatrixContentUnitTest.cpp \
    79   ../LinearAlgebra/unittests/MatrixUnitTest.cpp \
    80   ../UIElements/Menu/unittests/MenuDescriptionUnitTest.cpp \
    81   ../Descriptors/unittests/MoleculeDescriptorUnitTest.cpp \
    82   ../Patterns/unittests/ObserverUnitTest.cpp \
    83   ../Parser/unittests/ParserCommonUnitTest.cpp \
    84   ../Parser/unittests/ParserTremoloUnitTest.cpp \
    85   PeriodentafelUnitTest.cpp \
    86   ../LinearAlgebra/unittests/PlaneUnitTest.cpp \
    87   ../Patterns/unittests/RegistryUnitTest.cpp \
    88   ../Shapes/unittests/ShapeUnitTest.cpp \
    89   ../Patterns/unittests/SingletonUnitTest.cpp \
    90   TesselationUnitTest.cpp \
    91   Tesselation_BoundaryTriangleUnitTest.cpp \
    92   Tesselation_InsideOutsideUnitTest.cpp \
    93   ../LinearAlgebra/unittests/VectorContentUnitTest.cpp \
    94   ../LinearAlgebra/unittests/VectorUnitTest.cpp
     89  listofbondsunittest.cpp \
     90  logunittest.cpp \
     91  MatrixContentSymmetricUnittest.cpp \
     92  MatrixContentUnittest.cpp \
     93  MatrixUnittest.cpp \
     94  manipulateAtomsTest.cpp \
     95  MenuDescriptionUnitTest.cpp \
     96  MoleculeDescriptorTest.cpp \
     97  ObserverTest.cpp \
     98  ParserCommonUnitTest.cpp \
     99  ParserTremoloUnitTest.cpp \
     100  periodentafelTest.cpp \
     101  PlaneUnittest.cpp \
     102  RegistryUnitTest.cpp \
     103  ShapeUnittest.cpp \
     104  SingletonTest.cpp \
     105  tesselationunittest.cpp \
     106  tesselation_boundarytriangleunittest.cpp \
     107  tesselation_insideoutsideunittest.cpp \
     108  VectorContentUnittest.cpp \
     109  vectorunittest.cpp
    95110
    96111TESTHEADERS = \
    97   ../Actions/unittests/ActionRegistryUnitTest.hpp \
    98   ../Actions/unittests/ActionSequenceUnitTest.hpp \
    99   AnalysisBondsUnitTest.hpp \
     112  ActOnAllUnitTest.hpp \
     113  ActionSequenceTest.hpp \
     114  analysisbondsunittest.hpp \
    100115  AnalysisCorrelationToPointUnitTest.hpp \
    101116  AnalysisCorrelationToSurfaceUnitTest.hpp  \
    102117  AnalysisPairCorrelationUnitTest.hpp \
    103   ../Descriptors/unittests/AtomDescriptorUnitTest.hpp \
    104   ../Actions/unittests/AtomsCalculationUnitTest.hpp \
    105   BondGraphUnitTest.hpp \
    106   BoxUnitTest.hpp \
    107   ../Patterns/unittests/CacheableUnitTest.hpp \
     118  AtomDescriptorTest.hpp \
     119  atomsCalculationTest.hpp \
     120  bondgraphunittest.hpp \
     121  BoxUnittest.hpp \
     122  CacheableTest.hpp \
    108123  CountBondsUnitTest.hpp \
    109   FormulaUnitTest.hpp \
    110   ../Helpers/unittests/InfoUnitTest.hpp \
    111   ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.hpp \
    112   ../LinearAlgebra/unittests/LineUnitTest.hpp \
     124  FormulaUnittest.hpp \
     125  infounittest.hpp \
     126  linearsystemofequationsunittest.hpp \
     127  LineUnittest.hpp \
    113128  LinkedCellUnitTest.hpp \
    114   ListOfBondsUnitTest.hpp \
    115   ../Helpers/unittests/LogUnitTest.hpp \
    116   ../Actions/unittests/ManipulateAtomsUnitTest.hpp \
    117   ../LinearAlgebra/unittests/MatrixContentSymmetricUnitTest.hpp \
    118   ../LinearAlgebra/unittests/MatrixContentUnitTest.hpp \
    119   ../LinearAlgebra/unittests/MatrixUnitTest.hpp \
    120   ../UIElements/Menu/unittests/MenuDescriptionUnitTest.hpp \
    121   ../Descriptors/unittests/MoleculeDescriptorUnitTest.hpp \
    122   ../Patterns/unittests/ObserverUnitTest.hpp \
    123   ../Parser/unittests/ParserCommonUnitTest.hpp \
    124   ../Parser/unittests/ParserTremoloUnitTest.hpp \
    125   PeriodentafelUnitTest.hpp \
    126   ../LinearAlgebra/unittests/PlaneUnitTest.hpp \
    127   ../Patterns/unittests/RegistryUnitTest.hpp \
    128   ../Shapes/unittests/ShapeUnitTest.hpp \
    129   ../Patterns/unittests/SingletonUnitTest.hpp \
    130   TesselationUnitTest.hpp \
    131   Tesselation_BoundaryTriangleUnitTest.hpp \
    132   Tesselation_InsideOutsideUnitTest.hpp \
    133   ../LinearAlgebra/unittests/VectorContentUnitTest.hpp \
    134   ../LinearAlgebra/unittests/VectorUnitTest.hpp
     129  listofbondsunittest.hpp \
     130  logunittest.hpp \
     131  manipulateAtomsTest.hpp \
     132  MatrixContentSymmetricUnittest.hpp \
     133  MatrixContentUnittest.hpp \
     134  MatrixUnittest.hpp \
     135  MenuDescriptionUnitTest.hpp \
     136  MoleculeDescriptorTest.hpp \
     137  ObserverTest.hpp \
     138  periodentafelTest.hpp \
     139  ParserCommonUnitTest.hpp \
     140  ParserTremoloUnitTest.hpp \
     141  PlaneUnittest.hpp \
     142  RegistryUnitTest.hpp \
     143  SingletonTest.hpp \
     144  tesselationunittest.hpp \
     145  tesselation_boundarytriangleunittest.hpp \
     146  tesselation_insideoutsideunittest.hpp \
     147  VectorContentUnittest.hpp \
     148  vectorunittest.hpp
    135149 
    136150
    137 AnalysisBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    138         AnalysisBondsUnitTest.cpp \
    139         AnalysisBondsUnitTest.hpp
    140 AnalysisBondsUnitTest_LDADD = ${ALLLIBS}
    141 
    142 AnalysisCorrelationToPointUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    143         analysis_correlation.hpp \
    144         AnalysisCorrelationToPointUnitTest.cpp \
    145         AnalysisCorrelationToPointUnitTest.hpp
     151ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp
     152ActionSequenceTest_LDADD = ${UILIBS} ${ALLLIBS}
     153
     154ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
     155ActOnAllUnitTest_LDADD = ${ALLLIBS}
     156
     157AnalysisBondsUnitTests_SOURCES = UnitTestMain.cpp analysisbondsunittest.cpp analysisbondsunittest.hpp
     158AnalysisBondsUnitTests_LDADD = ${ALLLIBS}
     159
     160AnalysisCorrelationToPointUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp
    146161AnalysisCorrelationToPointUnitTest_LDADD = ${ALLLIBS}
    147162
    148 AnalysisCorrelationToSurfaceUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    149         analysis_correlation.hpp \
    150         AnalysisCorrelationToSurfaceUnitTest.cpp \
    151         AnalysisCorrelationToSurfaceUnitTest.hpp
     163AnalysisCorrelationToSurfaceUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp
    152164AnalysisCorrelationToSurfaceUnitTest_LDADD = ${ALLLIBS}
    153165
    154 AnalysisPairCorrelationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    155         analysis_correlation.hpp \
    156         AnalysisPairCorrelationUnitTest.cpp \
    157         AnalysisPairCorrelationUnitTest.hpp
     166AnalysisPairCorrelationUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp
    158167AnalysisPairCorrelationUnitTest_LDADD = ${ALLLIBS}
    159168
    160 BondGraphUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    161         BondGraphUnitTest.cpp \
    162         BondGraphUnitTest.hpp
     169atomsCalculationTest_SOURCES = UnitTestMain.cpp atomsCalculationTest.cpp atomsCalculationTest.hpp
     170atomsCalculationTest_LDADD = ${ALLLIBS}
     171
     172AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp
     173AtomDescriptorTest_LDADD = ${ALLLIBS}
     174
     175BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
    163176BondGraphUnitTest_LDADD = ${ALLLIBS}
    164177
    165 BoxUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    166         BoxUnitTest.cpp \
    167         BoxUnitTest.hpp
    168 BoxUnitTest_LDADD = ${ALLLIBS}
    169 
    170 CountBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    171         CountBondsUnitTest.cpp \
    172         CountBondsUnitTest.hpp
     178BoxUnittest_SOURCES = UnitTestMain.cpp BoxUnittest.cpp BoxUnittest.hpp
     179BoxUnittest_LDADD = ${ALLLIBS}
     180
     181CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
     182CacheableTest_LDADD = ${ALLLIBS}
     183
     184CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp
    173185CountBondsUnitTest_LDADD = ${ALLLIBS}
    174186
    175 FormulaUnittest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    176         FormulaUnitTest.cpp \
    177         FormulaUnitTest.hpp
     187FormulaUnittest_SOURCES = UnitTestMain.cpp FormulaUnittest.cpp FormulaUnittest.hpp
    178188FormulaUnittest_LDADD = ${ALLLIBS}
    179189
    180 LinkedCellUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    181         LinkedCellUnitTest.cpp \
    182         LinkedCellUnitTest.hpp
     190MatrixContentSymmetricUnitTest_SOURCES = UnitTestMain.cpp MatrixContentSymmetricUnittest.cpp MatrixContentSymmetricUnittest
     191MatrixContentSymmetricUnitTest_LDADD = ${ALLLIBS}
     192
     193MatrixContentUnitTest_SOURCES = UnitTestMain.cpp MatrixContentUnittest.cpp MatrixContentUnittest.hpp
     194MatrixContentUnitTest_LDADD = ${ALLLIBS}
     195
     196InfoUnitTest_SOURCES = UnitTestMain.cpp infounittest.cpp infounittest.hpp
     197InfoUnitTest_LDADD = ${ALLLIBS}
     198
     199LinearSystemOfEquationsUnitTest_SOURCES = UnitTestMain.cpp linearsystemofequationsunittest.cpp linearsystemofequationsunittest.hpp
     200LinearSystemOfEquationsUnitTest_LDADD = ${ALLLIBS}
     201
     202LineUnittest_SOURCES = UnitTestMain.cpp LineUnittest.cpp LineUnittest.hpp
     203LineUnittest_LDADD = ${ALLLIBS}
     204
     205LinkedCellUnitTest_SOURCES = UnitTestMain.cpp LinkedCellUnitTest.cpp LinkedCellUnitTest.hpp
    183206LinkedCellUnitTest_LDADD = ${ALLLIBS}
    184207
    185 ListOfBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    186         ListOfBondsUnitTest.cpp \
    187         ListOfBondsUnitTest.hpp
     208ListOfBondsUnitTest_SOURCES = UnitTestMain.cpp listofbondsunittest.cpp listofbondsunittest.hpp
    188209ListOfBondsUnitTest_LDADD = ${ALLLIBS}
    189210
    190 PeriodentafelUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    191         PeriodentafelUnitTest.cpp \
    192         PeriodentafelUnitTest.hpp
    193 PeriodentafelUnitTest_LDADD = ${ALLLIBS}
    194 
    195 SubspaceFactorizerUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    196         SubspaceFactorizerUnitTest.cpp \
    197         SubspaceFactorizerUnitTest.hpp
     211LogUnitTest_SOURCES = UnitTestMain.cpp logunittest.cpp logunittest.hpp
     212LogUnitTest_LDADD = ${ALLLIBS}
     213
     214manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
     215manipulateAtomsTest_LDADD = ${UILIBS} ${ALLLIBS}
     216
     217MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp
     218MatrixUnittest_LDADD = ${ALLLIBS}
     219
     220MenuDescriptionUnitTest_SOURCES = UnitTestMain.cpp MenuDescriptionUnitTest.cpp   MenuDescriptionUnitTest.hpp
     221MenuDescriptionUnitTest_LDADD = ${ALLLIBS}
     222
     223MoleculeDescriptorTest_SOURCES = UnitTestMain.cpp MoleculeDescriptorTest.cpp MoleculeDescriptorTest.hpp
     224MoleculeDescriptorTest_LDADD = ${ALLLIBS}
     225
     226ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
     227ObserverTest_LDADD = ${ALLLIBS}
     228
     229ParserCommonUnitTest_SOURCES = UnitTestMain.cpp ParserCommonUnitTest.cpp ParserCommonUnitTest.hpp
     230ParserCommonUnitTest_LDADD = ${ALLLIBS}
     231
     232ParserTremoloUnitTest_SOURCES = UnitTestMain.cpp ParserTremoloUnitTest.cpp ParserTremoloUnitTest.hpp
     233ParserTremoloUnitTest_LDADD = ${ALLLIBS}
     234
     235periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
     236periodentafelTest_LDADD = ${ALLLIBS}
     237
     238PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
     239PlaneUnittest_LDADD = ${ALLLIBS}
     240
     241Registry_SOURCES = UnitTestMain.cpp RegistryUnitTest.cpp RegistryUnitTest.hpp
     242Registry_LDADD = ${ALLLIBS}
     243
     244ShapeUnittest_SOURCES = UnitTestMain.cpp ShapeUnittest.cpp ShapeUnittest.hpp
     245ShapeUnittest_LDADD = ${ALLLIBS}
     246
     247SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
     248SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
     249
     250SubspaceFactorizerUnitTest_SOURCES = UnitTestMain.cpp SubspaceFactorizerUnittest.cpp SubspaceFactorizerUnittest.hpp
    198251SubspaceFactorizerUnitTest_LDADD = ${GSLLIBS}
    199252
    200 TesselationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    201         TesselationUnitTest.cpp \
    202         TesselationUnitTest.hpp
     253TesselationUnitTest_SOURCES = UnitTestMain.cpp tesselationunittest.cpp tesselationunittest.hpp
    203254TesselationUnitTest_LDADD = ${ALLLIBS}
    204255
    205 Tesselation_BoundaryTriangleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    206         Tesselation_BoundaryTriangleUnitTest.cpp \
    207         Tesselation_BoundaryTriangleUnitTest.hpp
     256Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp
    208257Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS}
    209258
    210 Tesselation_InOutsideUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    211         Tesselation_InsideOutsideUnitTest.cpp \
    212         Tesselation_InsideOutsideUnitTest.hpp
     259Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp
    213260Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
    214261
     
    216263TestRunner_LDADD = ${UILIBS} ${ALLLIBS}
    217264
     265VectorContentUnitTest_SOURCES = UnitTestMain.cpp VectorContentUnittest.cpp VectorContentUnittest.hpp
     266VectorContentUnitTest_LDADD = ${ALLLIBS}
     267
     268VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
     269VectorUnitTest_LDADD = ${ALLLIBS}
     270
    218271#AUTOMAKE_OPTIONS = parallel-tests
  • tests/Makefile.am

    r5d6f38 rdd97a9  
    1 SUBDIRS = CodeChecks regression Tesselations
     1SUBDIRS = regression Tesselations
    22
  • tests/regression/Makefile.am

    r5d6f38 rdd97a9  
    1111        Graph \
    1212        Molecules \
    13         Selection \
    1413        Simple_configuration \
    1514        Tesselation
    1615TESTSUITE = $(srcdir)/testsuite
    17 
    18 TESTSCRIPTS = \
    19         $(srcdir)/testsuite-analysis.at \
    20         $(srcdir)/testsuite-domain.at \
    21         $(srcdir)/testsuite-filling.at \
    22         $(srcdir)/testsuite-fragmentation.at \
    23         $(srcdir)/testsuite-graph.at \
    24         $(srcdir)/testsuite-molecules.at \
    25         $(srcdir)/testsuite-simple_configuration.at \
    26         $(srcdir)/Selection/testsuite-selection.at \
    27         $(srcdir)/Selection/Atoms/testsuite-selection-all-atoms.at \
    28         $(srcdir)/Selection/Atoms/testsuite-selection-atoms-by-element.at \
    29         $(srcdir)/Selection/Atoms/testsuite-selection-atom-by-id.at \
    30         $(srcdir)/Selection/Atoms/testsuite-selection-atoms-inside-cuboid.at \
    31         $(srcdir)/Selection/Atoms/testsuite-selection-atoms-inside-sphere.at \
    32         $(srcdir)/Selection/Atoms/testsuite-selection-atoms-of-molecule.at \
    33         $(srcdir)/Selection/Atoms/testsuite-selection-clear-atoms.at \
    34         $(srcdir)/Selection/Molecules/testsuite-selection-all-molecules.at \
    35         $(srcdir)/Selection/Molecules/testsuite-selection-clear-molecules.at \
    36         $(srcdir)/Selection/Molecules/testsuite-selection-molecules-by-formula.at \
    37         $(srcdir)/Selection/Molecules/testsuite-selection-molecule-by-id.at \
    38         $(srcdir)/Selection/Molecules/testsuite-selection-molecules-by-name.at \
    39         $(srcdir)/Selection/Molecules/testsuite-selection-molecules-of-atoms.at \
    40         $(srcdir)/testsuite-specifics.at \
    41         $(srcdir)/testsuite-standard_options.at \
    42         $(srcdir)/testsuite-tesselation.at
    43 
    4416
    4517max_jobs = 4
     
    6436
    6537AUTOTEST = $(AUTOM4TE) --language=autotest
    66 $(TESTSUITE): $(srcdir)/testsuite.at $(TESTSCRIPTS)
     38$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/testsuite-*.at
    6739        $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
    6840        mv $@.tmp $@
  • tests/regression/Simple_configuration/2/post/test.pdb

    r5d6f38 rdd97a9  
    1 REMARK created by molecuilder on Tue Dec  7 13:11:31 2010
    2 ATOM      1 H01 0pre b1         10.000  10.000  10.000  1.00  1.00          H 0
     1REMARK created by molecuilder on Fri Aug 27 12:18:33 2010
     2ATOM      1  H01 tes b   0        10.0    10.0    10.0   1.0   1.0         0 H 0
    33END
  • tests/regression/testsuite-molecules.at

    r5d6f38 rdd97a9  
    4545AT_KEYWORDS([Molecules])
    4646AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/pre/test.* .], 0)
    47 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 --select-molecules-atoms -t "1., 1., 1." --periodic 0], 0, [stdout], [stderr])
     47AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecules-atoms 0 -t "1., 1., 1." --periodic 0], 0, [stdout], [stderr])
    4848AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/post/$file], 0, [ignore], [ignore])
    4949AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/pre/test2.* .], 0)
    50 AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 --select-molecules-atoms -t "-1., -1., -1." --periodic 0], 0, [stdout], [stderr])
     50AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ --select-molecules-atoms 0 -t "-1., -1., -1." --periodic 0], 0, [stdout], [stderr])
    5151AT_CHECK([file=test2.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/post/$file], 0, [ignore], [ignore])
    5252AT_CLEANUP
  • tests/regression/testsuite-simple_configuration.at

    r5d6f38 rdd97a9  
    4343AT_SETUP([Simple configuration - saving conf file])
    4444AT_KEYWORDS([configuration])
    45 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o pcp -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.conf --output store.conf], 0, [ignore], [ignore])
     45AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o pcp -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.conf -s store.conf], 0, [ignore], [ignore])
    4646AT_CHECK([diff store.conf ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.conf], 0, [ignore], [ignore])
    4747AT_CLEANUP
    4848AT_SETUP([Simple configuration - saving mpqc (from parsed xyz) file])
    4949AT_KEYWORDS([configuration])
    50 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz --output store.in], 0, [ignore], [ignore])
     50AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz -s store.in], 0, [ignore], [ignore])
    5151AT_CHECK([diff store.in ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.in], 0, [ignore], [ignore])
    5252AT_CLEANUP
    5353AT_SETUP([Simple configuration - saving pdb file])
    5454AT_KEYWORDS([configuration])
    55 AT_CHECK([../../molecuilder -i test.pdb -e ${abs_top_srcdir}/src/ -o pdb -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.pdb --output store.pdb], 0, [ignore], [ignore])
     55AT_CHECK([../../molecuilder -i test.pdb -e ${abs_top_srcdir}/src/ -o pdb -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.pdb -s store.pdb], 0, [ignore], [ignore])
    5656AT_CHECK([diff -I '.*created by molecuilder.*' store.pdb ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.pdb], 0, [ignore], [ignore])
    5757AT_CLEANUP
    5858AT_SETUP([Simple configuration - saving xyz file])
    5959AT_KEYWORDS([configuration])
    60 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o xyz -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz --output store.xyz], 0, [ignore], [ignore])
     60AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o xyz -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz -s store.xyz], 0, [ignore], [ignore])
    6161AT_CHECK([diff -I '.*Created by molecuilder.*' store.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.xyz], 0, [ignore], [ignore])
    6262AT_CLEANUP
  • tests/regression/testsuite-standard_options.at

    r5d6f38 rdd97a9  
    11AT_BANNER([MoleCuilder - standard options])
    22# 1. verbosity
     3AT_SETUP([Standard Options - verbosity])
     4AT_KEYWORDS([options])
     5AT_CHECK([pwd],[ignore],[ignore])
     6AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
     7AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
     8AT_CLEANUP
    39AT_SETUP([Standard Options - verbosity with Undo/Redo])
    410AT_KEYWORDS([options])
    5 AT_CHECK([pwd],[ignore],[ignore])
    6 AT_CHECK([../../molecuilder -v 9], 0, [stdout], [ignore])
    7 AT_CHECK([grep "Setting verbosity from .* to 9" stdout], 0, [ignore], [ignore])
    8 AT_CHECK([../../molecuilder -v 9 --undo], 0, [stdout], [ignore])
    9 AT_CHECK([grep "Setting verbosity from 9 to .*" stdout], 0, [ignore], [ignore])
    10 AT_CHECK([../../molecuilder -v 9 --undo --redo], 0, [stdout], [ignore])
    11 AT_CHECK([grep "Setting verbosity from .* to 9" stdout], 0, [ignore], [ignore])
     11AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore])
     12AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore])
     13AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore])
     14AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
    1215AT_CLEANUP
    1316
  • tests/regression/testsuite.at

    r5d6f38 rdd97a9  
    1616m4_include(testsuite-simple_configuration.at)
    1717
    18 m4_include(Selection/testsuite-selection.at)
    19 
    2018m4_include(testsuite-domain.at)
    2119
Note: See TracChangeset for help on using the changeset viewer.