Changes in / [dd97a9:5d6f38]
- Files:
-
- 256 added
- 146 deleted
- 61 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
rdd97a9 r5d6f38 134 134 AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder]) 135 135 AC_CONFIG_FILES([ 136 tests/CodeChecks/atlocal 137 tests/CodeChecks/Makefile]) 138 AC_CONFIG_FILES([ 136 139 tests/Tesselations/Makefile 137 140 tests/Tesselations/defs]) … … 145 148 src/Makefile 146 149 src/Actions/Makefile 147 148 149 150 150 src/Exceptions/Makefile 151 src/Helpers/Makefile 152 src/LinearAlgebra/Makefile 153 src/Parser/Makefile 151 154 src/UIElements/Makefile 152 src/unittests/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 ]) 153 166 AC_OUTPUT -
src/Actions/CommandAction/BondLengthTableAction.cpp
rdd97a9 r5d6f38 47 47 if (configuration->BG == NULL) { 48 48 configuration->BG = new BondGraph(configuration->GetIsAngstroem()); 49 if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) { 49 if ((!params.BondGraphFileName.empty()) 50 && boost::filesystem::exists(params.BondGraphFileName) 51 && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) { 50 52 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 51 53 return Action::success; -
src/Actions/Makefile.am
rdd97a9 r5d6f38 15 15 ${MOLECULEACTIONSOURCE} \ 16 16 ${PARSERACTIONSOURCE} \ 17 ${SELECTIONACTIONSOURCE} \ 17 ${SELECTIONATOMACTIONSOURCE} \ 18 ${SELECTIONMOLECULEACTIONSOURCE} \ 18 19 ${TESSELATIONACTIONSOURCE} \ 19 20 ${WORLDACTIONSOURCE} \ … … 29 30 ${MOLECULEACTIONHEADER} \ 30 31 ${PARSERACTIONHEADER} \ 31 ${SELECTIONACTIONHEADER} \ 32 ${SELECTIONATOMACTIONHEADER} \ 33 ${SELECTIONMOLECULEACTIONHEADER} \ 32 34 ${TESSELATIONACTIONHEADER} \ 33 35 ${WORLDACTIONHEADER} \ … … 122 124 MoleculeAction/VerletIntegrationAction.hpp 123 125 124 SELECTIONACTIONSOURCE = \ 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 148 SELECTIONACTIONHEADER = \ 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 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 173 184 TESSELATIONACTIONSOURCE = \ 174 185 TesselationAction/ConvexEnvelopeAction.cpp \ -
src/Actions/MoleculeAction/LoadAction.cpp
rdd97a9 r5d6f38 64 64 boost::filesystem::ifstream input; 65 65 input.open(params.filename); 66 FormatParserStorage::getInstance(). get(input, FilenameSuffix);66 FormatParserStorage::getInstance().load(input, FilenameSuffix); 67 67 input.close(); 68 68 -
src/Actions/MoleculeAction/SaveAction.cpp
rdd97a9 r5d6f38 60 60 output.open(params.filename); 61 61 if (!output.fail()) { 62 FormatParserStorage::getInstance(). put(output, FilenameSuffix);62 FormatParserStorage::getInstance().saveSelectedMolecules(output, FilenameSuffix); 63 63 } else { 64 64 DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl); … … 66 66 output.close(); 67 67 68 return Action:: failure;68 return Action::success; 69 69 } 70 70 -
src/Actions/MoleculeAction/SaveAction.def
rdd97a9 r5d6f38 30 30 31 31 // finally the information stored in the ActionTrait specialization 32 #define DESCRIPTION "save worldas file of certain type"32 #define DESCRIPTION "save selected molecules as file of certain type" 33 33 #define SHORTFORM "s" -
src/Actions/WorldAction/InputAction.cpp
rdd97a9 r5d6f38 71 71 // parse the file 72 72 test.open(params.filename); 73 FormatParserStorage::getInstance(). get(test, FilenameSuffix);73 FormatParserStorage::getInstance().load(test, FilenameSuffix); 74 74 test.close(); 75 75 -
src/Actions/WorldAction/OutputAction.cpp
rdd97a9 r5d6f38 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Parser/ ChangeTracker.hpp"22 #include "Parser/FormatParserStorage.hpp" 23 23 #include "Helpers/Log.hpp" 24 24 #include "Helpers/Verbose.hpp" … … 27 27 #include <iostream> 28 28 #include <string> 29 30 #include <boost/filesystem/fstream.hpp> 29 31 30 32 using namespace std; … … 40 42 getParametersfromValueStorage(); 41 43 42 DoLog(0) && (Log() << Verbose(0) << "Saving world to files." << endl); 43 ChangeTracker::getInstance().saveStatus(); 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 44 69 return Action::success; 45 70 } -
src/Actions/WorldAction/OutputAction.def
rdd97a9 r5d6f38 7 7 8 8 // all includes and forward declarations necessary for non-integral types below 9 9 # 10 10 11 11 // i.e. there is an integer with variable name Z that can be found in 12 12 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 13 13 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value 14 # undef paramtypes15 # undef paramtokens16 # undef paramdescriptions14 #define paramtypes (boost::filesystem::path) 15 #define paramtokens ("output") 16 #define paramdescriptions ("filename to write to") 17 17 #undef paramdefaults 18 # undef paramreferences18 #define paramreferences (filename) 19 19 20 20 #undef statetypes … … 30 30 31 31 // finally the information stored in the ActionTrait specialization 32 #define DESCRIPTION "write output files"32 #define DESCRIPTION "write all atoms to given file" 33 33 #undef SHORTFORM -
src/Descriptors/MoleculeNameDescriptor.cpp
rdd97a9 r5d6f38 53 53 54 54 vector<molecule*> MoleculeNameDescriptor_impl::findAll(){ 55 molecule *res = find(); 56 return (res)?(vector<molecule*>(1,res)):(vector<molecule*>()); 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; 57 62 } -
src/Helpers/MemDebug.cpp
rdd97a9 r5d6f38 380 380 // mark the block as not in the list (will be changed by addEntry) 381 381 entry->isIgnored = true; 382 Memory::addEntry(entry); 382 if (line != 0) { // indicator that we do not know the source 383 Memory::addEntry(entry); 384 } 383 385 384 386 // get the checksum... … … 424 426 // mark the block as not in the list (will be changed by addEntry) 425 427 entry->isIgnored = true; 426 Memory::addEntry(entry); 428 if (line != 0) { // indicator that we do not know the source 429 Memory::addEntry(entry); 430 } 427 431 428 432 // get the checksum... … … 505 509 void operator delete(void *ptr) throw() { 506 510 if(!ptr){ 507 cerr << "Warning: Deleting NULL pointer" << endl;511 //cerr << "Warning: Deleting NULL pointer" << endl; 508 512 return; 509 513 } -
src/Helpers/MemDebug.hpp
rdd97a9 r5d6f38 52 52 #include <boost/shared_ptr.hpp> 53 53 #include <boost/function.hpp> 54 #include <boost/program_options.hpp>55 54 56 55 -
src/LinearAlgebra/Makefile.am
rdd97a9 r5d6f38 17 17 LineSegment.cpp \ 18 18 LineSegmentSet.cpp \ 19 linearsystemofequations.cpp \19 LinearSystemOfEquations.cpp \ 20 20 MatrixContent.cpp \ 21 21 MatrixVector_ops.cpp \ … … 36 36 LineSegment.hpp \ 37 37 LineSegmentSet.hpp \ 38 linearsystemofequations.hpp \38 LinearSystemOfEquations.hpp \ 39 39 MatrixContent.hpp \ 40 40 MatrixVector_ops.hpp \ -
src/LinearAlgebra/Subspace.hpp
rdd97a9 r5d6f38 15 15 #include "MatrixContent.hpp" 16 16 #include "VectorContent.hpp" 17 #include "unittests/SubspaceFactorizerUnit test.hpp"17 #include "unittests/SubspaceFactorizerUnitTest.hpp" 18 18 19 19 /** A subset of eigenvectors from an Eigenspace. -
src/Makefile.am
rdd97a9 r5d6f38 84 84 85 85 86 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \ 86 DESCRIPTORSOURCE = \ 87 Descriptors/AtomDescriptor.cpp \ 87 88 Descriptors/AtomIdDescriptor.cpp \ 89 Descriptors/AtomOfMoleculeSelectionDescriptor.cpp \ 88 90 Descriptors/AtomSelectionDescriptor.cpp \ 89 91 Descriptors/AtomShapeDescriptor.cpp \ … … 93 95 Descriptors/MoleculeIdDescriptor.cpp \ 94 96 Descriptors/MoleculeNameDescriptor.cpp \ 97 Descriptors/MoleculeOfAtomSelectionDescriptor.cpp \ 98 Descriptors/MoleculeOrderDescriptor.cpp \ 95 99 Descriptors/MoleculePtrDescriptor.cpp \ 96 100 Descriptors/MoleculeSelectionDescriptor.cpp 97 101 98 102 99 DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \ 103 DESCRIPTORHEADER = \ 104 Descriptors/AtomDescriptor.hpp \ 100 105 Descriptors/AtomIdDescriptor.hpp \ 106 Descriptors/AtomOfMoleculeSelectionDescriptor.hpp \ 101 107 Descriptors/AtomSelectionDescriptor.hpp \ 102 108 Descriptors/AtomShapeDescriptor.hpp \ … … 106 112 Descriptors/MoleculeIdDescriptor.hpp \ 107 113 Descriptors/MoleculeNameDescriptor.hpp \ 114 Descriptors/MoleculeOfAtomSelectionDescriptor.hpp \ 115 Descriptors/MoleculeOrderDescriptor.hpp \ 108 116 Descriptors/MoleculePtrDescriptor.hpp \ 109 Descriptors/MoleculeSelectionDescriptor.cpp 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 110 134 111 135 THERMOSTATSOURCE = \ … … 191 215 ${SHAPEHEADER} \ 192 216 ${DESCRIPTORHEADER} \ 217 ${DESCRIPTORIMPLHEADER} \ 193 218 ${THERMOSTATHEADER} \ 194 219 ${TESSELATIONHEADER} \ … … 292 317 #molecuilder_CXXFLAGS += -DNO_CACHING 293 318 molecuilder_LDFLAGS = $(BOOST_LIB) 294 molecuilder_SOURCES = builder.cpp 319 molecuilder_SOURCES = builder.cpp builder_init.cpp builder_init.hpp 295 320 molecuilder_LDADD = \ 296 321 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ … … 304 329 305 330 #Stuff for building the GUI using Qt 306 molecuildergui_SOURCES = builder.cpp 331 molecuildergui_SOURCES = builder.cpp builder_init.cpp builder_init.hpp 307 332 molecuildergui_CXXFLAGS = $(BOOST_CPPFLAGS) -DUSE_GUI_QT 308 333 molecuildergui_LDFLAGS = $(BOOST_LIB) -
src/Parser/FormatParser.cpp
rdd97a9 r5d6f38 52 52 } 53 53 54 save(saveStream); 54 std::vector<atom *> atoms = World::getInstance().getAllAtoms(); 55 save(saveStream, atoms); 55 56 } 56 57 -
src/Parser/FormatParser.hpp
rdd97a9 r5d6f38 13 13 #include "parser.hpp" 14 14 15 class atom; 16 15 17 /** 16 18 * General parser which observes the change tracker. … … 20 22 FormatParser(); 21 23 virtual ~FormatParser(); 22 virtual void save(std::ostream* file )=0;24 virtual void save(std::ostream* file, const std::vector<atom *> &atoms)=0; 23 25 virtual void load(std::istream* file)=0; 24 26 void setOstream(std::ostream* file); -
src/Parser/FormatParserStorage.cpp
rdd97a9 r5d6f38 36 36 37 37 #include "Helpers/Assert.hpp" 38 39 #include "molecule.hpp" 38 40 39 41 #include "Patterns/Singleton_impl.hpp" … … 224 226 * \return true - parsing ok, false - suffix unknown 225 227 */ 226 bool FormatParserStorage:: get(std::istream &input, std::string suffix)228 bool FormatParserStorage::load(std::istream &input, std::string suffix) 227 229 { 228 230 if (suffix == ParserSuffixes[mpqc]) { … … 243 245 } 244 246 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 } 245 287 246 288 /** Stores world in an ostream depending on its suffix … … 249 291 * \return true - storing ok, false - suffix unknown 250 292 */ 251 bool FormatParserStorage::put(std::ostream &output, std::string suffix) 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) 252 305 { 253 306 if (suffix == ParserSuffixes[mpqc]) { 254 getMpqc().save(&output );307 getMpqc().save(&output, atoms); 255 308 } else if (suffix == ParserSuffixes[pcp]) { 256 getPcp().save(&output );309 getPcp().save(&output, atoms); 257 310 } else if (suffix == ParserSuffixes[pdb]) { 258 getPdb().save(&output );311 getPdb().save(&output, atoms); 259 312 } else if (suffix == ParserSuffixes[tremolo]) { 260 getTremolo().save(&output );313 getTremolo().save(&output, atoms); 261 314 } else if (suffix == ParserSuffixes[xyz]) { 262 getXyz().save(&output );315 getXyz().save(&output, atoms); 263 316 } else { 264 317 DoeLog(1) && (eLog() << Verbose(1) << "Unknown suffix " << suffix << " to for FormatParserStorage::put()." << endl); -
src/Parser/FormatParserStorage.hpp
rdd97a9 r5d6f38 20 20 #include <vector> 21 21 22 class atom; 22 23 class FormatParser; 23 24 class MpqcParser; … … 45 46 bool add(ParserTypes type); 46 47 47 bool get(std::istream &input, std::string suffix); 48 bool put(std::ostream &output, std::string suffix); 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); 49 53 MpqcParser &getMpqc(); 50 54 PcpParser &getPcp(); -
src/Parser/MpqcParser.cpp
rdd97a9 r5d6f38 53 53 } 54 54 55 void MpqcParser::save(ostream *file) 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) 56 62 { 57 63 DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl); 58 64 59 65 if (HessianPresent) 60 saveHessian(file );66 saveHessian(file, atoms); 61 67 else 62 saveSimple(file );68 saveSimple(file, atoms); 63 69 } 64 70 65 71 /** Saves all atoms and data into a MPQC config file without hessian. 66 72 * \param *file output stream 73 * \param atoms atoms to store 67 74 */ 68 void MpqcParser::saveSimple(ostream *file )75 void MpqcParser::saveSimple(ostream *file, const std::vector<atom *> &atoms) 69 76 { 70 77 Vector center; … … 112 119 /** Saves all atoms and data into a MPQC config file with hessian. 113 120 * \param *file output stream 121 * \param atoms atoms to store 114 122 */ 115 void MpqcParser::saveHessian(ostream *file )123 void MpqcParser::saveHessian(ostream *file, const std::vector<atom *> &atoms) 116 124 { 117 125 Vector center; -
src/Parser/MpqcParser.hpp
rdd97a9 r5d6f38 22 22 ~MpqcParser(); 23 23 void load(std::istream* file); 24 void save(std::ostream* file );24 void save(std::ostream* file, const std::vector<atom *> &atoms); 25 25 26 26 void setHessian(bool hessian); … … 30 30 bool HessianPresent; 31 31 32 void saveSimple(std::ostream *file );33 void saveHessian(std::ostream *file );32 void saveSimple(std::ostream *file, const std::vector<atom *> &atoms); 33 void saveHessian(std::ostream *file, const std::vector<atom *> &atoms); 34 34 }; 35 35 -
src/Parser/PcpParser.cpp
rdd97a9 r5d6f38 368 368 } 369 369 370 /** Saves the World into a PCP config file. 371 * \param *file output stream to save to 372 */ 373 void PcpParser::save(std::ostream* file) 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) 374 377 { 375 378 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl); … … 379 382 if (!file->fail()) { 380 383 // calculate number of Psis 381 vector<atom *> allatoms = World::getInstance().getAllAtoms(); 382 CalculateOrbitals(allatoms); 384 CalculateOrbitals(atoms); 383 385 *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl; 384 386 *file << endl; … … 468 470 *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl; 469 471 map<int, int> ZtoIndexMap; 470 OutputElements(file, a llatoms, ZtoIndexMap);471 OutputAtoms(file, a llatoms, ZtoIndexMap);472 OutputElements(file, atoms, ZtoIndexMap); 473 OutputAtoms(file, atoms, ZtoIndexMap); 472 474 } else { 473 475 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl); … … 479 481 * \param &allatoms all atoms to store away 480 482 */ 481 void PcpParser::CalculateOrbitals( vector<atom *> &allatoms)483 void PcpParser::CalculateOrbitals(const std::vector<atom *> &allatoms) 482 484 { 483 485 PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0; 484 for (vector<atom *>:: iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {486 for (vector<atom *>::const_iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) { 485 487 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals(); 486 488 } … … 512 514 * \param &ZtoIndexMap map of which atoms belong to which ion number 513 515 */ 514 void PcpParser::OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)516 void PcpParser::OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap) 515 517 { 516 518 map<int, int> PresentElements; 517 519 pair < map<int, int>::iterator, bool > Inserter; 518 520 // insert all found elements into the map 519 for (vector<atom *>:: iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {521 for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) { 520 522 Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1)); 521 523 if (!Inserter.second) // increase if present … … 542 544 * \param &ZtoIndexMap map of which atoms belong to which ion number 543 545 */ 544 void PcpParser::OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)546 void PcpParser::OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap) 545 547 { 546 548 *file << "#Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon)" << endl; … … 548 550 pair < map<int, int>::iterator, bool > Inserter; 549 551 int nr = 0; 550 for (vector<atom *>:: iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {552 for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) { 551 553 Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1) ); 552 554 if (!Inserter.second) -
src/Parser/PcpParser.hpp
rdd97a9 r5d6f38 20 20 ~PcpParser(); 21 21 void load(std::istream* file); 22 void save(std::ostream* file );22 void save(std::ostream* file, const std::vector<atom *> &atoms); 23 23 24 24 bool operator==(const PcpParser& b) const; … … 27 27 28 28 void ParseThermostats(class ConfigFileBuffer * const fb); 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);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); 32 32 33 33 class StructParallelization { -
src/Parser/PdbAtomInfoContainer.cpp
rdd97a9 r5d6f38 24 24 #include "Helpers/toString.hpp" 25 25 //#include "Helpers/Verbose.hpp" 26 #include "LinearAlgebra/Vector.hpp" 26 27 #include "PdbAtomInfoContainer.hpp" 27 28 28 29 29 30 PdbAtomInfoContainer::PdbAtomInfoContainer() : 31 token("ATOM"), 30 32 serial(0), 31 33 name("-"), 32 alt loc('0'),34 altLoc('0'), 33 35 resName("-"), 34 36 chainID('0'), … … 37 39 occupancy(0.), 38 40 tempFactor(0.), 41 element(""), 39 42 charge(0) 40 43 {} … … 46 49 { 47 50 switch (key) { 51 case PdbKey::token : 52 ScanKey(token, value); 53 break; 48 54 case PdbKey::serial : 49 55 ScanKey(serial, value); … … 52 58 ScanKey(name, value); 53 59 break; 54 case PdbKey::alt loc :55 ScanKey(alt loc, value);60 case PdbKey::altLoc : 61 ScanKey(altLoc, value); 56 62 break; 57 63 case PdbKey::resName : … … 67 73 ScanKey(iCode, value); 68 74 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; 69 84 case PdbKey::occupancy : 70 85 ScanKey(occupancy, value); … … 72 87 case PdbKey::tempFactor : 73 88 ScanKey(tempFactor, value); 89 break; 90 case PdbKey::element : 91 ScanKey(element, value); 74 92 break; 75 93 case PdbKey::charge : … … 82 100 } 83 101 84 std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const 102 template <> 103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const 85 104 { 86 105 switch (key) { 106 case PdbKey::token : 107 return toString(token); 87 108 case PdbKey::serial : 88 109 return toString(serial); 89 110 case PdbKey::name : 90 111 return toString(name); 91 case PdbKey::alt loc :92 return toString(alt loc);112 case PdbKey::altLoc : 113 return toString(altLoc); 93 114 case PdbKey::resName : 94 115 return toString(resName); … … 99 120 case PdbKey::iCode : 100 121 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]); 101 128 case PdbKey::occupancy : 102 129 return toString(occupancy); 103 130 case PdbKey::tempFactor : 104 131 return toString(tempFactor); 132 case PdbKey::element : 133 return toString(element); 105 134 case PdbKey::charge : 106 135 return toString(charge); … … 111 140 } 112 141 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
rdd97a9 r5d6f38 11 11 #include "PdbKey.hpp" 12 12 13 class Vector; 14 13 15 #include <string> 16 #include <typeinfo> 14 17 15 18 /** … … 22 25 23 26 // getter and setter 24 std::string get(const PdbKey::PdbDataKey key) const; 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 } 25 35 void set(const PdbKey::PdbDataKey key, std::string value); 26 36 … … 46 56 47 57 private: 58 std::string token; 48 59 int serial; 49 60 std::string name; 50 char alt loc;61 char altLoc; 51 62 std::string resName; 52 63 char chainID; 53 64 int resSeq; 54 65 char iCode; 66 Vector XYZ; 55 67 float occupancy; 56 68 float tempFactor; 69 std::string element; 57 70 int charge; 58 71 }; 59 72 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 60 80 #endif /* PDBATOMINFOCONTAINER_HPP_ */ -
src/Parser/PdbKey.hpp
rdd97a9 r5d6f38 18 18 enum PdbDataKey { 19 19 noKey, 20 token, 20 21 serial, 21 22 name, 22 alt loc,23 altLoc, 23 24 resName, 24 25 chainID, 25 26 resSeq, 26 27 iCode, 28 X, 29 Y, 30 Z, 27 31 occupancy, 28 32 tempFactor, 33 element, 29 34 charge 30 35 }; -
src/Parser/PdbParser.cpp
rdd97a9 r5d6f38 46 46 PdbParser::PdbParser() { 47 47 knownTokens["ATOM"] = PdbKey::Atom; 48 knownTokens["HETATM"] = PdbKey::Atom; 48 49 knownTokens["TER"] = PdbKey::Filler; 49 50 knownTokens["END"] = PdbKey::EndOfFile; … … 51 52 knownTokens["REMARK"] = PdbKey::Remark; 52 53 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; 53 59 } 54 60 … … 99 105 size_t linecount = 0; 100 106 enum PdbKey::KnownTokens token; 107 108 // reset atomIdMap for this file (to correctly parse CONECT entries) 109 atomIdMap.clear(); 101 110 102 111 molecule *newmol = World::getInstance().createMolecule(); … … 136 145 137 146 /** 138 * Saves the World's current stateinto as a PDB file.147 * Saves the \a atoms into as a PDB file. 139 148 * 140 149 * \param file where to save the state 141 */ 142 void PdbParser::save(ostream* file) { 150 * \param atoms atoms to store 151 */ 152 void PdbParser::save(ostream* file, const std::vector<atom *> &AtomList) 153 { 143 154 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl); 144 145 155 { 146 156 // add initial remark … … 157 167 } 158 168 159 // we distribute new atom numbers, hence clear map beforehand169 // we distribute serials, hence clear map beforehand 160 170 atomIdMap.clear(); 161 171 { 162 vector<atom *> AtomList = World::getInstance().getAllAtoms(); 163 164 std::vector<int> elementNo(MAX_ELEMENTS,1); 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); 165 186 char name[MAXSTRINGSIZE]; 187 std::string ResidueName; 166 188 167 189 // write ATOMs 168 190 int AtomNo = 1; // serial number starts at 1 in pdb 169 int MolNo = 1; // residue number starts at 1 in pdb 170 for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 191 for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 192 PdbAtomInfoContainer &atomInfo = getadditionalAtomData(*atomIt); 193 // gather info about residue 194 const molecule *mol = (*atomIt)->getMolecule(); 195 if (mol == NULL) { 196 MolNo = 0; 197 atomInfo.set(PdbKey::resSeq, "0"); 198 } 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)); 205 } 206 // get info about atom 171 207 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 174 const molecule *mol = (*atomIt)->getMolecule(); 175 if (mol == NULL) { // for homeless atoms, MolNo = -1 is reserved 176 MolNo = -1; 177 } else { 178 MolNo = mol->getId(); 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); 179 212 } 180 saveLine(file, *atomIt, name, AtomNo, MolNo); 181 setAtomId((*atomIt)->getId(), AtomNo); 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); 182 227 AtomNo++; 183 228 } 229 for (size_t i = 0; i < MaxMol; ++i) 230 delete elementNo[i]; 231 delete elementNo; 184 232 185 233 // write CONECTs 186 for (vector<atom *>:: iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {234 for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 187 235 writeNeighbors(file, 4, *atomIt); 188 236 } … … 193 241 } 194 242 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 195 264 /** 196 265 * Writes one line of PDB-formatted data to the provided stream. … … 198 267 * \param stream where to write the line to 199 268 * \param *currentAtom the atom of which information should be written 269 * \param AtomNo serial number of atom 200 270 * \param *name name of atom, i.e. H01 201 * \param AtomNo serial number of atom271 * \param ResidueName Name of molecule 202 272 * \param ResidueNo number of residue 203 273 */ 204 void 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"; 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 */ 225 320 226 321 *file << endl; … … 240 335 if (MaxNo >= MaxnumberOfNeighbors) { 241 336 *file << "CONECT"; 242 *file << setw(5) << get AtomId(currentAtom->getId());337 *file << setw(5) << getSerial(currentAtom->getId()); 243 338 MaxNo = 0; 244 339 } 245 *file << setw(5) << get AtomId((*currentBond)->GetOtherAtom(currentAtom)->getId());340 *file << setw(5) << getSerial((*currentBond)->GetOtherAtom(currentAtom)->getId()); 246 341 MaxNo++; 247 342 if (MaxNo == MaxnumberOfNeighbors) … … 253 348 } 254 349 255 256 350 /** Retrieves a value from PdbParser::atomIdMap. 257 351 * \param atomid key … … 259 353 */ 260 354 size_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 key272 * \return value273 */274 size_t PdbParser::getAtomId(const size_t atomid) const275 355 { 276 356 ASSERT(atomIdMap.find(atomid) != atomIdMap.end(), "PdbParser::getAtomId: atomid not present in Map."); … … 283 363 * \return true - key not present, false - value present 284 364 */ 285 void PdbParser::set AtomId(const size_t localatomid, const size_t atomid)365 void PdbParser::setSerial(const size_t localatomid, const size_t atomid) 286 366 { 287 367 pair<std::map<size_t,size_t>::iterator, bool > inserter; 288 DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting ("289 << localatomid << " -> " << atomid << ")." << std::endl);368 // DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting (" 369 // << localatomid << " -> " << atomid << ")." << std::endl); 290 370 inserter = atomIdMap.insert( make_pair(localatomid, atomid) ); 291 371 ASSERT(inserter.second, "PdbParser::setAtomId: atomId already present in Map."); … … 307 387 stringstream lineStream; 308 388 atom* newAtom = World::getInstance().createAtom(); 309 additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer); 310 PdbAtomInfoContainer &atomInfo = additionalAtomData[newAtom->getId()]; 389 PdbAtomInfoContainer &atomInfo = getadditionalAtomData(newAtom); 311 390 string word; 312 391 ConvertTo<size_t> toSize_t; … … 314 393 315 394 lineStream << line; 395 atomInfo.set(PdbKey::token, line.substr(0,6)); 316 396 atomInfo.set(PdbKey::serial, line.substr(6,5)); 317 397 std::pair< std::set<size_t>::const_iterator, bool> Inserter = 318 SerialSet.insert(toSize_t(atomInfo.get (PdbKey::serial)));398 SerialSet.insert(toSize_t(atomInfo.get<std::string>(PdbKey::serial))); 319 399 ASSERT(Inserter.second, 320 400 "PdbParser::readAtomDataLine() - ATOM contains entry with serial " 321 +atomInfo.get (PdbKey::serial)+" already present!");401 +atomInfo.get<std::string>(PdbKey::serial)+" already present!"); 322 402 // assign hightest+1 instead, but then beware of CONECT entries! Another map needed! 323 403 // if (!Inserter.second) { … … 326 406 // atomInfo.set(PdbKey::serial, toString(id)); 327 407 // DoeLog(2) && (eLog() << Verbose(2) 328 // << "Serial " << atomInfo.get (PdbKey::serial) << " already present, "408 // << "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, " 329 409 // << "assigning " << toString(id) << " instead." << std::endl); 330 410 // } … … 348 428 // << line.substr(78,2) << std::endl); 349 429 350 set AtomId(toSize_t(atomInfo.get(PdbKey::serial)), newAtom->getId());430 setSerial(toSize_t(atomInfo.get<std::string>(PdbKey::serial)), newAtom->getId()); 351 431 atomInfo.set(PdbKey::name, line.substr(12,4)); 352 atomInfo.set(PdbKey::alt loc, line.substr(16,1));432 atomInfo.set(PdbKey::altLoc, line.substr(16,1)); 353 433 atomInfo.set(PdbKey::resName, line.substr(17,3)); 354 434 atomInfo.set(PdbKey::chainID, line.substr(21,1)); … … 364 444 atomInfo.set(PdbKey::tempFactor, line.substr(60,6)); 365 445 atomInfo.set(PdbKey::charge, line.substr(78,2)); 366 PdbAtomInfoContainer::ScanKey(word, line.substr(76,2)); 367 newAtom->setType(World::getInstance().getPeriode()->FindElement(word)); 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); 368 452 369 453 if (newmol != NULL) … … 381 465 382 466 DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << 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); 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); 393 480 DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl); 394 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get (PdbKey::charge) << std::endl);481 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get<int>(PdbKey::charge) << std::endl); 395 482 } 396 483 … … 426 513 427 514 // add neighbours 428 atom *_atom = World::getInstance().getAtom(AtomById(get AtomId(id)));515 atom *_atom = World::getInstance().getAtom(AtomById(getSerial(id))); 429 516 for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin(); 430 517 iter != ListOfNeighbors.end(); 431 518 ++iter) { 432 519 // DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl); 433 atom * const _Otheratom = World::getInstance().getAtom(AtomById(get AtomId(*iter)));520 atom * const _Otheratom = World::getInstance().getAtom(AtomById(getSerial(*iter))); 434 521 _atom->addBond(_Otheratom); 435 522 } … … 478 565 const PdbAtomInfoContainer &OtheratomInfo = b.additionalAtomData.at((*iter)->getId()); 479 566 480 status = status && (atomInfo.get (PdbKey::serial) == OtheratomInfo.get(PdbKey::serial));567 status = status && (atomInfo.get<std::string>(PdbKey::serial) == OtheratomInfo.get<std::string>(PdbKey::serial)); 481 568 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl); 482 status = status && (atomInfo.get (PdbKey::name) == OtheratomInfo.get(PdbKey::name));569 status = status && (atomInfo.get<std::string>(PdbKey::name) == OtheratomInfo.get<std::string>(PdbKey::name)); 483 570 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl); 484 status = status && (atomInfo.get (PdbKey::altloc) == OtheratomInfo.get(PdbKey::altloc));485 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in alt locs!" << std::endl);486 status = status && (atomInfo.get (PdbKey::resName) == OtheratomInfo.get(PdbKey::resName));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)); 487 574 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl); 488 status = status && (atomInfo.get (PdbKey::chainID) == OtheratomInfo.get(PdbKey::chainID));575 status = status && (atomInfo.get<std::string>(PdbKey::chainID) == OtheratomInfo.get<std::string>(PdbKey::chainID)); 489 576 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl); 490 status = status && (atomInfo.get (PdbKey::resSeq) == OtheratomInfo.get(PdbKey::resSeq));577 status = status && (atomInfo.get<std::string>(PdbKey::resSeq) == OtheratomInfo.get<std::string>(PdbKey::resSeq)); 491 578 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl); 492 status = status && (atomInfo.get (PdbKey::iCode) == OtheratomInfo.get(PdbKey::iCode));579 status = status && (atomInfo.get<std::string>(PdbKey::iCode) == OtheratomInfo.get<std::string>(PdbKey::iCode)); 493 580 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl); 494 status = status && (atomInfo.get (PdbKey::occupancy) == OtheratomInfo.get(PdbKey::occupancy));581 status = status && (atomInfo.get<std::string>(PdbKey::occupancy) == OtheratomInfo.get<std::string>(PdbKey::occupancy)); 495 582 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl); 496 status = status && (atomInfo.get (PdbKey::tempFactor) == OtheratomInfo.get(PdbKey::tempFactor));583 status = status && (atomInfo.get<std::string>(PdbKey::tempFactor) == OtheratomInfo.get<std::string>(PdbKey::tempFactor)); 497 584 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl); 498 status = status && (atomInfo.get (PdbKey::charge) == OtheratomInfo.get(PdbKey::charge));585 status = status && (atomInfo.get<std::string>(PdbKey::charge) == OtheratomInfo.get<std::string>(PdbKey::charge)); 499 586 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl); 500 587 } -
src/Parser/PdbParser.hpp
rdd97a9 r5d6f38 23 23 ~PdbParser(); 24 24 void load(std::istream* file); 25 void save(std::ostream* file );25 void save(std::ostream* file, const std::vector<atom *> &atoms); 26 26 27 27 bool operator==(const PdbParser& b) const; … … 38 38 bool isUsedField(std::string fieldName); 39 39 void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom); 40 void saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResdueNo);40 void saveLine(ostream* file, const PdbAtomInfoContainer &atomInfo); 41 41 42 42 // internal getter and setter 43 PdbAtomInfoContainer& getadditionalAtomData(atom *_atom); 43 44 size_t getSerial(const size_t atomid) const; 44 size_t getAtomId(const size_t atomid) const; 45 void setAtomId(const size_t localatomid, const size_t atomid); 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; 46 51 47 52 /** -
src/Parser/TremoloAtomInfoContainer.cpp
rdd97a9 r5d6f38 42 42 GrpTypeNo("0"), 43 43 torsion("-"), 44 neighbors(std::vector<int>(0, 5)) 44 neighbors(std::vector<int>(0, 5)), 45 neighbors_processed(false) 45 46 {} 46 47 -
src/Parser/TremoloAtomInfoContainer.hpp
rdd97a9 r5d6f38 39 39 std::string torsion; 40 40 std::vector<int> neighbors; 41 bool neighbors_processed; 41 42 }; 42 43 -
src/Parser/TremoloParser.cpp
rdd97a9 r5d6f38 90 90 string::size_type location; 91 91 92 // reset atomIdMap, for we now get new serials 93 atomIdMap.clear(); 92 94 usedFields.clear(); 95 93 96 molecule *newmol = World::getInstance().createMolecule(); 94 97 newmol->ActiveFlag = true; … … 114 117 115 118 /** 116 * Saves the World's current stateinto as a tremolo file.119 * Saves the \a atoms into as a tremolo file. 117 120 * 118 121 * \param file where to save the state 119 */ 120 void TremoloParser::save(ostream* file) { 122 * \param atoms atoms to store 123 */ 124 void TremoloParser::save(ostream* file, const std::vector<atom *> &AtomList) { 121 125 DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl); 122 126 123 vector<atom*>:: iterator atomIt;127 vector<atom*>::const_iterator atomIt; 124 128 vector<string>::iterator it; 125 129 … … 129 133 } 130 134 *file << endl; 131 vector<atom *> AtomList = World::getInstance().getAllAtoms();132 135 for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 133 136 saveLine(file, *atomIt); … … 220 223 ? (*currentBond)->GetOtherAtom(currentAtom)->getId()+1 : 0) << "\t"; 221 224 if (currentBond != currentAtom->ListOfBonds.end()) 222 currentBond++;225 ++currentBond; 223 226 } 224 227 } … … 259 262 atom* newAtom = World::getInstance().createAtom(); 260 263 TremoloAtomInfoContainer *atomInfo = NULL; 261 additionalAtomData[newAtom->getId()] = *(new TremoloAtomInfoContainer);264 additionalAtomData[newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values 262 265 atomInfo = &additionalAtomData[newAtom->getId()]; 263 266 TremoloKey::atomDataKey currentField; … … 310 313 * Reads neighbor information for one atom from the input. 311 314 * 312 * \param stream where to read the information from313 * \param number of neighbors to read314 * \param world id of the atom the information belongs to315 * \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 315 318 */ 316 319 void TremoloParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) { … … 320 323 // 0 is used to fill empty neighbor positions in the tremolo file. 321 324 if (neighborId > 0) { 325 // std::cout << "Atom with global id " << atomId << " has neighbour with serial " << neighborId << std::endl; 322 326 additionalAtomData[atomId].neighbors.push_back(neighborId); 323 327 } … … 356 360 currentInfo != additionalAtomData.end(); currentInfo++ 357 361 ) { 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]))); 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; 363 374 } 364 375 } -
src/Parser/TremoloParser.hpp
rdd97a9 r5d6f38 26 26 ~TremoloParser(); 27 27 void load(std::istream* file); 28 void save(std::ostream* file );28 void save(std::ostream* file, const std::vector<atom *> &atoms); 29 29 void setFieldsForSave(std::string atomDataLine); 30 30 -
src/Parser/XyzParser.cpp
rdd97a9 r5d6f38 78 78 79 79 /** 80 * Saves the current state of the World into the givenXYZ file.80 * Saves the \a atoms into as a XYZ file. 81 81 * 82 * \param XYZ file 82 * \param file where to save the state 83 * \param atoms atoms to store 83 84 */ 84 void XyzParser::save(ostream* file ) {85 void XyzParser::save(ostream* file, const std::vector<atom *> &atoms) { 85 86 DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl); 86 87 //if (comment == "") { … … 95 96 comment += time; 96 97 //} 97 *file << World::getInstance().numAtoms() << endl << "\t" << comment << endl;98 *file << atoms.size() << endl << "\t" << comment << endl; 98 99 99 vector<atom*> atoms = World::getInstance().getAllAtoms(); 100 for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) { 100 for(vector<atom*>::const_iterator it = atoms.begin(); it != atoms.end(); it++) { 101 101 *file << noshowpoint << (*it)->getType()->getSymbol() << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl; 102 102 } -
src/Parser/XyzParser.hpp
rdd97a9 r5d6f38 20 20 ~XyzParser(); 21 21 void load(std::istream* file); 22 void save(std::ostream* file );22 void save(std::ostream* file, const std::vector<atom *> &atoms); 23 23 24 24 private: -
src/Patterns/Singleton_impl.hpp
rdd97a9 r5d6f38 9 9 #define SINGLETON_IMPL_HPP_ 10 10 11 #include "Helpers/Assert.hpp" 11 12 #include "Patterns/Singleton.hpp" 12 13 -
src/ThermoStatContainer.cpp
rdd97a9 r5d6f38 54 54 ThermostatTraits<Thermostat> *WoodcockTrait = new ThermostatTraits<Woodcock>(); 55 55 availThermostats[WoodcockTrait->getName()] = WoodcockTrait; 56 for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){ 57 cout << iter->first << endl; 58 } 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 59 64 ASSERT(availThermostats.size()==6,"Not all implemented thermostats referenced!\nDid you check the names in the traits?"); 60 65 activeThermostat=new Berendsen(); -
src/UIElements/CommandLineUI/CommandLineParser.cpp
rdd97a9 r5d6f38 97 97 const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first); 98 98 // 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 else106 std::cout << ", with no short form ";107 if (currentOption->hasDefaultValue())108 std::cout << ", with default value " << currentOption->getDefaultValue();109 else110 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; 112 112 113 113 AddOptionToParser(currentOption, (CmdParserLookup["options"])); … … 116 116 if (!ActionAlreadyAdded_flag) { 117 117 // 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 else126 std::cout << ", with no short form ";127 if (currentAction->Traits.hasDefaultValue())128 std::cout << ", with default value " << currentAction->Traits.getDefaultValue();129 else130 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; 132 132 133 133 ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(), … … 156 156 ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!"); 157 157 // 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; 159 159 switch(TypeToEnums.getEnumforType(currentOption->getType())) { 160 160 default: … … 369 369 { 370 370 std::map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap(); 371 DoLog(0) && (Log() << Verbose(0) << "Scanning command line arguments and recognizing Actions." << std::endl); 371 372 // go through all arguments 372 373 for (int i=1;i<argc;i++) { 373 (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl);374 DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl); 374 375 // check whether they 375 376 if (argv[i][0] == '-') { // .. begin with - 376 (cout << Verbose(1) << "Possible argument: " << argv[i] << endl);377 DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl); 377 378 if (argv[i][1] == '-') { // .. or -- 378 (cout<< Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);379 DoLog(1) && (Log() << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl); 379 380 SequenceOfActions.push_back(&(argv[i][2])); 380 381 // .. and check that next letter is not numeric, if so insert … … 382 383 std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1])); 383 384 if (iter != ShortFormToActionMap.end()) { 384 (cout<< Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);385 DoLog(1) && (Log() << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl); 385 386 SequenceOfActions.push_back(iter->second); 386 387 } … … 404 405 * \return map from Action's ShortForm to token. 405 406 */ 406 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() 407 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() const 407 408 { 408 409 std::map <std::string, std::string> result; -
src/UIElements/CommandLineUI/CommandLineParser.hpp
rdd97a9 r5d6f38 143 143 144 144 // creates a map from short forms to action tokens needed to parse command line 145 std::map <std::string, std::string> getShortFormToActionMap() ;145 std::map <std::string, std::string> getShortFormToActionMap() const; 146 146 147 147 // lookup list from "configmenus" to the ones of CommandLineParser -
src/UIElements/CommandLineUI/CommandLineWindow.cpp
rdd97a9 r5d6f38 25 25 #include "CommandLineUI/CommandLineStatusIndicator.hpp" 26 26 27 #include "Helpers/Log.hpp" 28 #include "Helpers/Verbose.hpp" 29 27 30 #include "Actions/Action.hpp" 28 31 #include "Actions/ActionRegistry.hpp" … … 50 53 51 54 // go through all possible actions 55 DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl); 52 56 for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) { 53 cout << "Checking presence of " << *CommandRunner << ": ";54 57 if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) { 55 cout << "calling " << *CommandRunner << endl; 58 DoLog(1) && (Log() << Verbose(1) 59 << "Checking presence of " << *CommandRunner << ": " 60 << "calling " << *CommandRunner << endl); 56 61 ActionRegistry::getInstance().getActionByName(*CommandRunner)->call(); 57 62 } else { 58 cout << "absent." << endl; 63 DoLog(1) && (Log() << Verbose(1) 64 << "Checking presence of " << *CommandRunner << ": " 65 << "absent." << endl); 59 66 } 60 67 } -
src/UIElements/CommandLineUI/TypeEnumContainer.cpp
rdd97a9 r5d6f38 64 64 TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType; 65 65 66 ListAllKnownTypes(); 66 // for debugging: list all stored types 67 //ListAllKnownTypes(); 67 68 }; 68 69 … … 83 84 std::cout << " Known type is " << (iter->first)->name() << " or enum " << iter->second << std::endl; 84 85 } 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;88 86 } 89 87 … … 94 92 enum TypeEnumContainer::EnumOfTypes TypeEnumContainer::getEnumforType(const std::type_info *_type) 95 93 { 96 std::cout << "Looking for type " << _type->name() << std::endl;94 //std::cout << "Looking for type " << _type->name() << std::endl; 97 95 ASSERT(TypeEnumMap.find(_type) != TypeEnumMap.end(), 98 96 "CommandLineParser::getEnumforType() - cannot find the type as enum!."); -
src/UIElements/Menu/Menu.cpp
rdd97a9 r5d6f38 76 76 const std::string &TopName = iter->second.first; 77 77 const int &MenuPosition = iter->second.second; 78 std::cout << "MenuName is " << MenuName79 << ", TopName is " << TopName80 << " and Position is " << MenuPosition81 << std::endl;78 // std::cout << "MenuName is " << MenuName 79 // << ", TopName is " << TopName 80 // << " and Position is " << MenuPosition 81 // << std::endl; 82 82 83 83 // does it belong to us? … … 125 125 void Menu::addSeparator() 126 126 { 127 std::cout << "Creating separator at position " << TopPosition << std::endl;127 // std::cout << "Creating separator at position " << TopPosition << std::endl; 128 128 ASSERT( LastItem != SeparatorItem, 129 129 "Menu::populate() - adding another separator after a separator!"); … … 135 135 void Menu::addSubmenu(const std::string &MenuName, const int MenuPosition) 136 136 { 137 std::cout << "Creating top-level menu " << MenuName138 << " at position " << TopPosition << std::endl;137 // std::cout << "Creating top-level menu " << MenuName 138 // << " at position " << TopPosition << std::endl; 139 139 ASSERT (!isPresent(MenuName), 140 140 "Menu::addSubmenu() - trying to add menu "+MenuName+" with already present token!"); -
src/UIElements/Menu/MenuDescription.cpp
rdd97a9 r5d6f38 89 89 MenuDescription::~MenuDescription() 90 90 { 91 std::cout << "MenuDescription: clearing maps ... " << std::endl;91 //std::cout << "MenuDescription: clearing maps ... " << std::endl; 92 92 for (IterableMap::iterator iter = MenuPositionMap->begin(); !MenuPositionMap->empty(); iter = MenuPositionMap->begin()) 93 93 MenuPositionMap->erase(iter); -
src/UIElements/Menu/Qt4/QtMenu.hpp
rdd97a9 r5d6f38 72 72 CharRunner != ActionName.end(); 73 73 ++CharRunner) { 74 std::cout << "Current char is " << *CharRunner << std::endl;74 // std::cout << "Current char is " << *CharRunner << std::endl; 75 75 if (!Inserted) { 76 76 Inserter = ShortcutMap.insert( … … 78 78 ); 79 79 if (Inserter.second) { 80 std::cout << "Accelerator is " << *CharRunner << std::endl;80 // std::cout << "Accelerator is " << *CharRunner << std::endl; 81 81 newname += '&'; 82 82 Inserted = true; -
src/builder.cpp
rdd97a9 r5d6f38 73 73 #endif 74 74 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 75 #include "builder_init.hpp" 111 76 112 77 /********************************************** Main routine **************************************/ 113 78 114 /** In this function all dynamicly allocated member variables to static/global115 * 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 the118 * program. Check with valgrind that truely no memory leak occurs!119 */120 void AddStaticEntitiestoIgnoreList()121 {122 // zeroVec and unitVec are global variables (on the stack) but vectorContent123 // within is situated on the heap and has to be ignored124 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 instances132 * which have static/global variables. Some singletons depend on others hence we133 * acertain a specific ordering here, which is is used via the atexit() hook.134 */135 void 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 present147 Action::removeStaticStateEntities();148 // put some static variables' dynamic contents on the Memory::ignore map to avoid their149 // admonishing lateron150 AddStaticEntitiestoIgnoreList();151 logger::purgeInstance();152 errorLogger::purgeInstance();153 #ifdef LOG_OBSERVER154 cout << observerLog().getLog();155 #endif156 Memory::getState();157 }158 159 void dumpMemory(){160 ofstream ost("molecuilder.memdump");161 Memory::dumpMemory(ost);162 }163 164 79 int main(int argc, char **argv) 165 80 { 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"); 81 initGeneral(); 175 82 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; 83 initUI(argc,argv); 182 84 183 setVerbosity(0); 184 // need to init the history before any action is created 185 ActionHistory::init(); 85 doUI(); 186 86 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); 87 return saveAll(); 244 88 } 245 89 -
src/molecule_dynamics.cpp
rdd97a9 r5d6f38 484 484 atoms.end(), 485 485 boost::bind(&atom::EvaluateConstrainedForce,_1,startstep,endstep,PermutationMap,Force)); 486 //ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force );487 486 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 488 487 }; … … 617 616 // and perform Verlet integration for each atom with position, velocity and force vector 618 617 // check size of vectors 619 //ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 );620 618 for_each(atoms.begin(), 621 619 atoms.end(), -
src/periodentafel.cpp
rdd97a9 r5d6f38 307 307 //cout << "First header: " << header1tmp << endl; 308 308 //cout << "Second header: " << header2tmp << endl; 309 DoLog(0) && (Log() << Verbose(0) << "Parsed elements:");309 // DoLog(0) && (Log() << Verbose(0) << "Parsed elements:"); 310 310 while (!input.eof()) { 311 311 element *neues = new element; … … 332 332 if ((neues->getNumber() > 0) && (neues->getNumber() < MAX_ELEMENTS)) { 333 333 parsedElements[neues->Z] = neues; 334 DoLog(0) && (Log() << Verbose(0) << " " << *neues);334 // DoLog(0) && (Log() << Verbose(0) << " " << *neues); 335 335 } else { 336 336 DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl); … … 345 345 } 346 346 } 347 DoLog(0) && (Log() << Verbose(0) << endl);347 // DoLog(0) && (Log() << Verbose(0) << endl); 348 348 } else { 349 349 DoeLog(1) && (eLog() << Verbose(1) << "Could not open the database." << endl); -
src/periodentafel.hpp
rdd97a9 r5d6f38 13 13 #include <string> 14 14 15 #include "unittests/ periodentafelTest.hpp"15 #include "unittests/PeriodentafelUnitTest.hpp" 16 16 #include "Helpers/defs.hpp" 17 17 #include "types.hpp" -
src/tesselationhelpers.cpp
rdd97a9 r5d6f38 29 29 #include "Helpers/Info.hpp" 30 30 #include "linkedcell.hpp" 31 #include "LinearAlgebra/ linearsystemofequations.hpp"31 #include "LinearAlgebra/LinearSystemOfEquations.hpp" 32 32 #include "Helpers/Log.hpp" 33 33 #include "tesselation.hpp" -
src/unittests/AnalysisCorrelationToPointUnitTest.cpp
rdd97a9 r5d6f38 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisCorrelationToPointUnitTest.hpp"30 29 31 30 #include "Descriptors/MoleculeDescriptor.hpp" … … 37 36 #include "periodentafel.hpp" 38 37 #include "World.hpp" 38 39 #include "AnalysisCorrelationToPointUnitTest.hpp" 39 40 40 41 #ifdef HAVE_TESTRUNNER -
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
rdd97a9 r5d6f38 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisCorrelationToSurfaceUnitTest.hpp"30 31 29 #include "Descriptors/MoleculeDescriptor.hpp" 32 30 … … 41 39 #include "Helpers/Assert.hpp" 42 40 43 #include " Helpers/Assert.hpp"41 #include "AnalysisCorrelationToSurfaceUnitTest.hpp" 44 42 45 43 #ifdef HAVE_TESTRUNNER -
src/unittests/AnalysisPairCorrelationUnitTest.cpp
rdd97a9 r5d6f38 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisPairCorrelationUnitTest.hpp"30 31 29 #include "Descriptors/MoleculeDescriptor.hpp" 32 30 … … 40 38 #include "tesselation.hpp" 41 39 #include "World.hpp" 40 41 #include "AnalysisPairCorrelationUnitTest.hpp" 42 42 43 43 #ifdef HAVE_TESTRUNNER -
src/unittests/CountBondsUnitTest.cpp
rdd97a9 r5d6f38 38 38 #include "periodentafel.hpp" 39 39 #include "World.hpp" 40 40 41 #include "CountBondsUnitTest.hpp" 41 42 -
src/unittests/LinkedCellUnitTest.cpp
rdd97a9 r5d6f38 33 33 #include "molecule.hpp" 34 34 #include "periodentafel.hpp" 35 #include "World.hpp" 36 35 37 #include "LinkedCellUnitTest.hpp" 36 #include "World.hpp"37 38 38 39 #ifdef HAVE_TESTRUNNER -
src/unittests/Makefile.am
rdd97a9 r5d6f38 1 1 # PLEASE adhere to the alphabetical ordering in this Makefile! 2 2 # 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 3 12 4 13 INCLUDES = -I$(top_srcdir)/src … … 9 18 10 19 TESTS = \ 11 ActionSequenceTest \ 12 ActOnAllUnitTest \ 13 AnalysisBondsUnitTests \ 20 AnalysisBondsUnitTest \ 14 21 AnalysisCorrelationToPointUnitTest \ 15 22 AnalysisCorrelationToSurfaceUnitTest \ 16 23 AnalysisPairCorrelationUnitTest \ 17 atomsCalculationTest \18 AtomDescriptorTest \19 24 BondGraphUnitTest \ 20 BoxUnittest \ 21 CacheableTest \ 25 BoxUnitTest \ 22 26 CountBondsUnitTest \ 23 27 FormulaUnittest \ 24 InfoUnitTest \25 LinearSystemOfEquationsUnitTest \26 LineUnittest \27 28 LinkedCellUnitTest \ 28 29 ListOfBondsUnitTest \ 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 \ 30 PeriodentafelUnitTest \ 44 31 SubspaceFactorizerUnitTest \ 45 32 TesselationUnitTest \ 46 33 Tesselation_BoundaryTriangleUnitTest \ 47 Tesselation_InOutsideUnitTest \ 48 VectorContentUnitTest \ 49 VectorUnitTest 34 Tesselation_InOutsideUnitTest 50 35 51 36 … … 70 55 71 56 TESTSOURCES = \ 72 ActOnAllUnitTest.cpp \73 ActionSequenceTest.cpp \74 analysisbondsunittest.cpp \57 ../Actions/unittests/ActionRegistryUnitTest.cpp \ 58 ../Actions/unittests/ActionSequenceUnitTest.cpp \ 59 AnalysisBondsUnitTest.cpp \ 75 60 AnalysisCorrelationToPointUnitTest.cpp \ 76 61 AnalysisCorrelationToSurfaceUnitTest.cpp \ 77 62 AnalysisPairCorrelationUnitTest.cpp \ 78 AtomDescriptorTest.cpp \79 atomsCalculationTest.cpp \80 bondgraphunittest.cpp \81 BoxUnit test.cpp \82 CacheableTest.cpp \63 ../Descriptors/unittests/AtomDescriptorUnitTest.cpp \ 64 ../Actions/unittests/AtomsCalculationUnitTest.cpp \ 65 BondGraphUnitTest.cpp \ 66 BoxUnitTest.cpp \ 67 ../Patterns/unittests/CacheableUnitTest.cpp \ 83 68 CountBondsUnitTest.cpp \ 84 FormulaUnit test.cpp \85 infounittest.cpp \86 linearsystemofequationsunittest.cpp \87 LineUnittest.cpp \69 FormulaUnitTest.cpp \ 70 ../Helpers/unittests/InfoUnitTest.cpp \ 71 ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.cpp \ 72 ../LinearAlgebra/unittests/LineUnitTest.cpp \ 88 73 LinkedCellUnitTest.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.cpp74 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 110 95 111 96 TESTHEADERS = \ 112 ActOnAllUnitTest.hpp \113 ActionSequenceTest.hpp \114 analysisbondsunittest.hpp \97 ../Actions/unittests/ActionRegistryUnitTest.hpp \ 98 ../Actions/unittests/ActionSequenceUnitTest.hpp \ 99 AnalysisBondsUnitTest.hpp \ 115 100 AnalysisCorrelationToPointUnitTest.hpp \ 116 101 AnalysisCorrelationToSurfaceUnitTest.hpp \ 117 102 AnalysisPairCorrelationUnitTest.hpp \ 118 AtomDescriptorTest.hpp \119 atomsCalculationTest.hpp \120 bondgraphunittest.hpp \121 BoxUnit test.hpp \122 CacheableTest.hpp \103 ../Descriptors/unittests/AtomDescriptorUnitTest.hpp \ 104 ../Actions/unittests/AtomsCalculationUnitTest.hpp \ 105 BondGraphUnitTest.hpp \ 106 BoxUnitTest.hpp \ 107 ../Patterns/unittests/CacheableUnitTest.hpp \ 123 108 CountBondsUnitTest.hpp \ 124 FormulaUnit test.hpp \125 infounittest.hpp \126 linearsystemofequationsunittest.hpp \127 LineUnittest.hpp \109 FormulaUnitTest.hpp \ 110 ../Helpers/unittests/InfoUnitTest.hpp \ 111 ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.hpp \ 112 ../LinearAlgebra/unittests/LineUnitTest.hpp \ 128 113 LinkedCellUnitTest.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 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 149 135 150 136 151 ActionSequenceTest_SOURCES = UnitTestMain.cpp ActionSequenceTest.cpp ActionSequenceTest.hpp 152 ActionSequenceTest_LDADD = ${UILIBS} ${ALLLIBS} 153 154 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp 155 ActOnAllUnitTest_LDADD = ${ALLLIBS} 156 157 AnalysisBondsUnitTests_SOURCES = UnitTestMain.cpp analysisbondsunittest.cpp analysisbondsunittest.hpp 158 AnalysisBondsUnitTests_LDADD = ${ALLLIBS} 159 160 AnalysisCorrelationToPointUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp 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 161 146 AnalysisCorrelationToPointUnitTest_LDADD = ${ALLLIBS} 162 147 163 AnalysisCorrelationToSurfaceUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp 148 AnalysisCorrelationToSurfaceUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 149 analysis_correlation.hpp \ 150 AnalysisCorrelationToSurfaceUnitTest.cpp \ 151 AnalysisCorrelationToSurfaceUnitTest.hpp 164 152 AnalysisCorrelationToSurfaceUnitTest_LDADD = ${ALLLIBS} 165 153 166 AnalysisPairCorrelationUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp 154 AnalysisPairCorrelationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 155 analysis_correlation.hpp \ 156 AnalysisPairCorrelationUnitTest.cpp \ 157 AnalysisPairCorrelationUnitTest.hpp 167 158 AnalysisPairCorrelationUnitTest_LDADD = ${ALLLIBS} 168 159 169 atomsCalculationTest_SOURCES = UnitTestMain.cpp atomsCalculationTest.cpp atomsCalculationTest.hpp 170 atomsCalculationTest_LDADD = ${ALLLIBS} 171 172 AtomDescriptorTest_SOURCES = UnitTestMain.cpp AtomDescriptorTest.cpp AtomDescriptorTest.hpp 173 AtomDescriptorTest_LDADD = ${ALLLIBS} 174 175 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp 160 BondGraphUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 161 BondGraphUnitTest.cpp \ 162 BondGraphUnitTest.hpp 176 163 BondGraphUnitTest_LDADD = ${ALLLIBS} 177 164 178 BoxUnittest_SOURCES = UnitTestMain.cpp BoxUnittest.cpp BoxUnittest.hpp 179 BoxUnittest_LDADD = ${ALLLIBS} 180 181 CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp 182 CacheableTest_LDADD = ${ALLLIBS} 183 184 CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp 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 185 173 CountBondsUnitTest_LDADD = ${ALLLIBS} 186 174 187 FormulaUnittest_SOURCES = UnitTestMain.cpp FormulaUnittest.cpp FormulaUnittest.hpp 175 FormulaUnittest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 176 FormulaUnitTest.cpp \ 177 FormulaUnitTest.hpp 188 178 FormulaUnittest_LDADD = ${ALLLIBS} 189 179 190 MatrixContentSymmetricUnitTest_SOURCES = UnitTestMain.cpp MatrixContentSymmetricUnittest.cpp MatrixContentSymmetricUnittest 191 MatrixContentSymmetricUnitTest_LDADD = ${ALLLIBS} 192 193 MatrixContentUnitTest_SOURCES = UnitTestMain.cpp MatrixContentUnittest.cpp MatrixContentUnittest.hpp 194 MatrixContentUnitTest_LDADD = ${ALLLIBS} 195 196 InfoUnitTest_SOURCES = UnitTestMain.cpp infounittest.cpp infounittest.hpp 197 InfoUnitTest_LDADD = ${ALLLIBS} 198 199 LinearSystemOfEquationsUnitTest_SOURCES = UnitTestMain.cpp linearsystemofequationsunittest.cpp linearsystemofequationsunittest.hpp 200 LinearSystemOfEquationsUnitTest_LDADD = ${ALLLIBS} 201 202 LineUnittest_SOURCES = UnitTestMain.cpp LineUnittest.cpp LineUnittest.hpp 203 LineUnittest_LDADD = ${ALLLIBS} 204 205 LinkedCellUnitTest_SOURCES = UnitTestMain.cpp LinkedCellUnitTest.cpp LinkedCellUnitTest.hpp 180 LinkedCellUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 181 LinkedCellUnitTest.cpp \ 182 LinkedCellUnitTest.hpp 206 183 LinkedCellUnitTest_LDADD = ${ALLLIBS} 207 184 208 ListOfBondsUnitTest_SOURCES = UnitTestMain.cpp listofbondsunittest.cpp listofbondsunittest.hpp 185 ListOfBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 186 ListOfBondsUnitTest.cpp \ 187 ListOfBondsUnitTest.hpp 209 188 ListOfBondsUnitTest_LDADD = ${ALLLIBS} 210 189 211 LogUnitTest_SOURCES = UnitTestMain.cpp logunittest.cpp logunittest.hpp 212 LogUnitTest_LDADD = ${ALLLIBS} 213 214 manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp 215 manipulateAtomsTest_LDADD = ${UILIBS} ${ALLLIBS} 216 217 MatrixUnittest_SOURCES = UnitTestMain.cpp MatrixUnittest.cpp MatrixUnittest.hpp 218 MatrixUnittest_LDADD = ${ALLLIBS} 219 220 MenuDescriptionUnitTest_SOURCES = UnitTestMain.cpp MenuDescriptionUnitTest.cpp MenuDescriptionUnitTest.hpp 221 MenuDescriptionUnitTest_LDADD = ${ALLLIBS} 222 223 MoleculeDescriptorTest_SOURCES = UnitTestMain.cpp MoleculeDescriptorTest.cpp MoleculeDescriptorTest.hpp 224 MoleculeDescriptorTest_LDADD = ${ALLLIBS} 225 226 ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp 227 ObserverTest_LDADD = ${ALLLIBS} 228 229 ParserCommonUnitTest_SOURCES = UnitTestMain.cpp ParserCommonUnitTest.cpp ParserCommonUnitTest.hpp 230 ParserCommonUnitTest_LDADD = ${ALLLIBS} 231 232 ParserTremoloUnitTest_SOURCES = UnitTestMain.cpp ParserTremoloUnitTest.cpp ParserTremoloUnitTest.hpp 233 ParserTremoloUnitTest_LDADD = ${ALLLIBS} 234 235 periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp 236 periodentafelTest_LDADD = ${ALLLIBS} 237 238 PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp 239 PlaneUnittest_LDADD = ${ALLLIBS} 240 241 Registry_SOURCES = UnitTestMain.cpp RegistryUnitTest.cpp RegistryUnitTest.hpp 242 Registry_LDADD = ${ALLLIBS} 243 244 ShapeUnittest_SOURCES = UnitTestMain.cpp ShapeUnittest.cpp ShapeUnittest.hpp 245 ShapeUnittest_LDADD = ${ALLLIBS} 246 247 SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp 248 SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB} 249 250 SubspaceFactorizerUnitTest_SOURCES = UnitTestMain.cpp SubspaceFactorizerUnittest.cpp SubspaceFactorizerUnittest.hpp 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 251 198 SubspaceFactorizerUnitTest_LDADD = ${GSLLIBS} 252 199 253 TesselationUnitTest_SOURCES = UnitTestMain.cpp tesselationunittest.cpp tesselationunittest.hpp 200 TesselationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 201 TesselationUnitTest.cpp \ 202 TesselationUnitTest.hpp 254 203 TesselationUnitTest_LDADD = ${ALLLIBS} 255 204 256 Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp 205 Tesselation_BoundaryTriangleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 206 Tesselation_BoundaryTriangleUnitTest.cpp \ 207 Tesselation_BoundaryTriangleUnitTest.hpp 257 208 Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS} 258 209 259 Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp 210 Tesselation_InOutsideUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 211 Tesselation_InsideOutsideUnitTest.cpp \ 212 Tesselation_InsideOutsideUnitTest.hpp 260 213 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS} 261 214 … … 263 216 TestRunner_LDADD = ${UILIBS} ${ALLLIBS} 264 217 265 VectorContentUnitTest_SOURCES = UnitTestMain.cpp VectorContentUnittest.cpp VectorContentUnittest.hpp266 VectorContentUnitTest_LDADD = ${ALLLIBS}267 268 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp269 VectorUnitTest_LDADD = ${ALLLIBS}270 271 218 #AUTOMAKE_OPTIONS = parallel-tests -
tests/Makefile.am
rdd97a9 r5d6f38 1 SUBDIRS = regression Tesselations1 SUBDIRS = CodeChecks regression Tesselations 2 2 -
tests/regression/Makefile.am
rdd97a9 r5d6f38 11 11 Graph \ 12 12 Molecules \ 13 Selection \ 13 14 Simple_configuration \ 14 15 Tesselation 15 16 TESTSUITE = $(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 16 44 17 45 max_jobs = 4 … … 36 64 37 65 AUTOTEST = $(AUTOM4TE) --language=autotest 38 $(TESTSUITE): $(srcdir)/testsuite.at $( srcdir)/testsuite-*.at66 $(TESTSUITE): $(srcdir)/testsuite.at $(TESTSCRIPTS) 39 67 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at 40 68 mv $@.tmp $@ -
tests/regression/Simple_configuration/2/post/test.pdb
rdd97a9 r5d6f38 1 REMARK created by molecuilder on Fri Aug 27 12:18:3320102 ATOM 1 H01 tes b 0 10.0 10.0 10.0 1.0 1.0 0H 01 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 3 3 END -
tests/regression/testsuite-molecules.at
rdd97a9 r5d6f38 45 45 AT_KEYWORDS([Molecules]) 46 46 AT_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 s-atoms 0-t "1., 1., 1." --periodic 0], 0, [stdout], [stderr])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]) 48 48 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/post/$file], 0, [ignore], [ignore]) 49 49 AT_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 s-atoms 0-t "-1., -1., -1." --periodic 0], 0, [stdout], [stderr])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]) 51 51 AT_CHECK([file=test2.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/6/post/$file], 0, [ignore], [ignore]) 52 52 AT_CLEANUP -
tests/regression/testsuite-simple_configuration.at
rdd97a9 r5d6f38 43 43 AT_SETUP([Simple configuration - saving conf file]) 44 44 AT_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 - sstore.conf], 0, [ignore], [ignore])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]) 46 46 AT_CHECK([diff store.conf ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.conf], 0, [ignore], [ignore]) 47 47 AT_CLEANUP 48 48 AT_SETUP([Simple configuration - saving mpqc (from parsed xyz) file]) 49 49 AT_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 - sstore.in], 0, [ignore], [ignore])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]) 51 51 AT_CHECK([diff store.in ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.in], 0, [ignore], [ignore]) 52 52 AT_CLEANUP 53 53 AT_SETUP([Simple configuration - saving pdb file]) 54 54 AT_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 - sstore.pdb], 0, [ignore], [ignore])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]) 56 56 AT_CHECK([diff -I '.*created by molecuilder.*' store.pdb ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.pdb], 0, [ignore], [ignore]) 57 57 AT_CLEANUP 58 58 AT_SETUP([Simple configuration - saving xyz file]) 59 59 AT_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 - sstore.xyz], 0, [ignore], [ignore])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]) 61 61 AT_CHECK([diff -I '.*Created by molecuilder.*' store.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.xyz], 0, [ignore], [ignore]) 62 62 AT_CLEANUP -
tests/regression/testsuite-standard_options.at
rdd97a9 r5d6f38 1 1 AT_BANNER([MoleCuilder - standard options]) 2 2 # 1. verbosity 3 AT_SETUP([Standard Options - verbosity ])3 AT_SETUP([Standard Options - verbosity with Undo/Redo]) 4 4 AT_KEYWORDS([options]) 5 5 AT_CHECK([pwd],[ignore],[ignore]) 6 AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore]) 7 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore]) 8 AT_CLEANUP 9 AT_SETUP([Standard Options - verbosity with Undo/Redo]) 10 AT_KEYWORDS([options]) 11 AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore]) 12 AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore]) 13 AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore]) 14 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [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]) 15 12 AT_CLEANUP 16 13 -
tests/regression/testsuite.at
rdd97a9 r5d6f38 16 16 m4_include(testsuite-simple_configuration.at) 17 17 18 m4_include(Selection/testsuite-selection.at) 19 18 20 m4_include(testsuite-domain.at) 19 21
Note:
See TracChangeset
for help on using the changeset viewer.