Changes in / [5d6f38:dd97a9]
- Files:
-
- 146 added
- 256 deleted
- 61 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r5d6f38 rdd97a9 134 134 AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder]) 135 135 AC_CONFIG_FILES([ 136 tests/CodeChecks/atlocal137 tests/CodeChecks/Makefile])138 AC_CONFIG_FILES([139 136 tests/Tesselations/Makefile 140 137 tests/Tesselations/defs]) … … 148 145 src/Makefile 149 146 src/Actions/Makefile 150 151 152 153 147 src/Exceptions/Makefile 148 src/Helpers/Makefile 149 src/LinearAlgebra/Makefile 150 src/Parser/Makefile 154 151 src/UIElements/Makefile 155 ]) 156 AC_CONFIG_FILES([ 157 src/unittests/Makefile 158 src/Actions/unittests/Makefile 159 src/Descriptors/unittests/Makefile 160 src/Helpers/unittests/Makefile 161 src/LinearAlgebra/unittests/Makefile 162 src/Parser/unittests/Makefile 163 src/Patterns/unittests/Makefile 164 src/UIElements/Menu/unittests/Makefile 165 ]) 152 src/unittests/Makefile]) 166 153 AC_OUTPUT -
src/Actions/CommandAction/BondLengthTableAction.cpp
r5d6f38 rdd97a9 47 47 if (configuration->BG == NULL) { 48 48 configuration->BG = new BondGraph(configuration->GetIsAngstroem()); 49 if ((!params.BondGraphFileName.empty()) 50 && boost::filesystem::exists(params.BondGraphFileName) 51 && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) { 49 if ((!params.BondGraphFileName.empty()) && (configuration->BG->LoadBondLengthTable(params.BondGraphFileName.string()))) { 52 50 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 53 51 return Action::success; -
src/Actions/Makefile.am
r5d6f38 rdd97a9 15 15 ${MOLECULEACTIONSOURCE} \ 16 16 ${PARSERACTIONSOURCE} \ 17 ${SELECTIONATOMACTIONSOURCE} \ 18 ${SELECTIONMOLECULEACTIONSOURCE} \ 17 ${SELECTIONACTIONSOURCE} \ 19 18 ${TESSELATIONACTIONSOURCE} \ 20 19 ${WORLDACTIONSOURCE} \ … … 30 29 ${MOLECULEACTIONHEADER} \ 31 30 ${PARSERACTIONHEADER} \ 32 ${SELECTIONATOMACTIONHEADER} \ 33 ${SELECTIONMOLECULEACTIONHEADER} \ 31 ${SELECTIONACTIONHEADER} \ 34 32 ${TESSELATIONACTIONHEADER} \ 35 33 ${WORLDACTIONHEADER} \ … … 124 122 MoleculeAction/VerletIntegrationAction.hpp 125 123 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 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 184 173 TESSELATIONACTIONSOURCE = \ 185 174 TesselationAction/ConvexEnvelopeAction.cpp \ -
src/Actions/MoleculeAction/LoadAction.cpp
r5d6f38 rdd97a9 64 64 boost::filesystem::ifstream input; 65 65 input.open(params.filename); 66 FormatParserStorage::getInstance(). load(input, FilenameSuffix);66 FormatParserStorage::getInstance().get(input, FilenameSuffix); 67 67 input.close(); 68 68 -
src/Actions/MoleculeAction/SaveAction.cpp
r5d6f38 rdd97a9 60 60 output.open(params.filename); 61 61 if (!output.fail()) { 62 FormatParserStorage::getInstance(). saveSelectedMolecules(output, FilenameSuffix);62 FormatParserStorage::getInstance().put(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:: success;68 return Action::failure; 69 69 } 70 70 -
src/Actions/MoleculeAction/SaveAction.def
r5d6f38 rdd97a9 30 30 31 31 // finally the information stored in the ActionTrait specialization 32 #define DESCRIPTION "save selected moleculesas file of certain type"32 #define DESCRIPTION "save world as file of certain type" 33 33 #define SHORTFORM "s" -
src/Actions/WorldAction/InputAction.cpp
r5d6f38 rdd97a9 71 71 // parse the file 72 72 test.open(params.filename); 73 FormatParserStorage::getInstance(). load(test, FilenameSuffix);73 FormatParserStorage::getInstance().get(test, FilenameSuffix); 74 74 test.close(); 75 75 -
src/Actions/WorldAction/OutputAction.cpp
r5d6f38 rdd97a9 20 20 #include "Helpers/MemDebug.hpp" 21 21 22 #include "Parser/ FormatParserStorage.hpp"22 #include "Parser/ChangeTracker.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>31 29 32 30 using namespace std; … … 42 40 getParametersfromValueStorage(); 43 41 44 DoLog(1) && (Log() << Verbose(1) << "Storing world to file " << params.filename << "." << endl); 45 46 // extract suffix 47 std::string FilenameSuffix; 48 std::string FilenamePrefix; 49 if (params.filename.has_filename()) { 50 // get suffix 51 FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "." 52 FilenamePrefix = params.filename.stem(); 53 } else { 54 DoeLog(1) && (eLog() << Verbose(1) << "Output file does not have a suffix, cannot recognize format." << endl); 55 return Action::failure; 56 } 57 58 // store file 59 // parse the file 60 boost::filesystem::ofstream output; 61 output.open(params.filename); 62 if (!output.fail()) { 63 FormatParserStorage::getInstance().saveWorld(output, FilenameSuffix); 64 } else { 65 DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << params.filename << "." << endl); 66 } 67 output.close(); 68 42 DoLog(0) && (Log() << Verbose(0) << "Saving world to files." << endl); 43 ChangeTracker::getInstance().saveStatus(); 69 44 return Action::success; 70 45 } -
src/Actions/WorldAction/OutputAction.def
r5d6f38 rdd97a9 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 # define paramtypes (boost::filesystem::path)15 # define paramtokens ("output")16 # define paramdescriptions ("filename to write to")14 #undef paramtypes 15 #undef paramtokens 16 #undef paramdescriptions 17 17 #undef paramdefaults 18 # define paramreferences (filename)18 #undef paramreferences 19 19 20 20 #undef statetypes … … 30 30 31 31 // finally the information stored in the ActionTrait specialization 32 #define DESCRIPTION "write all atoms to given file"32 #define DESCRIPTION "write output files" 33 33 #undef SHORTFORM -
src/Descriptors/MoleculeNameDescriptor.cpp
r5d6f38 rdd97a9 53 53 54 54 vector<molecule*> MoleculeNameDescriptor_impl::findAll(){ 55 vector<molecule *> foundMolecules; 56 World::MoleculeSet &molecules = getMolecules(); 57 World::MoleculeSet::iterator res = molecules.begin(); 58 for (; res != molecules.end(); res++) 59 if (res->second->name == name) 60 foundMolecules.push_back(res->second); 61 return foundMolecules; 55 molecule *res = find(); 56 return (res)?(vector<molecule*>(1,res)):(vector<molecule*>()); 62 57 } -
src/Helpers/MemDebug.cpp
r5d6f38 rdd97a9 380 380 // mark the block as not in the list (will be changed by addEntry) 381 381 entry->isIgnored = true; 382 if (line != 0) { // indicator that we do not know the source 383 Memory::addEntry(entry); 384 } 382 Memory::addEntry(entry); 385 383 386 384 // get the checksum... … … 426 424 // mark the block as not in the list (will be changed by addEntry) 427 425 entry->isIgnored = true; 428 if (line != 0) { // indicator that we do not know the source 429 Memory::addEntry(entry); 430 } 426 Memory::addEntry(entry); 431 427 432 428 // get the checksum... … … 509 505 void operator delete(void *ptr) throw() { 510 506 if(!ptr){ 511 //cerr << "Warning: Deleting NULL pointer" << endl;507 cerr << "Warning: Deleting NULL pointer" << endl; 512 508 return; 513 509 } -
src/Helpers/MemDebug.hpp
r5d6f38 rdd97a9 52 52 #include <boost/shared_ptr.hpp> 53 53 #include <boost/function.hpp> 54 #include <boost/program_options.hpp> 54 55 55 56 -
src/LinearAlgebra/Makefile.am
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 84 84 85 85 86 DESCRIPTORSOURCE = \ 87 Descriptors/AtomDescriptor.cpp \ 86 DESCRIPTORSOURCE = Descriptors/AtomDescriptor.cpp \ 88 87 Descriptors/AtomIdDescriptor.cpp \ 89 Descriptors/AtomOfMoleculeSelectionDescriptor.cpp \90 88 Descriptors/AtomSelectionDescriptor.cpp \ 91 89 Descriptors/AtomShapeDescriptor.cpp \ … … 95 93 Descriptors/MoleculeIdDescriptor.cpp \ 96 94 Descriptors/MoleculeNameDescriptor.cpp \ 97 Descriptors/MoleculeOfAtomSelectionDescriptor.cpp \98 Descriptors/MoleculeOrderDescriptor.cpp \99 95 Descriptors/MoleculePtrDescriptor.cpp \ 100 96 Descriptors/MoleculeSelectionDescriptor.cpp 101 97 102 98 103 DESCRIPTORHEADER = \ 104 Descriptors/AtomDescriptor.hpp \ 99 DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp \ 105 100 Descriptors/AtomIdDescriptor.hpp \ 106 Descriptors/AtomOfMoleculeSelectionDescriptor.hpp \107 101 Descriptors/AtomSelectionDescriptor.hpp \ 108 102 Descriptors/AtomShapeDescriptor.hpp \ … … 112 106 Descriptors/MoleculeIdDescriptor.hpp \ 113 107 Descriptors/MoleculeNameDescriptor.hpp \ 114 Descriptors/MoleculeOfAtomSelectionDescriptor.hpp \115 Descriptors/MoleculeOrderDescriptor.hpp \116 108 Descriptors/MoleculePtrDescriptor.hpp \ 117 Descriptors/MoleculeSelectionDescriptor.hpp 118 119 DESCRIPTORIMPLHEADER = \ 120 Descriptors/AtomDescriptor_impl.hpp \ 121 Descriptors/AtomIdDescriptor_impl.hpp \ 122 Descriptors/AtomOfMoleculeSelectionDescriptor_impl.hpp \ 123 Descriptors/AtomSelectionDescriptor_impl.hpp \ 124 Descriptors/AtomShapeDescriptor_impl.hpp \ 125 Descriptors/AtomTypeDescriptor_impl.hpp \ 126 Descriptors/MoleculeDescriptor_impl.hpp \ 127 Descriptors/MoleculeFormulaDescriptor_impl.hpp \ 128 Descriptors/MoleculeIdDescriptor_impl.hpp \ 129 Descriptors/MoleculeNameDescriptor_impl.hpp \ 130 Descriptors/MoleculeOfAtomSelectionDescriptor_impl.hpp \ 131 Descriptors/MoleculeOrderDescriptor_impl.hpp \ 132 Descriptors/MoleculePtrDescriptor_impl.hpp \ 133 Descriptors/MoleculeSelectionDescriptor_impl.hpp 109 Descriptors/MoleculeSelectionDescriptor.cpp 134 110 135 111 THERMOSTATSOURCE = \ … … 215 191 ${SHAPEHEADER} \ 216 192 ${DESCRIPTORHEADER} \ 217 ${DESCRIPTORIMPLHEADER} \218 193 ${THERMOSTATHEADER} \ 219 194 ${TESSELATIONHEADER} \ … … 317 292 #molecuilder_CXXFLAGS += -DNO_CACHING 318 293 molecuilder_LDFLAGS = $(BOOST_LIB) 319 molecuilder_SOURCES = builder.cpp builder_init.cpp builder_init.hpp294 molecuilder_SOURCES = builder.cpp 320 295 molecuilder_LDADD = \ 321 296 UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \ … … 329 304 330 305 #Stuff for building the GUI using Qt 331 molecuildergui_SOURCES = builder.cpp builder_init.cpp builder_init.hpp306 molecuildergui_SOURCES = builder.cpp 332 307 molecuildergui_CXXFLAGS = $(BOOST_CPPFLAGS) -DUSE_GUI_QT 333 308 molecuildergui_LDFLAGS = $(BOOST_LIB) -
src/Parser/FormatParser.cpp
r5d6f38 rdd97a9 52 52 } 53 53 54 std::vector<atom *> atoms = World::getInstance().getAllAtoms(); 55 save(saveStream, atoms); 54 save(saveStream); 56 55 } 57 56 -
src/Parser/FormatParser.hpp
r5d6f38 rdd97a9 13 13 #include "parser.hpp" 14 14 15 class atom;16 17 15 /** 18 16 * General parser which observes the change tracker. … … 22 20 FormatParser(); 23 21 virtual ~FormatParser(); 24 virtual void save(std::ostream* file , const std::vector<atom *> &atoms)=0;22 virtual void save(std::ostream* file)=0; 25 23 virtual void load(std::istream* file)=0; 26 24 void setOstream(std::ostream* file); -
src/Parser/FormatParserStorage.cpp
r5d6f38 rdd97a9 36 36 37 37 #include "Helpers/Assert.hpp" 38 39 #include "molecule.hpp"40 38 41 39 #include "Patterns/Singleton_impl.hpp" … … 226 224 * \return true - parsing ok, false - suffix unknown 227 225 */ 228 bool FormatParserStorage:: load(std::istream &input, std::string suffix)226 bool FormatParserStorage::get(std::istream &input, std::string suffix) 229 227 { 230 228 if (suffix == ParserSuffixes[mpqc]) { … … 245 243 } 246 244 247 /** Stores all selected atoms in an ostream depending on its suffix248 * \param &output output stream249 * \param suffix250 * \return true - storing ok, false - suffix unknown251 */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 suffix259 * 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 stream262 * \param suffix263 * \return true - storing ok, false - suffix unknown264 */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 }287 245 288 246 /** Stores world in an ostream depending on its suffix … … 291 249 * \return true - storing ok, false - suffix unknown 292 250 */ 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) 251 bool FormatParserStorage::put(std::ostream &output, std::string suffix) 305 252 { 306 253 if (suffix == ParserSuffixes[mpqc]) { 307 getMpqc().save(&output , atoms);254 getMpqc().save(&output); 308 255 } else if (suffix == ParserSuffixes[pcp]) { 309 getPcp().save(&output , atoms);256 getPcp().save(&output); 310 257 } else if (suffix == ParserSuffixes[pdb]) { 311 getPdb().save(&output , atoms);258 getPdb().save(&output); 312 259 } else if (suffix == ParserSuffixes[tremolo]) { 313 getTremolo().save(&output , atoms);260 getTremolo().save(&output); 314 261 } else if (suffix == ParserSuffixes[xyz]) { 315 getXyz().save(&output , atoms);262 getXyz().save(&output); 316 263 } else { 317 264 DoeLog(1) && (eLog() << Verbose(1) << "Unknown suffix " << suffix << " to for FormatParserStorage::put()." << endl); -
src/Parser/FormatParserStorage.hpp
r5d6f38 rdd97a9 20 20 #include <vector> 21 21 22 class atom;23 22 class FormatParser; 24 23 class MpqcParser; … … 46 45 bool add(ParserTypes type); 47 46 48 bool load(std::istream &input, std::string suffix); 49 bool save(std::ostream &output, std::string suffix, const std::vector<atom *> &atoms); 50 bool saveSelectedAtoms(std::ostream &output, std::string suffix); 51 bool saveSelectedMolecules(std::ostream &output, std::string suffix); 52 bool saveWorld(std::ostream &output, std::string suffix); 47 bool get(std::istream &input, std::string suffix); 48 bool put(std::ostream &output, std::string suffix); 53 49 MpqcParser &getMpqc(); 54 50 PcpParser &getPcp(); -
src/Parser/MpqcParser.cpp
r5d6f38 rdd97a9 53 53 } 54 54 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) 55 void MpqcParser::save(ostream *file) 62 56 { 63 57 DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl); 64 58 65 59 if (HessianPresent) 66 saveHessian(file , atoms);60 saveHessian(file); 67 61 else 68 saveSimple(file , atoms);62 saveSimple(file); 69 63 } 70 64 71 65 /** Saves all atoms and data into a MPQC config file without hessian. 72 66 * \param *file output stream 73 * \param atoms atoms to store74 67 */ 75 void MpqcParser::saveSimple(ostream *file , const std::vector<atom *> &atoms)68 void MpqcParser::saveSimple(ostream *file) 76 69 { 77 70 Vector center; … … 119 112 /** Saves all atoms and data into a MPQC config file with hessian. 120 113 * \param *file output stream 121 * \param atoms atoms to store122 114 */ 123 void MpqcParser::saveHessian(ostream *file , const std::vector<atom *> &atoms)115 void MpqcParser::saveHessian(ostream *file) 124 116 { 125 117 Vector center; -
src/Parser/MpqcParser.hpp
r5d6f38 rdd97a9 22 22 ~MpqcParser(); 23 23 void load(std::istream* file); 24 void save(std::ostream* file , const std::vector<atom *> &atoms);24 void save(std::ostream* file); 25 25 26 26 void setHessian(bool hessian); … … 30 30 bool HessianPresent; 31 31 32 void saveSimple(std::ostream *file , const std::vector<atom *> &atoms);33 void saveHessian(std::ostream *file , const std::vector<atom *> &atoms);32 void saveSimple(std::ostream *file); 33 void saveHessian(std::ostream *file); 34 34 }; 35 35 -
src/Parser/PcpParser.cpp
r5d6f38 rdd97a9 368 368 } 369 369 370 /** 371 * Saves the \a atoms into as a PCP file. 372 * 373 * \param file where to save the state 374 * \param atoms atoms to store 375 */ 376 void PcpParser::save(std::ostream* file, const std::vector<atom *> &atoms) 370 /** Saves the World into a PCP config file. 371 * \param *file output stream to save to 372 */ 373 void PcpParser::save(std::ostream* file) 377 374 { 378 375 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl); … … 382 379 if (!file->fail()) { 383 380 // calculate number of Psis 384 CalculateOrbitals(atoms); 381 vector<atom *> allatoms = World::getInstance().getAllAtoms(); 382 CalculateOrbitals(allatoms); 385 383 *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl; 386 384 *file << endl; … … 470 468 *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl; 471 469 map<int, int> ZtoIndexMap; 472 OutputElements(file, a toms, ZtoIndexMap);473 OutputAtoms(file, a toms, ZtoIndexMap);470 OutputElements(file, allatoms, ZtoIndexMap); 471 OutputAtoms(file, allatoms, ZtoIndexMap); 474 472 } else { 475 473 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl); … … 481 479 * \param &allatoms all atoms to store away 482 480 */ 483 void PcpParser::CalculateOrbitals( const std::vector<atom *> &allatoms)481 void PcpParser::CalculateOrbitals(vector<atom *> &allatoms) 484 482 { 485 483 PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0; 486 for (vector<atom *>:: const_iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {484 for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) { 487 485 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals(); 488 486 } … … 514 512 * \param &ZtoIndexMap map of which atoms belong to which ion number 515 513 */ 516 void PcpParser::OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)514 void PcpParser::OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap) 517 515 { 518 516 map<int, int> PresentElements; 519 517 pair < map<int, int>::iterator, bool > Inserter; 520 518 // insert all found elements into the map 521 for (vector<atom *>:: const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {519 for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) { 522 520 Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1)); 523 521 if (!Inserter.second) // increase if present … … 544 542 * \param &ZtoIndexMap map of which atoms belong to which ion number 545 543 */ 546 void PcpParser::OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)544 void PcpParser::OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap) 547 545 { 548 546 *file << "#Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon)" << endl; … … 550 548 pair < map<int, int>::iterator, bool > Inserter; 551 549 int nr = 0; 552 for (vector<atom *>:: const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {550 for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) { 553 551 Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1) ); 554 552 if (!Inserter.second) -
src/Parser/PcpParser.hpp
r5d6f38 rdd97a9 20 20 ~PcpParser(); 21 21 void load(std::istream* file); 22 void save(std::ostream* file , const std::vector<atom *> &atoms);22 void save(std::ostream* file); 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, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);30 void OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);31 void CalculateOrbitals( const std::vector<atom *> &allatoms);29 void OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap); 30 void OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap); 31 void CalculateOrbitals(vector<atom *> &allatoms); 32 32 33 33 class StructParallelization { -
src/Parser/PdbAtomInfoContainer.cpp
r5d6f38 rdd97a9 24 24 #include "Helpers/toString.hpp" 25 25 //#include "Helpers/Verbose.hpp" 26 #include "LinearAlgebra/Vector.hpp"27 26 #include "PdbAtomInfoContainer.hpp" 28 27 29 28 30 29 PdbAtomInfoContainer::PdbAtomInfoContainer() : 31 token("ATOM"),32 30 serial(0), 33 31 name("-"), 34 alt Loc('0'),32 altloc('0'), 35 33 resName("-"), 36 34 chainID('0'), … … 39 37 occupancy(0.), 40 38 tempFactor(0.), 41 element(""),42 39 charge(0) 43 40 {} … … 49 46 { 50 47 switch (key) { 51 case PdbKey::token :52 ScanKey(token, value);53 break;54 48 case PdbKey::serial : 55 49 ScanKey(serial, value); … … 58 52 ScanKey(name, value); 59 53 break; 60 case PdbKey::alt Loc :61 ScanKey(alt Loc, value);54 case PdbKey::altloc : 55 ScanKey(altloc, value); 62 56 break; 63 57 case PdbKey::resName : … … 73 67 ScanKey(iCode, value); 74 68 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;84 69 case PdbKey::occupancy : 85 70 ScanKey(occupancy, value); … … 87 72 case PdbKey::tempFactor : 88 73 ScanKey(tempFactor, value); 89 break;90 case PdbKey::element :91 ScanKey(element, value);92 74 break; 93 75 case PdbKey::charge : … … 100 82 } 101 83 102 template <> 103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const 84 std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const 104 85 { 105 86 switch (key) { 106 case PdbKey::token :107 return toString(token);108 87 case PdbKey::serial : 109 88 return toString(serial); 110 89 case PdbKey::name : 111 90 return toString(name); 112 case PdbKey::alt Loc :113 return toString(alt Loc);91 case PdbKey::altloc : 92 return toString(altloc); 114 93 case PdbKey::resName : 115 94 return toString(resName); … … 120 99 case PdbKey::iCode : 121 100 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]);128 101 case PdbKey::occupancy : 129 102 return toString(occupancy); 130 103 case PdbKey::tempFactor : 131 104 return toString(tempFactor); 132 case PdbKey::element :133 return toString(element);134 105 case PdbKey::charge : 135 106 return toString(charge); … … 140 111 } 141 112 142 template <>143 int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const144 {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) const160 {161 switch (key) {162 case PdbKey::X :163 return XYZ[0];164 case PdbKey::Y :165 return XYZ[1];166 case PdbKey::Z :167 return XYZ[2];168 case PdbKey::occupancy :169 return occupancy;170 case PdbKey::tempFactor :171 return tempFactor;172 default :173 std::cout << "Unknown key or not presentable as double: " << key << std::endl;174 return 0.;175 }176 } -
src/Parser/PdbAtomInfoContainer.hpp
r5d6f38 rdd97a9 11 11 #include "PdbKey.hpp" 12 12 13 class Vector;14 15 13 #include <string> 16 #include <typeinfo>17 14 18 15 /** … … 25 22 26 23 // getter and setter 27 template <class T> T get(const PdbKey::PdbDataKey key) const { 28 switch (key) { 29 default : 30 std::cout << "Unknown key or not representable as " << typeid(T).name() << ": " << key << std::endl; 31 break; 32 } 33 return (T)NULL; 34 } 24 std::string get(const PdbKey::PdbDataKey key) const; 35 25 void set(const PdbKey::PdbDataKey key, std::string value); 36 26 … … 56 46 57 47 private: 58 std::string token;59 48 int serial; 60 49 std::string name; 61 char alt Loc;50 char altloc; 62 51 std::string resName; 63 52 char chainID; 64 53 int resSeq; 65 54 char iCode; 66 Vector XYZ;67 55 float occupancy; 68 56 float tempFactor; 69 std::string element;70 57 int charge; 71 58 }; 72 59 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 80 60 #endif /* PDBATOMINFOCONTAINER_HPP_ */ -
src/Parser/PdbKey.hpp
r5d6f38 rdd97a9 18 18 enum PdbDataKey { 19 19 noKey, 20 token,21 20 serial, 22 21 name, 23 alt Loc,22 altloc, 24 23 resName, 25 24 chainID, 26 25 resSeq, 27 26 iCode, 28 X,29 Y,30 Z,31 27 occupancy, 32 28 tempFactor, 33 element,34 29 charge 35 30 }; -
src/Parser/PdbParser.cpp
r5d6f38 rdd97a9 46 46 PdbParser::PdbParser() { 47 47 knownTokens["ATOM"] = PdbKey::Atom; 48 knownTokens["HETATM"] = PdbKey::Atom;49 48 knownTokens["TER"] = PdbKey::Filler; 50 49 knownTokens["END"] = PdbKey::EndOfFile; … … 52 51 knownTokens["REMARK"] = PdbKey::Remark; 53 52 knownTokens[""] = PdbKey::EndOfFile; 54 55 // argh, why can't just PdbKey::X+(size_t)i56 PositionEnumMap[0] = PdbKey::X;57 PositionEnumMap[1] = PdbKey::Y;58 PositionEnumMap[2] = PdbKey::Z;59 53 } 60 54 … … 105 99 size_t linecount = 0; 106 100 enum PdbKey::KnownTokens token; 107 108 // reset atomIdMap for this file (to correctly parse CONECT entries)109 atomIdMap.clear();110 101 111 102 molecule *newmol = World::getInstance().createMolecule(); … … 145 136 146 137 /** 147 * Saves the \a atomsinto as a PDB file.138 * Saves the World's current state into as a PDB file. 148 139 * 149 140 * \param file where to save the state 150 * \param atoms atoms to store 151 */ 152 void PdbParser::save(ostream* file, const std::vector<atom *> &AtomList) 153 { 141 */ 142 void PdbParser::save(ostream* file) { 154 143 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl); 144 155 145 { 156 146 // add initial remark … … 167 157 } 168 158 169 // we distribute serials, hence clear map beforehand159 // we distribute new atom numbers, hence clear map beforehand 170 160 atomIdMap.clear(); 171 161 { 172 std::map<size_t,size_t> MolIdMap; 173 size_t MolNo = 1; // residue number starts at 1 in pdb 174 for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 175 const molecule *mol = (*atomIt)->getMolecule(); 176 if ((mol != NULL) && (MolIdMap.find(mol->getId()) == MolIdMap.end())) { 177 MolIdMap[mol->getId()] = MolNo++; 178 } 179 } 180 const size_t MaxMol = MolNo; 181 182 // have a count per element and per molecule (0 is for all homeless atoms) 183 std::vector<int> **elementNo = new std::vector<int>*[MaxMol]; 184 for (size_t i = 0; i < MaxMol; ++i) 185 elementNo[i] = new std::vector<int>(MAX_ELEMENTS,1); 162 vector<atom *> AtomList = World::getInstance().getAllAtoms(); 163 164 std::vector<int> elementNo(MAX_ELEMENTS,1); 186 165 char name[MAXSTRINGSIZE]; 187 std::string ResidueName;188 166 189 167 // write ATOMs 190 168 int AtomNo = 1; // serial number starts at 1 in pdb 191 for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 192 PdbAtomInfoContainer &atomInfo = getadditionalAtomData(*atomIt); 193 // gather info about residue 169 int MolNo = 1; // residue number starts at 1 in pdb 170 for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 171 const size_t Z = (*atomIt)->getType()->getAtomicNumber(); 172 sprintf(name, "%2s%02d",(*atomIt)->getType()->getSymbol().c_str(), elementNo[Z]); 173 elementNo[Z] = (elementNo[Z]+1) % 100; // confine to two digits 194 174 const molecule *mol = (*atomIt)->getMolecule(); 195 if (mol == NULL) { 196 MolNo = 0; 197 atomInfo.set(PdbKey::resSeq, "0"); 175 if (mol == NULL) { // for homeless atoms, MolNo = -1 is reserved 176 MolNo = -1; 198 177 } else { 199 ASSERT(MolIdMap.find(mol->getId()) != MolIdMap.end(), 200 "PdbParser::save() - Mol id "+toString(mol->getId())+" not present despite we set it?!"); 201 MolNo = MolIdMap[mol->getId()]; 202 atomInfo.set(PdbKey::resSeq, toString(MolIdMap[mol->getId()])); 203 if (atomInfo.get<std::string>(PdbKey::resName) == "-") 204 atomInfo.set(PdbKey::resName, mol->getName().substr(0,3)); 178 MolNo = mol->getId(); 205 179 } 206 // get info about atom 207 const size_t Z = (*atomIt)->getType()->getAtomicNumber(); 208 if (atomInfo.get<std::string>(PdbKey::name) == "-") { // if no name set, give it a new name 209 sprintf(name, "%2s%02d",(*atomIt)->getType()->getSymbol().c_str(), (*elementNo[MolNo])[Z]); 210 (*elementNo[MolNo])[Z] = ((*elementNo[MolNo])[Z]+1) % 100; // confine to two digits 211 atomInfo.set(PdbKey::name, name); 212 } 213 // set position 214 for (size_t i=0; i<NDIM;++i) { 215 stringstream position; 216 position << setw(8) << fixed << setprecision(3) << (*atomIt)->getPosition().at(i); 217 atomInfo.set(PositionEnumMap[i], position.str()); 218 } 219 // change element and charge if changed 220 if (atomInfo.get<std::string>(PdbKey::element) != (*atomIt)->getType()->getSymbol()) 221 atomInfo.set(PdbKey::element, (*atomIt)->getType()->getSymbol()); 222 setSerial((*atomIt)->getId(), AtomNo); 223 atomInfo.set(PdbKey::serial, toString(AtomNo)); 224 225 // finally save the line 226 saveLine(file, atomInfo); 180 saveLine(file, *atomIt, name, AtomNo, MolNo); 181 setAtomId((*atomIt)->getId(), AtomNo); 227 182 AtomNo++; 228 183 } 229 for (size_t i = 0; i < MaxMol; ++i)230 delete elementNo[i];231 delete elementNo;232 184 233 185 // write CONECTs 234 for (vector<atom *>:: const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {186 for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 235 187 writeNeighbors(file, 4, *atomIt); 236 188 } … … 241 193 } 242 194 243 /** Either returns reference to present entry or creates new with default values.244 *245 * @param _atom atom whose entry we desire246 * @return247 */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 father253 additionalAtomData[_atom->getId()] = additionalAtomData[_atom->father->getId()];254 } else if (additionalAtomData.find(_atom->GetTrueFather()->getId()) != additionalAtomData.end()) {255 // use info from topmost father256 additionalAtomData[_atom->getId()] = additionalAtomData[_atom->GetTrueFather()->getId()];257 } else {258 // create new entry use default values if nothing else is known259 additionalAtomData[_atom->getId()] = defaultAdditionalData;260 }261 return additionalAtomData[_atom->getId()];262 }263 264 195 /** 265 196 * Writes one line of PDB-formatted data to the provided stream. … … 267 198 * \param stream where to write the line to 268 199 * \param *currentAtom the atom of which information should be written 200 * \param *name name of atom, i.e. H01 269 201 * \param AtomNo serial number of atom 270 * \param *name name of atom, i.e. H01271 * \param ResidueName Name of molecule272 202 * \param ResidueNo number of residue 273 203 */ 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 */ 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"; 320 225 321 226 *file << endl; … … 335 240 if (MaxNo >= MaxnumberOfNeighbors) { 336 241 *file << "CONECT"; 337 *file << setw(5) << get Serial(currentAtom->getId());242 *file << setw(5) << getAtomId(currentAtom->getId()); 338 243 MaxNo = 0; 339 244 } 340 *file << setw(5) << get Serial((*currentBond)->GetOtherAtom(currentAtom)->getId());245 *file << setw(5) << getAtomId((*currentBond)->GetOtherAtom(currentAtom)->getId()); 341 246 MaxNo++; 342 247 if (MaxNo == MaxnumberOfNeighbors) … … 348 253 } 349 254 255 350 256 /** Retrieves a value from PdbParser::atomIdMap. 351 257 * \param atomid key … … 353 259 */ 354 260 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 key 272 * \return value 273 */ 274 size_t PdbParser::getAtomId(const size_t atomid) const 355 275 { 356 276 ASSERT(atomIdMap.find(atomid) != atomIdMap.end(), "PdbParser::getAtomId: atomid not present in Map."); … … 363 283 * \return true - key not present, false - value present 364 284 */ 365 void PdbParser::set Serial(const size_t localatomid, const size_t atomid)285 void PdbParser::setAtomId(const size_t localatomid, const size_t atomid) 366 286 { 367 287 pair<std::map<size_t,size_t>::iterator, bool > inserter; 368 //DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting ("369 //<< localatomid << " -> " << atomid << ")." << std::endl);288 DoLog(1) && (Log() << Verbose(1) << "PdbParser::setAtomId() - Inserting (" 289 << localatomid << " -> " << atomid << ")." << std::endl); 370 290 inserter = atomIdMap.insert( make_pair(localatomid, atomid) ); 371 291 ASSERT(inserter.second, "PdbParser::setAtomId: atomId already present in Map."); … … 387 307 stringstream lineStream; 388 308 atom* newAtom = World::getInstance().createAtom(); 389 PdbAtomInfoContainer &atomInfo = getadditionalAtomData(newAtom); 309 additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer); 310 PdbAtomInfoContainer &atomInfo = additionalAtomData[newAtom->getId()]; 390 311 string word; 391 312 ConvertTo<size_t> toSize_t; … … 393 314 394 315 lineStream << line; 395 atomInfo.set(PdbKey::token, line.substr(0,6));396 316 atomInfo.set(PdbKey::serial, line.substr(6,5)); 397 317 std::pair< std::set<size_t>::const_iterator, bool> Inserter = 398 SerialSet.insert(toSize_t(atomInfo.get <std::string>(PdbKey::serial)));318 SerialSet.insert(toSize_t(atomInfo.get(PdbKey::serial))); 399 319 ASSERT(Inserter.second, 400 320 "PdbParser::readAtomDataLine() - ATOM contains entry with serial " 401 +atomInfo.get <std::string>(PdbKey::serial)+" already present!");321 +atomInfo.get(PdbKey::serial)+" already present!"); 402 322 // assign hightest+1 instead, but then beware of CONECT entries! Another map needed! 403 323 // if (!Inserter.second) { … … 406 326 // atomInfo.set(PdbKey::serial, toString(id)); 407 327 // DoeLog(2) && (eLog() << Verbose(2) 408 // << "Serial " << atomInfo.get <std::string>(PdbKey::serial) << " already present, "328 // << "Serial " << atomInfo.get(PdbKey::serial) << " already present, " 409 329 // << "assigning " << toString(id) << " instead." << std::endl); 410 330 // } … … 428 348 // << line.substr(78,2) << std::endl); 429 349 430 set Serial(toSize_t(atomInfo.get<std::string>(PdbKey::serial)), newAtom->getId());350 setAtomId(toSize_t(atomInfo.get(PdbKey::serial)), newAtom->getId()); 431 351 atomInfo.set(PdbKey::name, line.substr(12,4)); 432 atomInfo.set(PdbKey::alt Loc, line.substr(16,1));352 atomInfo.set(PdbKey::altloc, line.substr(16,1)); 433 353 atomInfo.set(PdbKey::resName, line.substr(17,3)); 434 354 atomInfo.set(PdbKey::chainID, line.substr(21,1)); … … 444 364 atomInfo.set(PdbKey::tempFactor, line.substr(60,6)); 445 365 atomInfo.set(PdbKey::charge, line.substr(78,2)); 446 atomInfo.set(PdbKey::element, line.substr(76,2)); 447 const element *elem = World::getInstance().getPeriode() 448 ->FindElement(atomInfo.get<std::string>(PdbKey::element)); 449 ASSERT(elem != NULL, 450 "PdbParser::readAtomDataLine() - element "+atomInfo.get<std::string>(PdbKey::element)+" is unknown!"); 451 newAtom->setType(elem); 366 PdbAtomInfoContainer::ScanKey(word, line.substr(76,2)); 367 newAtom->setType(World::getInstance().getPeriode()->FindElement(word)); 452 368 453 369 if (newmol != NULL) … … 465 381 466 382 DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << std::endl); 467 DoLog(1) && (Log() << Verbose(1) << "\ttoken is " << atomInfo.get<std::string>(PdbKey::token) << std::endl); 468 DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get<int>(PdbKey::serial) << std::endl); 469 DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get<std::string>(PdbKey::name) << std::endl); 470 DoLog(1) && (Log() << Verbose(1) << "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc) << std::endl); 471 DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get<std::string>(PdbKey::resName) << std::endl); 472 DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID) << std::endl); 473 DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq) << std::endl); 474 DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode) << std::endl); 475 DoLog(1) && (Log() << Verbose(1) << "\tX is " << atomInfo.get<double>(PdbKey::X) << std::endl); 476 DoLog(1) && (Log() << Verbose(1) << "\tY is " << atomInfo.get<double>(PdbKey::Y) << std::endl); 477 DoLog(1) && (Log() << Verbose(1) << "\tZ is " << atomInfo.get<double>(PdbKey::Z) << std::endl); 478 DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy) << std::endl); 479 DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor) << std::endl); 383 DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get(PdbKey::serial) << std::endl); 384 DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get(PdbKey::name) << std::endl); 385 DoLog(1) && (Log() << Verbose(1) << "\taltloc is " << atomInfo.get(PdbKey::altloc) << std::endl); 386 DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get(PdbKey::resName) << std::endl); 387 DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get(PdbKey::chainID) << std::endl); 388 DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get(PdbKey::resSeq) << std::endl); 389 DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get(PdbKey::iCode) << std::endl); 390 DoLog(1) && (Log() << Verbose(1) << "\tx is " << newAtom->getPosition() << std::endl); 391 DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get(PdbKey::occupancy) << std::endl); 392 DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get(PdbKey::tempFactor) << std::endl); 480 393 DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl); 481 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get <int>(PdbKey::charge) << std::endl);394 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get(PdbKey::charge) << std::endl); 482 395 } 483 396 … … 513 426 514 427 // add neighbours 515 atom *_atom = World::getInstance().getAtom(AtomById(get Serial(id)));428 atom *_atom = World::getInstance().getAtom(AtomById(getAtomId(id))); 516 429 for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin(); 517 430 iter != ListOfNeighbors.end(); 518 431 ++iter) { 519 432 // DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl); 520 atom * const _Otheratom = World::getInstance().getAtom(AtomById(get Serial(*iter)));433 atom * const _Otheratom = World::getInstance().getAtom(AtomById(getAtomId(*iter))); 521 434 _atom->addBond(_Otheratom); 522 435 } … … 565 478 const PdbAtomInfoContainer &OtheratomInfo = b.additionalAtomData.at((*iter)->getId()); 566 479 567 status = status && (atomInfo.get <std::string>(PdbKey::serial) == OtheratomInfo.get<std::string>(PdbKey::serial));480 status = status && (atomInfo.get(PdbKey::serial) == OtheratomInfo.get(PdbKey::serial)); 568 481 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl); 569 status = status && (atomInfo.get <std::string>(PdbKey::name) == OtheratomInfo.get<std::string>(PdbKey::name));482 status = status && (atomInfo.get(PdbKey::name) == OtheratomInfo.get(PdbKey::name)); 570 483 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl); 571 status = status && (atomInfo.get <std::string>(PdbKey::altLoc) == OtheratomInfo.get<std::string>(PdbKey::altLoc));572 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in alt Locs!" << std::endl);573 status = status && (atomInfo.get <std::string>(PdbKey::resName) == OtheratomInfo.get<std::string>(PdbKey::resName));484 status = status && (atomInfo.get(PdbKey::altloc) == OtheratomInfo.get(PdbKey::altloc)); 485 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altlocs!" << std::endl); 486 status = status && (atomInfo.get(PdbKey::resName) == OtheratomInfo.get(PdbKey::resName)); 574 487 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl); 575 status = status && (atomInfo.get <std::string>(PdbKey::chainID) == OtheratomInfo.get<std::string>(PdbKey::chainID));488 status = status && (atomInfo.get(PdbKey::chainID) == OtheratomInfo.get(PdbKey::chainID)); 576 489 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl); 577 status = status && (atomInfo.get <std::string>(PdbKey::resSeq) == OtheratomInfo.get<std::string>(PdbKey::resSeq));490 status = status && (atomInfo.get(PdbKey::resSeq) == OtheratomInfo.get(PdbKey::resSeq)); 578 491 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl); 579 status = status && (atomInfo.get <std::string>(PdbKey::iCode) == OtheratomInfo.get<std::string>(PdbKey::iCode));492 status = status && (atomInfo.get(PdbKey::iCode) == OtheratomInfo.get(PdbKey::iCode)); 580 493 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl); 581 status = status && (atomInfo.get <std::string>(PdbKey::occupancy) == OtheratomInfo.get<std::string>(PdbKey::occupancy));494 status = status && (atomInfo.get(PdbKey::occupancy) == OtheratomInfo.get(PdbKey::occupancy)); 582 495 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl); 583 status = status && (atomInfo.get <std::string>(PdbKey::tempFactor) == OtheratomInfo.get<std::string>(PdbKey::tempFactor));496 status = status && (atomInfo.get(PdbKey::tempFactor) == OtheratomInfo.get(PdbKey::tempFactor)); 584 497 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl); 585 status = status && (atomInfo.get <std::string>(PdbKey::charge) == OtheratomInfo.get<std::string>(PdbKey::charge));498 status = status && (atomInfo.get(PdbKey::charge) == OtheratomInfo.get(PdbKey::charge)); 586 499 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl); 587 500 } -
src/Parser/PdbParser.hpp
r5d6f38 rdd97a9 23 23 ~PdbParser(); 24 24 void load(std::istream* file); 25 void save(std::ostream* file , const std::vector<atom *> &atoms);25 void save(std::ostream* file); 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 PdbAtomInfoContainer &atomInfo);40 void saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResdueNo); 41 41 42 42 // internal getter and setter 43 PdbAtomInfoContainer& getadditionalAtomData(atom *_atom);44 43 size_t getSerial(const size_t atomid) const; 45 void setSerial(const size_t localatomid, const size_t atomid); 46 47 /** 48 * argh, why can't just PdbKey::X+(size_t)i 49 */ 50 std::map<size_t, PdbKey::PdbDataKey> PositionEnumMap; 44 size_t getAtomId(const size_t atomid) const; 45 void setAtomId(const size_t localatomid, const size_t atomid); 51 46 52 47 /** -
src/Parser/TremoloAtomInfoContainer.cpp
r5d6f38 rdd97a9 42 42 GrpTypeNo("0"), 43 43 torsion("-"), 44 neighbors(std::vector<int>(0, 5)), 45 neighbors_processed(false) 44 neighbors(std::vector<int>(0, 5)) 46 45 {} 47 46 -
src/Parser/TremoloAtomInfoContainer.hpp
r5d6f38 rdd97a9 39 39 std::string torsion; 40 40 std::vector<int> neighbors; 41 bool neighbors_processed;42 41 }; 43 42 -
src/Parser/TremoloParser.cpp
r5d6f38 rdd97a9 90 90 string::size_type location; 91 91 92 // reset atomIdMap, for we now get new serials93 atomIdMap.clear();94 92 usedFields.clear(); 95 96 93 molecule *newmol = World::getInstance().createMolecule(); 97 94 newmol->ActiveFlag = true; … … 117 114 118 115 /** 119 * Saves the \a atomsinto as a tremolo file.116 * Saves the World's current state into as a tremolo file. 120 117 * 121 118 * \param file where to save the state 122 * \param atoms atoms to store 123 */ 124 void TremoloParser::save(ostream* file, const std::vector<atom *> &AtomList) { 119 */ 120 void TremoloParser::save(ostream* file) { 125 121 DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl); 126 122 127 vector<atom*>:: const_iterator atomIt;123 vector<atom*>::iterator atomIt; 128 124 vector<string>::iterator it; 129 125 … … 133 129 } 134 130 *file << endl; 131 vector<atom *> AtomList = World::getInstance().getAllAtoms(); 135 132 for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) { 136 133 saveLine(file, *atomIt); … … 223 220 ? (*currentBond)->GetOtherAtom(currentAtom)->getId()+1 : 0) << "\t"; 224 221 if (currentBond != currentAtom->ListOfBonds.end()) 225 ++currentBond;222 currentBond++; 226 223 } 227 224 } … … 262 259 atom* newAtom = World::getInstance().createAtom(); 263 260 TremoloAtomInfoContainer *atomInfo = NULL; 264 additionalAtomData[newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values261 additionalAtomData[newAtom->getId()] = *(new TremoloAtomInfoContainer); 265 262 atomInfo = &additionalAtomData[newAtom->getId()]; 266 263 TremoloKey::atomDataKey currentField; … … 313 310 * Reads neighbor information for one atom from the input. 314 311 * 315 * \param linestream where to read the information from316 * \param number OfNeighbors numberof neighbors to read317 * \param atomidworld id of the atom the information belongs to312 * \param stream where to read the information from 313 * \param number of neighbors to read 314 * \param world id of the atom the information belongs to 318 315 */ 319 316 void TremoloParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) { … … 323 320 // 0 is used to fill empty neighbor positions in the tremolo file. 324 321 if (neighborId > 0) { 325 // std::cout << "Atom with global id " << atomId << " has neighbour with serial " << neighborId << std::endl;326 322 additionalAtomData[atomId].neighbors.push_back(neighborId); 327 323 } … … 360 356 currentInfo != additionalAtomData.end(); currentInfo++ 361 357 ) { 362 if (!currentInfo->second.neighbors_processed) { 363 for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin(); 364 neighbor != currentInfo->second.neighbors.end(); neighbor++ 365 ) { 366 // std::cout << "Creating bond between (" 367 // << currentInfo->first 368 // << ") and (" 369 // << atomIdMap[*neighbor] << "|" << *neighbor << ")" << std::endl; 370 World::getInstance().getAtom(AtomById(currentInfo->first)) 371 ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor]))); 372 } 373 currentInfo->second.neighbors_processed = true; 358 for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin(); 359 neighbor != currentInfo->second.neighbors.end(); neighbor++ 360 ) { 361 World::getInstance().getAtom(AtomById(currentInfo->first)) 362 ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor]))); 374 363 } 375 364 } -
src/Parser/TremoloParser.hpp
r5d6f38 rdd97a9 26 26 ~TremoloParser(); 27 27 void load(std::istream* file); 28 void save(std::ostream* file , const std::vector<atom *> &atoms);28 void save(std::ostream* file); 29 29 void setFieldsForSave(std::string atomDataLine); 30 30 -
src/Parser/XyzParser.cpp
r5d6f38 rdd97a9 78 78 79 79 /** 80 * Saves the \a atoms into as aXYZ file.80 * Saves the current state of the World into the given XYZ file. 81 81 * 82 * \param file where to save the state 83 * \param atoms atoms to store 82 * \param XYZ file 84 83 */ 85 void XyzParser::save(ostream* file , const std::vector<atom *> &atoms) {84 void XyzParser::save(ostream* file) { 86 85 DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl); 87 86 //if (comment == "") { … … 96 95 comment += time; 97 96 //} 98 *file << atoms.size() << endl << "\t" << comment << endl;97 *file << World::getInstance().numAtoms() << endl << "\t" << comment << endl; 99 98 100 for(vector<atom*>::const_iterator it = atoms.begin(); it != atoms.end(); it++) { 99 vector<atom*> atoms = World::getInstance().getAllAtoms(); 100 for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) { 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
r5d6f38 rdd97a9 20 20 ~XyzParser(); 21 21 void load(std::istream* file); 22 void save(std::ostream* file , const std::vector<atom *> &atoms);22 void save(std::ostream* file); 23 23 24 24 private: -
src/Patterns/Singleton_impl.hpp
r5d6f38 rdd97a9 9 9 #define SINGLETON_IMPL_HPP_ 10 10 11 #include "Helpers/Assert.hpp"12 11 #include "Patterns/Singleton.hpp" 13 12 -
src/ThermoStatContainer.cpp
r5d6f38 rdd97a9 54 54 ThermostatTraits<Thermostat> *WoodcockTrait = new ThermostatTraits<Woodcock>(); 55 55 availThermostats[WoodcockTrait->getName()] = WoodcockTrait; 56 57 // for debugging: list all thermostats 58 // cout << "List of known thermostats: "; 59 // for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){ 60 // cout << iter->first << " "; 61 // } 62 // cout << endl; 63 56 for(traitsMap::iterator iter = availThermostats.begin();iter!=availThermostats.end();++iter){ 57 cout << iter->first << endl; 58 } 64 59 ASSERT(availThermostats.size()==6,"Not all implemented thermostats referenced!\nDid you check the names in the traits?"); 65 60 activeThermostat=new Berendsen(); -
src/UIElements/CommandLineUI/CommandLineParser.cpp
r5d6f38 rdd97a9 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);372 371 // go through all arguments 373 372 for (int i=1;i<argc;i++) { 374 DoLog(2) && (Log() << Verbose(2) << "Checking on " << argv[i] << std::endl);373 (std::cout << Verbose(1) << "Checking on " << argv[i] << std::endl); 375 374 // check whether they 376 375 if (argv[i][0] == '-') { // .. begin with - 377 DoLog(2) && (Log() << Verbose(2) << "Possible argument: " << argv[i] << endl);376 (cout << Verbose(1) << "Possible argument: " << argv[i] << endl); 378 377 if (argv[i][1] == '-') { // .. or -- 379 DoLog(1) && (Log()<< Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);378 (cout << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl); 380 379 SequenceOfActions.push_back(&(argv[i][2])); 381 380 // .. and check that next letter is not numeric, if so insert … … 383 382 std::map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1])); 384 383 if (iter != ShortFormToActionMap.end()) { 385 DoLog(1) && (Log()<< Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);384 (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl); 386 385 SequenceOfActions.push_back(iter->second); 387 386 } … … 405 404 * \return map from Action's ShortForm to token. 406 405 */ 407 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() const406 std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap() 408 407 { 409 408 std::map <std::string, std::string> result; -
src/UIElements/CommandLineUI/CommandLineParser.hpp
r5d6f38 rdd97a9 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() const;145 std::map <std::string, std::string> getShortFormToActionMap(); 146 146 147 147 // lookup list from "configmenus" to the ones of CommandLineParser -
src/UIElements/CommandLineUI/CommandLineWindow.cpp
r5d6f38 rdd97a9 25 25 #include "CommandLineUI/CommandLineStatusIndicator.hpp" 26 26 27 #include "Helpers/Log.hpp"28 #include "Helpers/Verbose.hpp"29 30 27 #include "Actions/Action.hpp" 31 28 #include "Actions/ActionRegistry.hpp" … … 53 50 54 51 // go through all possible actions 55 DoLog(0) && (Log() << Verbose(0) << "Calling Actions ... " << std::endl);56 52 for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) { 53 cout << "Checking presence of " << *CommandRunner << ": "; 57 54 if (ActionRegistry::getInstance().isActionPresentByName(*CommandRunner)) { 58 DoLog(1) && (Log() << Verbose(1) 59 << "Checking presence of " << *CommandRunner << ": " 60 << "calling " << *CommandRunner << endl); 55 cout << "calling " << *CommandRunner << endl; 61 56 ActionRegistry::getInstance().getActionByName(*CommandRunner)->call(); 62 57 } else { 63 DoLog(1) && (Log() << Verbose(1) 64 << "Checking presence of " << *CommandRunner << ": " 65 << "absent." << endl); 58 cout << "absent." << endl; 66 59 } 67 60 } -
src/UIElements/CommandLineUI/TypeEnumContainer.cpp
r5d6f38 rdd97a9 64 64 TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType; 65 65 66 // for debugging: list all stored types 67 //ListAllKnownTypes(); 66 ListAllKnownTypes(); 68 67 }; 69 68 … … 84 83 std::cout << " Known type is " << (iter->first)->name() << " or enum " << iter->second << std::endl; 85 84 } 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; 86 88 } 87 89 … … 92 94 enum TypeEnumContainer::EnumOfTypes TypeEnumContainer::getEnumforType(const std::type_info *_type) 93 95 { 94 //std::cout << "Looking for type " << _type->name() << std::endl;96 std::cout << "Looking for type " << _type->name() << std::endl; 95 97 ASSERT(TypeEnumMap.find(_type) != TypeEnumMap.end(), 96 98 "CommandLineParser::getEnumforType() - cannot find the type as enum!."); -
src/UIElements/Menu/Menu.cpp
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 73 73 #endif 74 74 75 #include "builder_init.hpp" 75 #include "Helpers/MemDebug.hpp" 76 77 #include "bondgraph.hpp" 78 #include "config.hpp" 79 #include "Helpers/Log.hpp" 80 #include "molecule.hpp" 81 #include "periodentafel.hpp" 82 #include "tesselationhelpers.hpp" 83 #include "UIElements/UIFactory.hpp" 84 #include "UIElements/Menu/MenuDescription.hpp" 85 #include "UIElements/TextUI/TextUIFactory.hpp" 86 #include "UIElements/CommandLineUI/CommandLineUIFactory.hpp" 87 #include "UIElements/CommandLineUI/CommandLineParser.hpp" 88 #ifdef USE_GUI_QT 89 #include "UIElements/Qt4/QtUIFactory.hpp" 90 #endif 91 #include "UIElements/MainWindow.hpp" 92 #include "UIElements/Dialog.hpp" 93 //#include "Menu/ActionMenuItem.hpp" 94 #include "Helpers/Verbose.hpp" 95 #include "World.hpp" 96 97 #include "Actions/ActionRegistry.hpp" 98 #include "Actions/ActionHistory.hpp" 99 100 #include "Parser/ChangeTracker.hpp" 101 #include "Parser/FormatParserStorage.hpp" 102 103 #include "UIElements/UIFactory.hpp" 104 #include "UIElements/TextUI/TextUIFactory.hpp" 105 #include "UIElements/CommandLineUI/CommandLineUIFactory.hpp" 106 #include "UIElements/MainWindow.hpp" 107 #include "UIElements/Dialog.hpp" 108 109 #include "version.h" 110 76 111 77 112 /********************************************** Main routine **************************************/ 113 114 /** In this function all dynamicly allocated member variables to static/global 115 * variables are added to the ignore list of Memory/MemDebug. 116 * 117 * Use this to prevent their listing in the Memory::getState() at the end of the 118 * program. Check with valgrind that truely no memory leak occurs! 119 */ 120 void AddStaticEntitiestoIgnoreList() 121 { 122 // zeroVec and unitVec are global variables (on the stack) but vectorContent 123 // within is situated on the heap and has to be ignored 124 Memory::ignore(zeroVec.get()); 125 Memory::ignore(unitVec[0].get()); 126 Memory::ignore(unitVec[1].get()); 127 Memory::ignore(unitVec[2].get()); 128 } 129 130 /** Cleans all singleton instances in an orderly fashion. 131 * C++ does not guarantee any specific sequence of removal of single instances 132 * which have static/global variables. Some singletons depend on others hence we 133 * acertain a specific ordering here, which is is used via the atexit() hook. 134 */ 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 present 147 Action::removeStaticStateEntities(); 148 // put some static variables' dynamic contents on the Memory::ignore map to avoid their 149 // admonishing lateron 150 AddStaticEntitiestoIgnoreList(); 151 logger::purgeInstance(); 152 errorLogger::purgeInstance(); 153 #ifdef LOG_OBSERVER 154 cout << observerLog().getLog(); 155 #endif 156 Memory::getState(); 157 } 158 159 void dumpMemory(){ 160 ofstream ost("molecuilder.memdump"); 161 Memory::dumpMemory(ost); 162 } 78 163 79 164 int main(int argc, char **argv) 80 165 { 81 initGeneral(); 82 83 initUI(argc,argv); 84 85 doUI(); 86 87 return saveAll(); 166 // while we are non interactive, we want to abort from asserts 167 ASSERT_DO(Assert::Abort); 168 ASSERT_HOOK(dumpMemory); 169 string line; 170 char **Arguments = NULL; 171 int ArgcSize = 0; 172 int ExitFlag = 0; 173 bool ArgumentsCopied = false; 174 std::string BondGraphFileName("\n"); 175 176 // print version check and copyright notice 177 cout << MOLECUILDERVERSION << endl; 178 cout << "MoleCuilder comes with ABSOLUTELY NO WARRANTY; for details type" << endl; 179 cout << "`molecuilder --warranty'." << endl; 180 cout << "`MoleCuilder - to create and alter molecular systems." << endl; 181 cout << "Copyright (C) 2010 University Bonn. All rights reserved." << endl; 182 183 setVerbosity(0); 184 // need to init the history before any action is created 185 ActionHistory::init(); 186 187 // from this moment on, we need to be sure to deeinitialize in the correct order 188 // this is handled by the cleanup function 189 atexit(cleanUp); 190 191 // Parse command line options and if present create respective UI 192 { 193 // construct bond graph 194 if (World::getInstance().getConfig()->BG == NULL) { 195 World::getInstance().getConfig()->BG = new BondGraph(World::getInstance().getConfig()->GetIsAngstroem()); 196 if (World::getInstance().getConfig()->BG->LoadBondLengthTable(BondGraphFileName)) { 197 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 198 } else { 199 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 200 } 201 } 202 // handle remaining arguments by CommandLineParser 203 if (argc>1) { 204 CommandLineParser::getInstance().InitializeCommandArguments(); 205 CommandLineParser::getInstance().Run(argc,argv); 206 DoLog(0) && (Log() << Verbose(0) << "Setting UI to CommandLine." << endl); 207 UIFactory::registerFactory(new CommandLineUIFactory::description()); 208 UIFactory::makeUserInterface("CommandLine"); 209 } else { 210 // In the interactive mode, we can leave the user the choice in case of error 211 ASSERT_DO(Assert::Ask); 212 #ifdef USE_GUI_QT 213 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Qt4." << endl); 214 UIFactory::registerFactory(new QtUIFactory::description()); 215 UIFactory::makeUserInterface("Qt4"); 216 #else 217 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl); 218 cout << MOLECUILDERVERSION << endl; 219 UIFactory::registerFactory(new TextUIFactory::description()); 220 UIFactory::makeUserInterface("Text"); 221 #endif 222 } 223 } 224 225 { 226 MainWindow *mainWindow = UIFactory::getInstance().makeMainWindow(); 227 mainWindow->display(); 228 delete mainWindow; 229 } 230 231 FormatParserStorage::getInstance().SaveAll(); 232 ChangeTracker::getInstance().saveStatus(); 233 234 // free the new argv 235 if (ArgumentsCopied) { 236 for (int i=0; i<ArgcSize;i++) 237 delete[](Arguments[i]); 238 delete[](Arguments); 239 } 240 //delete[](ConfigFileName); 241 242 ExitFlag = World::getInstance().getExitFlag(); 243 return (ExitFlag == 1 ? 0 : ExitFlag); 88 244 } 89 245 -
src/molecule_dynamics.cpp
r5d6f38 rdd97a9 484 484 atoms.end(), 485 485 boost::bind(&atom::EvaluateConstrainedForce,_1,startstep,endstep,PermutationMap,Force)); 486 //ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force ); 486 487 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 487 488 }; … … 616 617 // and perform Verlet integration for each atom with position, velocity and force vector 617 618 // check size of vectors 619 //ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 ); 618 620 for_each(atoms.begin(), 619 621 atoms.end(), -
src/periodentafel.cpp
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 13 13 #include <string> 14 14 15 #include "unittests/ PeriodentafelUnitTest.hpp"15 #include "unittests/periodentafelTest.hpp" 16 16 #include "Helpers/defs.hpp" 17 17 #include "types.hpp" -
src/tesselationhelpers.cpp
r5d6f38 rdd97a9 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
r5d6f38 rdd97a9 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisCorrelationToPointUnitTest.hpp" 29 30 30 31 #include "Descriptors/MoleculeDescriptor.hpp" … … 36 37 #include "periodentafel.hpp" 37 38 #include "World.hpp" 38 39 #include "AnalysisCorrelationToPointUnitTest.hpp"40 39 41 40 #ifdef HAVE_TESTRUNNER -
src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
r5d6f38 rdd97a9 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisCorrelationToSurfaceUnitTest.hpp" 30 29 31 #include "Descriptors/MoleculeDescriptor.hpp" 30 32 … … 39 41 #include "Helpers/Assert.hpp" 40 42 41 #include " AnalysisCorrelationToSurfaceUnitTest.hpp"43 #include "Helpers/Assert.hpp" 42 44 43 45 #ifdef HAVE_TESTRUNNER -
src/unittests/AnalysisPairCorrelationUnitTest.cpp
r5d6f38 rdd97a9 27 27 28 28 #include "analysis_correlation.hpp" 29 #include "AnalysisPairCorrelationUnitTest.hpp" 30 29 31 #include "Descriptors/MoleculeDescriptor.hpp" 30 32 … … 38 40 #include "tesselation.hpp" 39 41 #include "World.hpp" 40 41 #include "AnalysisPairCorrelationUnitTest.hpp"42 42 43 43 #ifdef HAVE_TESTRUNNER -
src/unittests/CountBondsUnitTest.cpp
r5d6f38 rdd97a9 38 38 #include "periodentafel.hpp" 39 39 #include "World.hpp" 40 41 40 #include "CountBondsUnitTest.hpp" 42 41 -
src/unittests/LinkedCellUnitTest.cpp
r5d6f38 rdd97a9 33 33 #include "molecule.hpp" 34 34 #include "periodentafel.hpp" 35 #include "LinkedCellUnitTest.hpp" 35 36 #include "World.hpp" 36 37 #include "LinkedCellUnitTest.hpp"38 37 39 38 #ifdef HAVE_TESTRUNNER -
src/unittests/Makefile.am
r5d6f38 rdd97a9 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/unittests12 3 13 4 INCLUDES = -I$(top_srcdir)/src … … 18 9 19 10 TESTS = \ 20 AnalysisBondsUnitTest \ 11 ActionSequenceTest \ 12 ActOnAllUnitTest \ 13 AnalysisBondsUnitTests \ 21 14 AnalysisCorrelationToPointUnitTest \ 22 15 AnalysisCorrelationToSurfaceUnitTest \ 23 16 AnalysisPairCorrelationUnitTest \ 17 atomsCalculationTest \ 18 AtomDescriptorTest \ 24 19 BondGraphUnitTest \ 25 BoxUnitTest \ 20 BoxUnittest \ 21 CacheableTest \ 26 22 CountBondsUnitTest \ 27 23 FormulaUnittest \ 24 InfoUnitTest \ 25 LinearSystemOfEquationsUnitTest \ 26 LineUnittest \ 28 27 LinkedCellUnitTest \ 29 28 ListOfBondsUnitTest \ 30 PeriodentafelUnitTest \ 29 LogUnitTest \ 30 manipulateAtomsTest \ 31 MatrixContentSymmetricUnitTest \ 32 MatrixContentUnitTest \ 33 MatrixUnittest \ 34 MenuDescriptionUnitTest \ 35 MoleculeDescriptorTest \ 36 ObserverTest \ 37 ParserCommonUnitTest \ 38 ParserTremoloUnitTest \ 39 periodentafelTest \ 40 PlaneUnittest \ 41 Registry \ 42 ShapeUnittest \ 43 SingletonTest \ 31 44 SubspaceFactorizerUnitTest \ 32 45 TesselationUnitTest \ 33 46 Tesselation_BoundaryTriangleUnitTest \ 34 Tesselation_InOutsideUnitTest 47 Tesselation_InOutsideUnitTest \ 48 VectorContentUnitTest \ 49 VectorUnitTest 35 50 36 51 … … 55 70 56 71 TESTSOURCES = \ 57 ../Actions/unittests/ActionRegistryUnitTest.cpp \58 ../Actions/unittests/ActionSequenceUnitTest.cpp \59 AnalysisBondsUnitTest.cpp \72 ActOnAllUnitTest.cpp \ 73 ActionSequenceTest.cpp \ 74 analysisbondsunittest.cpp \ 60 75 AnalysisCorrelationToPointUnitTest.cpp \ 61 76 AnalysisCorrelationToSurfaceUnitTest.cpp \ 62 77 AnalysisPairCorrelationUnitTest.cpp \ 63 ../Descriptors/unittests/AtomDescriptorUnitTest.cpp \64 ../Actions/unittests/AtomsCalculationUnitTest.cpp \65 BondGraphUnitTest.cpp \66 BoxUnit Test.cpp \67 ../Patterns/unittests/CacheableUnitTest.cpp \78 AtomDescriptorTest.cpp \ 79 atomsCalculationTest.cpp \ 80 bondgraphunittest.cpp \ 81 BoxUnittest.cpp \ 82 CacheableTest.cpp \ 68 83 CountBondsUnitTest.cpp \ 69 FormulaUnit Test.cpp \70 ../Helpers/unittests/InfoUnitTest.cpp \71 ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.cpp \72 ../LinearAlgebra/unittests/LineUnitTest.cpp \84 FormulaUnittest.cpp \ 85 infounittest.cpp \ 86 linearsystemofequationsunittest.cpp \ 87 LineUnittest.cpp \ 73 88 LinkedCellUnitTest.cpp \ 74 ListOfBondsUnitTest.cpp \75 ../Helpers/unittests/LogUnitTest.cpp \76 ../Actions/unittests/ManipulateAtomsUnitTest.cpp \77 ../LinearAlgebra/unittests/MatrixContentSymmetricUnitTest.cpp \78 ../LinearAlgebra/unittests/MatrixContentUnitTest.cpp \79 ../LinearAlgebra/unittests/MatrixUnitTest.cpp \80 ../UIElements/Menu/unittests/MenuDescriptionUnitTest.cpp \81 ../Descriptors/unittests/MoleculeDescriptorUnitTest.cpp \82 ../Patterns/unittests/ObserverUnitTest.cpp \83 ../Parser/unittests/ParserCommonUnitTest.cpp \84 ../Parser/unittests/ParserTremoloUnitTest.cpp \85 PeriodentafelUnitTest.cpp \86 ../LinearAlgebra/unittests/PlaneUnitTest.cpp \87 ../Patterns/unittests/RegistryUnitTest.cpp \88 ../Shapes/unittests/ShapeUnitTest.cpp \89 ../Patterns/unittests/SingletonUnitTest.cpp \90 TesselationUnitTest.cpp \91 Tesselation_BoundaryTriangleUnitTest.cpp \92 Tesselation_InsideOutsideUnitTest.cpp \93 ../LinearAlgebra/unittests/VectorContentUnitTest.cpp \94 ../LinearAlgebra/unittests/VectorUnitTest.cpp89 listofbondsunittest.cpp \ 90 logunittest.cpp \ 91 MatrixContentSymmetricUnittest.cpp \ 92 MatrixContentUnittest.cpp \ 93 MatrixUnittest.cpp \ 94 manipulateAtomsTest.cpp \ 95 MenuDescriptionUnitTest.cpp \ 96 MoleculeDescriptorTest.cpp \ 97 ObserverTest.cpp \ 98 ParserCommonUnitTest.cpp \ 99 ParserTremoloUnitTest.cpp \ 100 periodentafelTest.cpp \ 101 PlaneUnittest.cpp \ 102 RegistryUnitTest.cpp \ 103 ShapeUnittest.cpp \ 104 SingletonTest.cpp \ 105 tesselationunittest.cpp \ 106 tesselation_boundarytriangleunittest.cpp \ 107 tesselation_insideoutsideunittest.cpp \ 108 VectorContentUnittest.cpp \ 109 vectorunittest.cpp 95 110 96 111 TESTHEADERS = \ 97 ../Actions/unittests/ActionRegistryUnitTest.hpp \98 ../Actions/unittests/ActionSequenceUnitTest.hpp \99 AnalysisBondsUnitTest.hpp \112 ActOnAllUnitTest.hpp \ 113 ActionSequenceTest.hpp \ 114 analysisbondsunittest.hpp \ 100 115 AnalysisCorrelationToPointUnitTest.hpp \ 101 116 AnalysisCorrelationToSurfaceUnitTest.hpp \ 102 117 AnalysisPairCorrelationUnitTest.hpp \ 103 ../Descriptors/unittests/AtomDescriptorUnitTest.hpp \104 ../Actions/unittests/AtomsCalculationUnitTest.hpp \105 BondGraphUnitTest.hpp \106 BoxUnit Test.hpp \107 ../Patterns/unittests/CacheableUnitTest.hpp \118 AtomDescriptorTest.hpp \ 119 atomsCalculationTest.hpp \ 120 bondgraphunittest.hpp \ 121 BoxUnittest.hpp \ 122 CacheableTest.hpp \ 108 123 CountBondsUnitTest.hpp \ 109 FormulaUnit Test.hpp \110 ../Helpers/unittests/InfoUnitTest.hpp \111 ../LinearAlgebra/unittests/LinearSystemOfEquationsUnitTest.hpp \112 ../LinearAlgebra/unittests/LineUnitTest.hpp \124 FormulaUnittest.hpp \ 125 infounittest.hpp \ 126 linearsystemofequationsunittest.hpp \ 127 LineUnittest.hpp \ 113 128 LinkedCellUnitTest.hpp \ 114 ListOfBondsUnitTest.hpp \ 115 ../Helpers/unittests/LogUnitTest.hpp \ 116 ../Actions/unittests/ManipulateAtomsUnitTest.hpp \ 117 ../LinearAlgebra/unittests/MatrixContentSymmetricUnitTest.hpp \ 118 ../LinearAlgebra/unittests/MatrixContentUnitTest.hpp \ 119 ../LinearAlgebra/unittests/MatrixUnitTest.hpp \ 120 ../UIElements/Menu/unittests/MenuDescriptionUnitTest.hpp \ 121 ../Descriptors/unittests/MoleculeDescriptorUnitTest.hpp \ 122 ../Patterns/unittests/ObserverUnitTest.hpp \ 123 ../Parser/unittests/ParserCommonUnitTest.hpp \ 124 ../Parser/unittests/ParserTremoloUnitTest.hpp \ 125 PeriodentafelUnitTest.hpp \ 126 ../LinearAlgebra/unittests/PlaneUnitTest.hpp \ 127 ../Patterns/unittests/RegistryUnitTest.hpp \ 128 ../Shapes/unittests/ShapeUnitTest.hpp \ 129 ../Patterns/unittests/SingletonUnitTest.hpp \ 130 TesselationUnitTest.hpp \ 131 Tesselation_BoundaryTriangleUnitTest.hpp \ 132 Tesselation_InsideOutsideUnitTest.hpp \ 133 ../LinearAlgebra/unittests/VectorContentUnitTest.hpp \ 134 ../LinearAlgebra/unittests/VectorUnitTest.hpp 129 listofbondsunittest.hpp \ 130 logunittest.hpp \ 131 manipulateAtomsTest.hpp \ 132 MatrixContentSymmetricUnittest.hpp \ 133 MatrixContentUnittest.hpp \ 134 MatrixUnittest.hpp \ 135 MenuDescriptionUnitTest.hpp \ 136 MoleculeDescriptorTest.hpp \ 137 ObserverTest.hpp \ 138 periodentafelTest.hpp \ 139 ParserCommonUnitTest.hpp \ 140 ParserTremoloUnitTest.hpp \ 141 PlaneUnittest.hpp \ 142 RegistryUnitTest.hpp \ 143 SingletonTest.hpp \ 144 tesselationunittest.hpp \ 145 tesselation_boundarytriangleunittest.hpp \ 146 tesselation_insideoutsideunittest.hpp \ 147 VectorContentUnittest.hpp \ 148 vectorunittest.hpp 135 149 136 150 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 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 146 161 AnalysisCorrelationToPointUnitTest_LDADD = ${ALLLIBS} 147 162 148 AnalysisCorrelationToSurfaceUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 149 analysis_correlation.hpp \ 150 AnalysisCorrelationToSurfaceUnitTest.cpp \ 151 AnalysisCorrelationToSurfaceUnitTest.hpp 163 AnalysisCorrelationToSurfaceUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp 152 164 AnalysisCorrelationToSurfaceUnitTest_LDADD = ${ALLLIBS} 153 165 154 AnalysisPairCorrelationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 155 analysis_correlation.hpp \ 156 AnalysisPairCorrelationUnitTest.cpp \ 157 AnalysisPairCorrelationUnitTest.hpp 166 AnalysisPairCorrelationUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp 158 167 AnalysisPairCorrelationUnitTest_LDADD = ${ALLLIBS} 159 168 160 BondGraphUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 161 BondGraphUnitTest.cpp \ 162 BondGraphUnitTest.hpp 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 163 176 BondGraphUnitTest_LDADD = ${ALLLIBS} 164 177 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 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 173 185 CountBondsUnitTest_LDADD = ${ALLLIBS} 174 186 175 FormulaUnittest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 176 FormulaUnitTest.cpp \ 177 FormulaUnitTest.hpp 187 FormulaUnittest_SOURCES = UnitTestMain.cpp FormulaUnittest.cpp FormulaUnittest.hpp 178 188 FormulaUnittest_LDADD = ${ALLLIBS} 179 189 180 LinkedCellUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 181 LinkedCellUnitTest.cpp \ 182 LinkedCellUnitTest.hpp 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 183 206 LinkedCellUnitTest_LDADD = ${ALLLIBS} 184 207 185 ListOfBondsUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 186 ListOfBondsUnitTest.cpp \ 187 ListOfBondsUnitTest.hpp 208 ListOfBondsUnitTest_SOURCES = UnitTestMain.cpp listofbondsunittest.cpp listofbondsunittest.hpp 188 209 ListOfBondsUnitTest_LDADD = ${ALLLIBS} 189 210 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 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 198 251 SubspaceFactorizerUnitTest_LDADD = ${GSLLIBS} 199 252 200 TesselationUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 201 TesselationUnitTest.cpp \ 202 TesselationUnitTest.hpp 253 TesselationUnitTest_SOURCES = UnitTestMain.cpp tesselationunittest.cpp tesselationunittest.hpp 203 254 TesselationUnitTest_LDADD = ${ALLLIBS} 204 255 205 Tesselation_BoundaryTriangleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 206 Tesselation_BoundaryTriangleUnitTest.cpp \ 207 Tesselation_BoundaryTriangleUnitTest.hpp 256 Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp 208 257 Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS} 209 258 210 Tesselation_InOutsideUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \ 211 Tesselation_InsideOutsideUnitTest.cpp \ 212 Tesselation_InsideOutsideUnitTest.hpp 259 Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp 213 260 Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS} 214 261 … … 216 263 TestRunner_LDADD = ${UILIBS} ${ALLLIBS} 217 264 265 VectorContentUnitTest_SOURCES = UnitTestMain.cpp VectorContentUnittest.cpp VectorContentUnittest.hpp 266 VectorContentUnitTest_LDADD = ${ALLLIBS} 267 268 VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp 269 VectorUnitTest_LDADD = ${ALLLIBS} 270 218 271 #AUTOMAKE_OPTIONS = parallel-tests -
tests/Makefile.am
r5d6f38 rdd97a9 1 SUBDIRS = CodeChecksregression Tesselations1 SUBDIRS = regression Tesselations 2 2 -
tests/regression/Makefile.am
r5d6f38 rdd97a9 11 11 Graph \ 12 12 Molecules \ 13 Selection \14 13 Simple_configuration \ 15 14 Tesselation 16 15 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.at43 44 16 45 17 max_jobs = 4 … … 64 36 65 37 AUTOTEST = $(AUTOM4TE) --language=autotest 66 $(TESTSUITE): $(srcdir)/testsuite.at $( TESTSCRIPTS)38 $(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/testsuite-*.at 67 39 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at 68 40 mv $@.tmp $@ -
tests/regression/Simple_configuration/2/post/test.pdb
r5d6f38 rdd97a9 1 REMARK created by molecuilder on Tue Dec 7 13:11:3120102 ATOM 1 H01 0pre b1 10.000 10.000 10.000 1.00 1.00H 01 REMARK created by molecuilder on Fri Aug 27 12:18:33 2010 2 ATOM 1 H01 tes b 0 10.0 10.0 10.0 1.0 1.0 0 H 0 3 3 END -
tests/regression/testsuite-molecules.at
r5d6f38 rdd97a9 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 -by-id 0 --select-molecules-atoms-t "1., 1., 1." --periodic 0], 0, [stdout], [stderr])47 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecules-atoms 0 -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 -by-id 0 --select-molecules-atoms-t "-1., -1., -1." --periodic 0], 0, [stdout], [stderr])50 AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ --select-molecules-atoms 0 -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
r5d6f38 rdd97a9 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 - -outputstore.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 -s 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 - -outputstore.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 -s 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 - -outputstore.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 -s 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 - -outputstore.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 -s 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
r5d6f38 rdd97a9 1 1 AT_BANNER([MoleCuilder - standard options]) 2 2 # 1. verbosity 3 AT_SETUP([Standard Options - verbosity]) 4 AT_KEYWORDS([options]) 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 3 9 AT_SETUP([Standard Options - verbosity with Undo/Redo]) 4 10 AT_KEYWORDS([options]) 5 AT_CHECK([pwd],[ignore],[ignore]) 6 AT_CHECK([../../molecuilder -v 9], 0, [stdout], [ignore]) 7 AT_CHECK([grep "Setting verbosity from .* to 9" stdout], 0, [ignore], [ignore]) 8 AT_CHECK([../../molecuilder -v 9 --undo], 0, [stdout], [ignore]) 9 AT_CHECK([grep "Setting verbosity from 9 to .*" stdout], 0, [ignore], [ignore]) 10 AT_CHECK([../../molecuilder -v 9 --undo --redo], 0, [stdout], [ignore]) 11 AT_CHECK([grep "Setting verbosity from .* to 9" stdout], 0, [ignore], [ignore]) 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]) 12 15 AT_CLEANUP 13 16 -
tests/regression/testsuite.at
r5d6f38 rdd97a9 16 16 m4_include(testsuite-simple_configuration.at) 17 17 18 m4_include(Selection/testsuite-selection.at)19 20 18 m4_include(testsuite-domain.at) 21 19
Note:
See TracChangeset
for help on using the changeset viewer.