Changeset 35b698
- Timestamp:
- Jun 23, 2010, 3:52:50 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- d0fbec
- Parents:
- dc0d21
- git-author:
- Frederik Heber <heber@…> (06/23/10 15:20:35)
- git-committer:
- Frederik Heber <heber@…> (06/23/10 15:52:50)
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
rdc0d21 r35b698 42 42 double distance = -1.; 43 43 int order = 0; 44 std::string path; 44 45 config *configuration = World::getInstance().getConfig(); 45 46 int ExitFlag = 0; 46 47 47 48 cout << "pre-dialog"<< endl; 48 dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME)); 49 dialog->queryString(NAME, &path, MapOfActions::getInstance().getDescription(NAME)); 50 dialog->queryMolecule("molecule-by-id", &mol, MapOfActions::getInstance().getDescription("molecule-by-id")); 49 51 dialog->queryDouble("distance", &distance, MapOfActions::getInstance().getDescription("distance")); 50 52 dialog->queryInt("order", &order, MapOfActions::getInstance().getDescription("order")); … … 59 61 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 60 62 if (mol->hasBondStructure()) { 61 ExitFlag = mol->FragmentMolecule(order, configuration);63 ExitFlag = mol->FragmentMolecule(order, path); 62 64 } 63 65 World::getInstance().setExitFlag(ExitFlag); -
src/Actions/MapOfActions.cpp
rdc0d21 r35b698 185 185 TypeMap["fastparsing"] = Boolean; 186 186 TypeMap["fill-molecule"] = String; 187 TypeMap["fragment-mol"] = Molecule;187 TypeMap["fragment-mol"] = String; 188 188 TypeMap["input"] = String; 189 189 TypeMap["linear-interpolate"] = String; -
src/Actions/MoleculeAction/FillWithMoleculeAction.cpp
rdc0d21 r35b698 102 102 World::getInstance().getMolecules()->insert(Filling); 103 103 } 104 for (molecule::iterator iter = filler->begin(); !filler->empty(); iter = filler->begin()) { 105 atom *Walker = *iter; 106 filler->erase(iter); 107 World::getInstance().destroyAtom(Walker); 108 } 104 109 World::getInstance().destroyMolecule(filler); 105 110 -
src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp
rdc0d21 r35b698 69 69 if (IdMapping) 70 70 DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl); 71 char outputname[MAXSTRINGSIZE]; 72 strcpy(outputname, filename.c_str()); 73 // TODO: LinearInterpolationBetweenConfiguration should use stream, not the filename directly! (better for unit test) 74 if (!mol->LinearInterpolationBetweenConfiguration(start, end, outputname, *(World::getInstance().getConfig()), IdMapping)) 75 DoLog(2) && (Log() << Verbose(2) << "Could not store " << outputname << " files." << endl); 71 if (!mol->LinearInterpolationBetweenConfiguration(start, end, filename, *(World::getInstance().getConfig()), IdMapping)) 72 DoLog(2) && (Log() << Verbose(2) << "Could not store " << filename << " files." << endl); 76 73 else 77 74 DoLog(2) && (Log() << Verbose(2) << "Steps created and " << filename << " files stored." << endl); -
src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
rdc0d21 r35b698 65 65 World::getInstance().getConfig()->BG->ConstructBondGraph(mol); 66 66 // TODO: sollte stream nicht filename benutzen, besser fuer unit test 67 char outputname[MAXSTRINGSIZE]; 68 strcpy(outputname, filename.c_str()); 69 mol->StoreAdjacencyToFile(NULL, outputname); 67 mol->StoreAdjacencyToFile(filename); 70 68 delete dialog; 71 69 return Action::success; -
src/Actions/MoleculeAction/SaveBondsAction.cpp
rdc0d21 r35b698 64 64 DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << filename << "." << endl); 65 65 World::getInstance().getConfig()->BG->ConstructBondGraph(mol); 66 // TODO: sollte stream, nicht filenamen direkt nutzen, beser fuer unit tests 67 char outputname[MAXSTRINGSIZE]; 68 strcpy(outputname, filename.c_str()); 69 mol->StoreBondsToFile(NULL, outputname); 66 // TODO: sollte stream, nicht filenamen direkt nutzen, besser fuer unit tests 67 mol->StoreBondsToFile(filename); 70 68 delete dialog; 71 69 return Action::success; -
src/Legacy/oldmenu.cpp
rdc0d21 r35b698 609 609 { 610 610 int Order1; 611 std::string path; 611 612 clock_t start, end; 612 613 … … 614 615 Log() << Verbose(0) << "What's the desired bond order: "; 615 616 cin >> Order1; 617 DoLog(0) && (Log() << Verbose(0) << "What's the output path and prefix [e.g. /home/foo/BondFragment]: "); 618 cin >> path; 616 619 if (mol->hasBondStructure()) { 617 620 start = clock(); 618 mol->FragmentMolecule(Order1, configuration);621 mol->FragmentMolecule(Order1, path); 619 622 end = clock(); 620 623 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; -
src/Makefile.am
rdc0d21 r35b698 245 245 INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements 246 246 247 noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a 247 noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a libparser.a 248 248 bin_PROGRAMS = molecuilder joiner analyzer 249 249 molecuilderdir = ${bindir} 250 250 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER} 251 libparser_a_SOURCES = ${PARSERSOURCE} ${PARSERHEADER} 251 252 libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER} 252 253 molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db 253 254 molecuilder_LDFLAGS = $(BOOST_LDFLAGS) 254 255 molecuilder_SOURCES = builder.cpp 255 molecuilder_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a lib gslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}256 molecuilder_LDADD = UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libparser.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 256 257 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp 257 258 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB} -
src/Parser/PcpParser.cpp
rdc0d21 r35b698 30 30 31 31 Paths.databasepath = NULL; 32 Paths.configpath = NULL;33 32 Paths.configname = NULL; 34 33 Paths.mainname = NULL; … … 307 306 // 3. parse the molecule in 308 307 molecule *mol = World::getInstance().createMolecule(); 308 MoleculeListClass *molecules = World::getInstance().getMolecules(); 309 molecules->insert(mol); 309 310 LoadMolecule(mol, FileBuffer, World::getInstance().getPeriode(), FastParsing); 310 311 //mol->SetNameFromFilename(filename); … … 615 616 if ((Paths.databasepath != NULL) && (b.Paths.databasepath != NULL)) 616 617 ASSERT(strcmp(Paths.databasepath, b.Paths.databasepath), "PcpParser ==: databasepath not"); 617 if ((Paths.configpath != NULL) && (b.Paths.configpath != NULL))618 ASSERT(strcmp(Paths.configpath, b.Paths.configpath), "PcpParser ==: configpath not");619 618 if ((Paths.configname != NULL) && (b.Paths.configname != NULL)) 620 619 ASSERT(strcmp(Paths.configname, b.Paths.configname), "PcpParser ==: configname not"); -
src/Parser/PcpParser.hpp
rdc0d21 r35b698 41 41 struct StructPaths { 42 42 char *databasepath; 43 char *configpath;44 43 char *configname; 45 44 char *mainname; -
src/World.cpp
rdc0d21 r35b698 112 112 molecule *mol = NULL; 113 113 mol = NewMolecule(); 114 cout << "Creating molecule with id " << currMoleculeId << "." << endl; 114 115 assert(!molecules.count(currMoleculeId)); 115 116 mol->setId(currMoleculeId++); -
src/builder.cpp
rdc0d21 r35b698 80 80 #include "Menu/ActionMenuItem.hpp" 81 81 #include "Parser/ChangeTracker.hpp" 82 #include "Parser/FormatParserStorage.hpp" 83 #include "Parser/PcpParser.hpp" 84 #include "Parser/XyzParser.hpp" 82 85 #include "Actions/ActionRegistry.hpp" 83 86 #include "Actions/ActionHistory.hpp" … … 654 657 int Order1; 655 658 clock_t start, end; 659 std::string path; 656 660 657 661 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 658 662 DoLog(0) && (Log() << Verbose(0) << "What's the desired bond order: "); 659 663 cin >> Order1; 664 DoLog(0) && (Log() << Verbose(0) << "What's the output path and prefix [e.g. /home/foo/BondFragment]: "); 665 cin >> path; 660 666 if (mol->first->next != mol->last) { // there are bonds 661 667 start = clock(); 662 mol->FragmentMolecule(Order1, configuration);668 mol->FragmentMolecule(Order1, path); 663 669 end = clock(); 664 670 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); … … 1373 1379 mol->SetNameFromFilename(ConfigFileName); 1374 1380 1375 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {1376 DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);1377 }1378 1379 1380 1381 // first save as PDB data 1381 1382 if (ConfigFileName != NULL) … … 1477 1478 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1478 1479 1479 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) {1480 DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl);1481 }1482 1483 1480 World::getInstance().destroyMolecule(mol); 1484 1481 }; … … 1500 1497 */ 1501 1498 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1502 config& configuration, char **ConfigFileName, s et<int> &ArgcList)1499 config& configuration, char **ConfigFileName, std::string &BondGraphFileName, set<int> &ArgcList) 1503 1500 { 1504 1501 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1513 1510 int argptr; 1514 1511 molecule *mol = NULL; 1515 string BondGraphFileName("\n");1516 1512 1517 1513 if (argc > 1) { // config file specified as option … … 1625 1621 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place 1626 1622 DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl); 1623 std::string filenameprefix(argv[1]); 1624 strcpy(*ConfigFileName, filenameprefix.substr(0,filenameprefix.find('.')).c_str()); 1625 DoLog(1) && (Log() << Verbose(1) << "Setting config file name prefix to " << *ConfigFileName << "." << endl); 1627 1626 test.open(argv[1], ios::in); 1628 1627 if (test == NULL) { 1629 //return (1); 1630 output.open(argv[1], ios::out); 1631 if (output == NULL) { 1632 DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl); 1633 configPresent = absent; 1634 } else { 1635 DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl); 1636 strcpy(*ConfigFileName, argv[1]); 1637 configPresent = empty; 1638 output.close(); 1639 } 1628 DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl); 1629 configPresent = empty; 1640 1630 } else { 1631 configPresent = present; 1632 DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... "); 1633 FormatParserStorage::getInstance().getPcp().load(&test); 1641 1634 test.close(); 1642 strcpy(*ConfigFileName, argv[1]);1643 DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");1644 switch (configuration.TestSyntax(*ConfigFileName, periode)) {1645 case 1:1646 DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl);1647 configuration.Load(*ConfigFileName, BondGraphFileName, periode, molecules);1648 configPresent = present;1649 break;1650 case 0:1651 DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl);1652 configuration.LoadOld(*ConfigFileName, BondGraphFileName, periode, molecules);1653 configPresent = present;1654 break;1655 default:1656 DoLog(0) && (Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl);1657 configPresent = empty;1658 }1659 1635 } 1660 1636 } else … … 1671 1647 mol = World::getInstance().createMolecule(); 1672 1648 mol->ActiveFlag = true; 1673 if (*ConfigFileName != NULL)1674 mol->SetNameFromFilename(*ConfigFileName);1675 1649 molecules->insert(mol); 1676 1650 } 1651 if (*ConfigFileName != NULL) 1652 mol->SetNameFromFilename(*ConfigFileName); 1677 1653 1678 1654 // 4. parse again through options, now for those depending on elements db and config presence … … 1733 1709 break; 1734 1710 case 'I': 1735 DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);1736 1711 ArgcList.insert(argptr-1); 1737 1712 argptr+=0; … … 1977 1952 case 't': 1978 1953 if (ExitFlag == 0) ExitFlag = 1; 1979 if ((argptr+ 4>= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1954 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1980 1955 ExitFlag = 255; 1981 1956 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z> --molecule-by-id <molecule_id> --periodic <0/1>" << endl); … … 2074 2049 case 'f': 2075 2050 if (ExitFlag == 0) ExitFlag = 1; 2076 if ((argptr+ 1>= argc) || (argv[argptr][0] == '-')) {2051 if ((argptr+4 >= argc) || (argv[argptr][0] == '-')) { 2077 2052 ExitFlag = 255; 2078 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl); 2053 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <path/prefix> --molecule-by-id <molecule id> --distance <max_distance> --order <order>" << endl); 2054 performCriticalExit(); 2055 } else { 2056 ArgcList.insert(argptr-1); 2057 ArgcList.insert(argptr); 2058 ArgcList.insert(argptr+1); 2059 ArgcList.insert(argptr+2); 2060 ArgcList.insert(argptr+3); 2061 ArgcList.insert(argptr+4); 2062 ArgcList.insert(argptr+5); 2063 ArgcList.insert(argptr+6); 2064 argptr+=7; 2065 } 2066 break; 2067 case 'm': 2068 if (ExitFlag == 0) ExitFlag = 1; 2069 j = atoi(argv[argptr++]); 2070 if ((j<0) || (j>1)) { 2071 DoeLog(1) && (eLog()<< Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl); 2072 j = 0; 2073 } 2074 if (j) { 2075 SaveFlag = true; 2076 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 2077 mol->PrincipalAxisSystem((bool)j); 2078 } else 2079 ArgcList.insert(argptr-1); 2080 argptr+=0; 2081 break; 2082 case 'o': 2083 if (ExitFlag == 0) ExitFlag = 1; 2084 if ((argptr+4 >= argc) || (argv[argptr][0] == '-')){ 2085 ExitFlag = 255; 2086 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <molecule_id> --output-file <output file> --output-file <binned output file>" << endl); 2079 2087 performCriticalExit(); 2080 2088 } else { … … 2088 2096 } 2089 2097 break; 2090 case 'm':2091 if (ExitFlag == 0) ExitFlag = 1;2092 j = atoi(argv[argptr++]);2093 if ((j<0) || (j>1)) {2094 DoeLog(1) && (eLog()<< Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl);2095 j = 0;2096 }2097 if (j) {2098 SaveFlag = true;2099 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);2100 mol->PrincipalAxisSystem((bool)j);2101 } else2102 ArgcList.insert(argptr-1);2103 argptr+=0;2104 break;2105 case 'o':2106 if (ExitFlag == 0) ExitFlag = 1;2107 if ((argptr+4 >= argc) || (argv[argptr][0] == '-')){2108 ExitFlag = 255;2109 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <molecule_id> --output-file <output file> --output-file <binned output file>" << endl);2110 performCriticalExit();2111 } else {2112 ArgcList.insert(argptr-1);2113 ArgcList.insert(argptr);2114 ArgcList.insert(argptr+1);2115 ArgcList.insert(argptr+2);2116 ArgcList.insert(argptr+3);2117 ArgcList.insert(argptr+4);2118 argptr+=5;2119 }2120 break;2121 2098 case 'U': 2122 2099 if (ExitFlag == 0) ExitFlag = 1; … … 2164 2141 } else argptr++; 2165 2142 } while (argptr < argc); 2166 if (SaveFlag)2167 configuration.SaveAll(*ConfigFileName, periode, molecules);2168 2143 } else { // no arguments, hence scan the elements db 2169 2144 if (periode->LoadPeriodentafel(configuration.databasepath)) … … 2171 2146 else 2172 2147 DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl); 2173 configuration.RetrieveConfigPathAndName("main_pcp_linux");2174 2148 } 2175 2149 return(ExitFlag); … … 2179 2153 2180 2154 void cleanUp(){ 2155 FormatParserStorage::purgeInstance(); 2181 2156 ChangeTracker::purgeInstance(); 2182 2157 World::purgeInstance(); … … 2207 2182 bool ArgumentsCopied = false; 2208 2183 char *ConfigFileName = new char[MAXSTRINGSIZE]; 2184 std::string BondGraphFileName("\n"); 2185 FormatParserStorage::getInstance().addMpqc(); 2186 FormatParserStorage::getInstance().addPcp(); 2187 FormatParserStorage::getInstance().addXyz(); 2209 2188 2210 2189 // print version check whether arguments are present at all … … 2235 2214 ArgcList.insert(1); // push back config file name 2236 2215 // handle arguments by ParseCommandLineOptions() 2237 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, ArgcList);2216 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, BondGraphFileName, ArgcList); 2238 2217 World::getInstance().setExitFlag(ExitFlag); 2239 2218 // copy all remaining arguments to a new argv … … 2248 2227 cout << endl; 2249 2228 ArgumentsCopied = true; 2229 2230 // construct bond graph 2231 if (World::getInstance().getConfig()->BG == NULL) { 2232 World::getInstance().getConfig()->BG = new BondGraph(World::getInstance().getConfig()->GetIsAngstroem()); 2233 if (World::getInstance().getConfig()->BG->LoadBondLengthTable(BondGraphFileName)) { 2234 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 2235 } else { 2236 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 2237 } 2238 } 2250 2239 // handle remaining arguments by CommandLineParser 2251 2240 MapOfActions::getInstance().AddOptionsToParser(); … … 2269 2258 } 2270 2259 2271 Log() << Verbose(0) << "Saving to " << ConfigFileName << "." << endl; 2272 World::getInstance().getConfig()->SaveAll(ConfigFileName, World::getInstance().getPeriode(), World::getInstance().getMolecules()); 2260 std::string FilenamePrefix(ConfigFileName); 2261 FormatParserStorage::getInstance().SetOutputPrefixForAll(FilenamePrefix); 2262 FormatParserStorage::getInstance().SaveAll(); 2263 ChangeTracker::getInstance().saveStatus(); 2273 2264 2274 2265 // free the new argv -
src/config.cpp
rdc0d21 r35b698 31 31 /** Constructor for config file class. 32 32 */ 33 config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),33 config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), 34 34 configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), mainname(NULL), defaultpath(NULL), pseudopotpath(NULL), 35 35 DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01), … … 42 42 pseudopotpath = new char[MAXSTRINGSIZE]; 43 43 databasepath = new char[MAXSTRINGSIZE]; 44 configpath = new char[MAXSTRINGSIZE];45 44 configname = new char[MAXSTRINGSIZE]; 46 45 Thermostats = new ThermoStatContainer(); … … 48 47 strcpy(defaultpath,"not specified"); 49 48 strcpy(pseudopotpath,"not specified"); 50 configpath[0]='\0';51 49 configname[0]='\0'; 52 50 basis = "3-21G"; … … 61 59 delete[](pseudopotpath); 62 60 delete[](databasepath); 63 delete[](configpath);64 61 delete[](configname); 65 62 if (Thermostats != NULL) … … 383 380 }; 384 381 385 /** Retrieves the path in the given config file name.386 * \param filename config file string387 */388 void config::RetrieveConfigPathAndName(const string filename)389 {390 char *ptr = NULL;391 char *buffer = new char[MAXSTRINGSIZE];392 strncpy(buffer, filename.c_str(), MAXSTRINGSIZE);393 int last = -1;394 for(last=MAXSTRINGSIZE;last--;) {395 if (buffer[last] == '/')396 break;397 }398 if (last == -1) { // no path in front, set to local directory.399 strcpy(configpath, "./");400 ptr = buffer;401 } else {402 strncpy(configpath, buffer, last+1);403 ptr = &buffer[last+1];404 if (last < 254)405 configpath[last+1]='\0';406 }407 strcpy(configname, ptr);408 DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl);409 delete[](buffer);410 };411 412 382 /** Loads a molecule from a ConfigFileBuffer. 413 383 * \param *mol molecule to load … … 603 573 file->close(); 604 574 delete(file); 605 RetrieveConfigPathAndName(filename);606 575 607 576 // ParseParameterFile … … 840 809 return; 841 810 } 842 RetrieveConfigPathAndName(filename);843 811 // ParseParameters 844 812 … … 1525 1493 molecule *mol = NULL; 1526 1494 1527 if (!strcmp(configpath, GetDefaultPath())) {1528 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1529 }1530 1531 1532 1495 // first save as PDB data 1533 1496 if (ConfigFileName != NULL) … … 1566 1529 mol->doCountAtoms(); 1567 1530 mol->CountElements(); 1568 mol->CalculateOrbitals(*this);1531 //mol->CalculateOrbitals(*this); 1569 1532 delete[](src); 1570 1533 } else { … … 1572 1535 mol = *(molecules->ListOfMolecules.begin()); 1573 1536 mol->doCountAtoms(); 1574 mol->CalculateOrbitals(*this);1537 //mol->CalculateOrbitals(*this); 1575 1538 } else { 1576 1539 DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl); … … 1634 1597 else 1635 1598 Log() << Verbose(0) << "\t... failed." << endl; 1636 1637 if (!strcmp(configpath, GetDefaultPath())) {1638 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1639 }1640 1599 1641 1600 // don't destroy molecule as it contains all our atoms -
src/config.hpp
rdc0d21 r35b698 47 47 int ProcPEGamma; 48 48 int ProcPEPsi; 49 char *configpath;50 49 char *configname; 51 50 bool FastParsing; … … 117 116 void Load(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, MoleculeListClass * const &MolList); 118 117 void LoadOld(const char * const filename, const string &BondGraphFileName, const periodentafel * const periode, MoleculeListClass * const &MolList); 119 void RetrieveConfigPathAndName(const string filename);120 118 bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const; 121 119 bool SaveMPQC(const char * const filename, const molecule * const mol) const; -
src/molecule.cpp
rdc0d21 r35b698 79 79 void molecule::setName(const std::string _name){ 80 80 OBSERVE; 81 cout << "Set name of molecule " << getId() << " to " << _name << endl; 81 82 strncpy(name,_name.c_str(),MAXSTRINGSIZE); 82 83 } … … 740 741 else 741 742 length = strlen(molname) - strlen(endname); 743 cout << "Set name of molecule " << getId() << " to " << molname << endl; 742 744 strncpy(name, molname, length); 743 745 name[length]='\0'; … … 1004 1006 for(int i=MAX_ELEMENTS;i--;) 1005 1007 ElementCount += (ElementsInMolecule[i] != 0 ? 1 : 0); 1006 };1007 1008 1009 /** Counts necessary number of valence electrons and returns number and SpinType.1010 * \param configuration containing everything1011 */1012 void molecule::CalculateOrbitals(class config &configuration)1013 {1014 configuration.MaxPsiDouble = configuration.PsiMaxNoDown = configuration.PsiMaxNoUp = configuration.PsiType = 0;1015 for(int i=MAX_ELEMENTS;i--;) {1016 if (ElementsInMolecule[i] != 0) {1017 //Log() << Verbose(0) << "CalculateOrbitals: " << elemente->FindElement(i)->name << " has a valence of " << (int)elemente->FindElement(i)->Valence << " and there are " << ElementsInMolecule[i] << " of it." << endl;1018 configuration.MaxPsiDouble += ElementsInMolecule[i]*((int)elemente->FindElement(i)->Valence);1019 }1020 }1021 configuration.PsiMaxNoDown = configuration.MaxPsiDouble/2 + (configuration.MaxPsiDouble % 2);1022 configuration.PsiMaxNoUp = configuration.MaxPsiDouble/2;1023 configuration.MaxPsiDouble /= 2;1024 configuration.PsiType = (configuration.PsiMaxNoDown == configuration.PsiMaxNoUp) ? 0 : 1;1025 if ((configuration.PsiType == 1) && (configuration.ProcPEPsi < 2) && ((configuration.PsiMaxNoDown != 1) || (configuration.PsiMaxNoUp != 0))) {1026 configuration.ProcPEGamma /= 2;1027 configuration.ProcPEPsi *= 2;1028 } else {1029 configuration.ProcPEGamma *= configuration.ProcPEPsi;1030 configuration.ProcPEPsi = 1;1031 }1032 cout << configuration.PsiMaxNoDown << ">" << configuration.PsiMaxNoUp << endl;1033 if (configuration.PsiMaxNoDown > configuration.PsiMaxNoUp) {1034 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoDown;1035 cout << configuration.PsiMaxNoDown << " " << configuration.InitMaxMinStopStep << endl;1036 } else {1037 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoUp;1038 cout << configuration.PsiMaxNoUp << " " << configuration.InitMaxMinStopStep << endl;1039 }1040 1008 }; 1041 1009 -
src/molecule.hpp
rdc0d21 r35b698 261 261 /// Count and change present atoms' coordination. 262 262 void CountElements(); 263 void CalculateOrbitals(class config &configuration);264 263 bool CenterInBox(); 265 264 bool BoundInBox(); … … 288 287 double MinimiseConstrainedPotential(atom **&permutation, int startstep, int endstep, bool IsAngstroem); 289 288 void EvaluateConstrainedForces(int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force); 290 bool LinearInterpolationBetweenConfiguration(int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity);289 bool LinearInterpolationBetweenConfiguration(int startstep, int endstep, std::string &prefix, config &configuration, bool MapByIdentity); 291 290 292 291 bool CheckBounds(const Vector *x) const; … … 320 319 321 320 /// Fragment molecule by two different approaches: 322 int FragmentMolecule(int Order, config *configuration);323 bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);324 bool StoreBondsToFile( char *path, char *filename);325 bool StoreAdjacencyToFile( char *path, char *filename);326 bool CheckAdjacencyFileAgainstMolecule( char *path, atom **ListOfAtoms);327 bool ParseOrderAtSiteFromFile( char *path);328 bool StoreOrderAtSiteFile( char *path);329 bool StoreForcesFile(MoleculeListClass *BondFragments, char *path, int *SortIndex);321 int FragmentMolecule(int Order, std::string &prefix); 322 bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, std::string path = ""); 323 bool StoreBondsToFile(std::string &filename, std::string path = ""); 324 bool StoreAdjacencyToFile(std::string &filename, std::string path = ""); 325 bool CheckAdjacencyFileAgainstMolecule(std::string &path, atom **ListOfAtoms); 326 bool ParseOrderAtSiteFromFile(std::string &path); 327 bool StoreOrderAtSiteFile(std::string &path); 328 bool StoreForcesFile(MoleculeListClass *BondFragments, std::string &path, int *SortIndex); 330 329 bool CreateMappingLabelsToConfigSequence(int *&SortIndex); 331 330 bool CreateFatherLookupTable(atom **&LookupTable, int count = 0); … … 376 375 ~MoleculeListClass(); 377 376 378 bool AddHydrogenCorrection( char *path);379 bool StoreForcesFile( char *path, int *SortIndex);377 bool AddHydrogenCorrection(std::string &path); 378 bool StoreForcesFile(std::string &path, int *SortIndex); 380 379 void insert(molecule *mol); 381 380 void erase(molecule *mol); 382 381 molecule * ReturnIndex(int index); 383 bool OutputConfigForListOfFragments( config *configuration, int *SortIndex);382 bool OutputConfigForListOfFragments(std::string &prefix, int *SortIndex); 384 383 int NumberOfActiveMolecules(); 385 384 void Enumerate(ostream *out); -
src/molecule_dynamics.cpp
rdc0d21 r35b698 473 473 * \param startstep stating initial configuration in molecule::Trajectories 474 474 * \param endstep stating final configuration in molecule::Trajectories 475 * \param &prefix path and prefix 475 476 * \param &config configuration structure 476 477 * \param MapByIdentity if true we just use the identity to map atoms in start config to end config, if not we find mapping by \sa MinimiseConstrainedPotential() 477 478 * \return true - success in writing step files, false - error writing files or only one step in molecule::Trajectories 478 479 */ 479 bool molecule::LinearInterpolationBetweenConfiguration(int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity)480 bool molecule::LinearInterpolationBetweenConfiguration(int startstep, int endstep, std::string &prefix, config &configuration, bool MapByIdentity) 480 481 { 481 482 molecule *mol = NULL; … … 525 526 for (int i=getAtomCount(); i--; ) 526 527 SortIndex[i] = i; 527 status = MoleculePerStep->OutputConfigForListOfFragments(&configuration, SortIndex); 528 529 status = MoleculePerStep->OutputConfigForListOfFragments(prefix, SortIndex); 528 530 delete[](SortIndex); 529 531 -
src/molecule_fragmentation.cpp
rdc0d21 r35b698 82 82 * -# Scans TEFactors file and sets the TEFactor of each key set in the temporary graph accordingly 83 83 * Finally, the temporary graph is inserted into the given \a FragmentList for return. 84 * \param *out output stream for debugging 85 * \param *path path to file 84 * \param &path path to file 86 85 * \param *FragmentList empty, filled on return 87 86 * \return true - parsing successfully, false - failure on parsing (FragmentList will be NULL) 88 87 */ 89 bool ParseKeySetFile( char *path, Graph *&FragmentList)88 bool ParseKeySetFile(std::string &path, Graph *&FragmentList) 90 89 { 91 90 bool status = true; … … 94 93 GraphTestPair testGraphInsert; 95 94 int NumberOfFragments = 0; 96 char filename[MAXSTRINGSIZE];95 string filename; 97 96 98 97 if (FragmentList == NULL) { // check list pointer … … 102 101 // 1st pass: open file and read 103 102 DoLog(1) && (Log() << Verbose(1) << "Parsing the KeySet file ... " << endl); 104 sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, KEYSETFILE);105 InputFile.open(filename );106 if (InputFile != NULL) {103 filename = path + KEYSETFILE; 104 InputFile.open(filename.c_str()); 105 if (InputFile.good()) { 107 106 // each line represents a new fragment 108 107 char buffer[MAXSTRINGSIZE]; … … 181 180 182 181 /** Stores key sets to file. 183 * \param *out output stream for debugging184 182 * \param KeySetList Graph with Keysets 185 * \param *path path to file183 * \param &path path to file 186 184 * \return true - file written successfully, false - writing failed 187 185 */ 188 bool StoreKeySetFile(Graph &KeySetList, char *path) 189 { 190 ofstream output; 186 bool StoreKeySetFile(Graph &KeySetList, std::string &path) 187 { 191 188 bool status = true; 192 string line; 189 string line = path + KEYSETFILE; 190 ofstream output(line.c_str()); 193 191 194 192 // open KeySet file 195 line = path;196 line.append("/");197 line += FRAGMENTPREFIX;198 line += KEYSETFILE;199 output.open(line.c_str(), ios::out);200 193 DoLog(1) && (Log() << Verbose(1) << "Saving key sets of the total graph ... "); 201 if(output != NULL) {194 if(output.good()) { 202 195 for(Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) { 203 196 for (KeySet::iterator sprinter = (*runner).first.begin();sprinter != (*runner).first.end(); sprinter++) { … … 302 295 303 296 /** Scans the adaptive order file and insert (index, value) into map. 304 * \param *out output stream for debugging 305 * \param *path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative) 297 * \param &path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative) 306 298 * \param &IndexedKeySetList list to find key set for a given index \a No 307 299 * \return adaptive criteria list from file 308 300 */ 309 map<int, pair<double,int> > * ScanAdaptiveFileIntoMap( char *path, map<int,KeySet> &IndexKeySetList)301 map<int, pair<double,int> > * ScanAdaptiveFileIntoMap(std::string &path, map<int,KeySet> &IndexKeySetList) 310 302 { 311 303 map<int, pair<double,int> > *AdaptiveCriteriaList = new map<int, pair<double,int> >; … … 313 305 double Value = 0.; 314 306 char buffer[MAXSTRINGSIZE]; 315 sprintf(buffer, "%s/%s%s.dat", path, FRAGMENTPREFIX, ENERGYPERFRAGMENT); 316 ifstream InputFile(buffer, ios::in); 307 string filename = path + ENERGYPERFRAGMENT; 308 ifstream InputFile(filename.c_str()); 309 310 if (InputFile.fail()) { 311 DoeLog(1) && (eLog() << Verbose(1) << "Cannot find file " << filename << "." << endl); 312 return AdaptiveCriteriaList; 313 } 317 314 318 315 if (CountLinesinFile(InputFile) > 0) { … … 419 416 420 417 /** Checks whether the OrderAtSite is still below \a Order at some site. 421 * \param *out output stream for debugging422 418 * \param *AtomMask defines true/false per global Atom::nr to mask in/out each nuclear site, used to activate given number of site to increment order adaptively 423 419 * \param *GlobalKeySetList list of keysets with global ids (valid in "this" molecule) needed for adaptive increase 424 420 * \param Order desired Order if positive, desired exponent in threshold criteria if negative (0 is single-step) 425 421 * \param *MinimumRingSize array of max. possible order to avoid loops 426 * \param *path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative)422 * \param path path to ENERGYPERFRAGMENT file (may be NULL if Order is non-negative) 427 423 * \return true - needs further fragmentation, false - does not need fragmentation 428 424 */ 429 bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path)425 bool molecule::CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, std::string path) 430 426 { 431 427 bool status = false; … … 585 581 * of vertex indices: Global always means the index in "this" molecule, whereas local refers to the molecule or 586 582 * subgraph in the MoleculeListClass. 587 * \param *out output stream for debugging588 583 * \param Order up to how many neighbouring bonds a fragment contains in BondOrderScheme::BottumUp scheme 589 * \param *configuration configuration for writing config files for each fragment584 * \param &prefix path and prefix of the bond order configs to be written 590 585 * \return 1 - continue, 2 - stop (no fragmentation occured) 591 586 */ 592 int molecule::FragmentMolecule(int Order, config *configuration)587 int molecule::FragmentMolecule(int Order, std::string &prefix) 593 588 { 594 589 MoleculeListClass *BondFragments = NULL; … … 624 619 625 620 // === compare it with adjacency file === 626 FragmentationToDo = FragmentationToDo && CheckAdjacencyFileAgainstMolecule( configuration->configpath, ListOfAtoms);621 FragmentationToDo = FragmentationToDo && CheckAdjacencyFileAgainstMolecule(prefix, ListOfAtoms); 627 622 delete[](ListOfAtoms); 628 623 … … 658 653 659 654 // ===== 3. if structure still valid, parse key set file and others ===== 660 FragmentationToDo = FragmentationToDo && ParseKeySetFile( configuration->configpath, ParsedFragmentList);655 FragmentationToDo = FragmentationToDo && ParseKeySetFile(prefix, ParsedFragmentList); 661 656 662 657 // ===== 4. check globally whether there's something to do actually (first adaptivity check) 663 FragmentationToDo = FragmentationToDo && ParseOrderAtSiteFromFile( configuration->configpath);658 FragmentationToDo = FragmentationToDo && ParseOrderAtSiteFromFile(prefix); 664 659 665 660 // =================================== Begin of FRAGMENTATION =============================== … … 672 667 AtomMask[getAtomCount()] = false; 673 668 FragmentationToDo = false; // if CheckOrderAtSite just ones recommends fragmentation, we will save fragments afterwards 674 while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, MinimumRingSize, configuration->configpath))) {669 while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, MinimumRingSize, prefix))) { 675 670 FragmentationToDo = FragmentationToDo || CheckOrder; 676 671 AtomMask[getAtomCount()] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite() … … 727 722 KeySet test = (*runner).first; 728 723 DoLog(0) && (Log() << Verbose(0) << "Fragment No." << (*runner).second.first << " with TEFactor " << (*runner).second.second << "." << endl); 729 BondFragments->insert(StoreFragmentFromKeySet(test, configuration));724 BondFragments->insert(StoreFragmentFromKeySet(test, World::getInstance().getConfig())); 730 725 k++; 731 726 } … … 739 734 740 735 DoLog(1) && (Log() << Verbose(1) << "Writing " << BondFragments->ListOfMolecules.size() << " possible bond fragmentation configs" << endl); 741 if (BondFragments->OutputConfigForListOfFragments( configuration, SortIndex))736 if (BondFragments->OutputConfigForListOfFragments(prefix, SortIndex)) 742 737 DoLog(1) && (Log() << Verbose(1) << "All configs written." << endl); 743 738 else … … 745 740 746 741 // store force index reference file 747 BondFragments->StoreForcesFile( configuration->configpath, SortIndex);742 BondFragments->StoreForcesFile(prefix, SortIndex); 748 743 749 744 // store keysets file 750 StoreKeySetFile(TotalGraph, configuration->configpath);745 StoreKeySetFile(TotalGraph, prefix); 751 746 752 747 { 753 748 // store Adjacency file 754 char filename[MAXSTRINGSIZE]; 755 strcpy(filename, FRAGMENTPREFIX); 756 strcat(filename, ADJACENCYFILE); 757 StoreAdjacencyToFile(configuration->configpath, filename); 749 std::string filename = prefix + ADJACENCYFILE; 750 StoreAdjacencyToFile(filename); 758 751 } 759 752 760 753 // store Hydrogen saturation correction file 761 BondFragments->AddHydrogenCorrection( configuration->configpath);754 BondFragments->AddHydrogenCorrection(prefix); 762 755 763 756 // store adaptive orders into file 764 StoreOrderAtSiteFile( configuration->configpath);757 StoreOrderAtSiteFile(prefix); 765 758 766 759 // restore orbital and Stop values 767 CalculateOrbitals(*configuration);760 //CalculateOrbitals(*configuration); 768 761 769 762 // free memory for bond part … … 782 775 /** Stores pairs (Atom::nr, Atom::AdaptiveOrder) into file. 783 776 * Atoms not present in the file get "-1". 784 * \param *out output stream for debugging 785 * \param *path path to file ORDERATSITEFILE 777 * \param &path path to file ORDERATSITEFILE 786 778 * \return true - file writable, false - not writable 787 779 */ 788 bool molecule::StoreOrderAtSiteFile( char *path)789 { 790 string streamline;780 bool molecule::StoreOrderAtSiteFile(std::string &path) 781 { 782 string line; 791 783 ofstream file; 792 784 793 line << path << "/" << FRAGMENTPREFIX <<ORDERATSITEFILE;794 file.open(line. str().c_str());785 line = path + ORDERATSITEFILE; 786 file.open(line.c_str()); 795 787 DoLog(1) && (Log() << Verbose(1) << "Writing OrderAtSite " << ORDERATSITEFILE << " ... " << endl); 796 if (file != NULL) {788 if (file.good()) { 797 789 ActOnAllAtoms( &atom::OutputOrder, &file ); 798 790 file.close(); … … 800 792 return true; 801 793 } else { 802 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line .str()<< "." << endl);794 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line << "." << endl); 803 795 return false; 804 796 } … … 807 799 /** Parses pairs(Atom::nr, Atom::AdaptiveOrder) from file and stores in molecule's Atom's. 808 800 * Atoms not present in the file get "0". 809 * \param *out output stream for debugging 810 * \param *path path to file ORDERATSITEFILEe 801 * \param &path path to file ORDERATSITEFILEe 811 802 * \return true - file found and scanned, false - file not found 812 803 * \sa ParseKeySetFile() and CheckAdjacencyFileAgainstMolecule() as this is meant to be used in conjunction with the two 813 804 */ 814 bool molecule::ParseOrderAtSiteFromFile( char *path)805 bool molecule::ParseOrderAtSiteFromFile(std::string &path) 815 806 { 816 807 unsigned char *OrderArray = new unsigned char[getAtomCount()]; … … 818 809 bool status; 819 810 int AtomNr, value; 820 string streamline;811 string line; 821 812 ifstream file; 822 813 … … 827 818 828 819 DoLog(1) && (Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl); 829 line << path << "/" << FRAGMENTPREFIX <<ORDERATSITEFILE;830 file.open(line. str().c_str());831 if (file != NULL) {820 line = path + ORDERATSITEFILE; 821 file.open(line.c_str()); 822 if (file.good()) { 832 823 while (!file.eof()) { // parse from file 833 824 AtomNr = -1; … … 850 841 status = true; 851 842 } else { 852 DoLog(1) && (Log() << Verbose(1) << "\t ... failed to open file " << line .str()<< "." << endl);843 DoLog(1) && (Log() << Verbose(1) << "\t ... failed to open file " << line << "." << endl); 853 844 status = false; 854 845 } -
src/molecule_graph.cpp
rdc0d21 r35b698 12 12 #include "bondgraph.hpp" 13 13 #include "config.hpp" 14 #include "defs.hpp" 14 15 #include "element.hpp" 15 16 #include "helpers.hpp" … … 1024 1025 /** Storing the bond structure of a molecule to file. 1025 1026 * Simply stores Atom::nr and then the Atom::nr of all bond partners per line. 1026 * \param *path path tofile1027 * \param *filename name of file1027 * \param &filename name of file 1028 * \param path path to file, defaults to empty 1028 1029 * \return true - file written successfully, false - writing failed 1029 1030 */ 1030 bool molecule::StoreAdjacencyToFile( char *path, char *filename)1031 bool molecule::StoreAdjacencyToFile(std::string &filename, std::string path) 1031 1032 { 1032 1033 ofstream AdjacencyFile; 1033 string streamline;1034 string line; 1034 1035 bool status = true; 1035 1036 1036 if (path != NULL)1037 line << path << "/" <<filename;1037 if (path != "") 1038 line = path + "/" + filename; 1038 1039 else 1039 line <<filename;1040 AdjacencyFile.open(line. str().c_str(), ios::out);1040 line = filename; 1041 AdjacencyFile.open(line.c_str(), ios::out); 1041 1042 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl); 1042 if (AdjacencyFile != NULL) {1043 if (AdjacencyFile.good()) { 1043 1044 AdjacencyFile << "m\tn" << endl; 1044 1045 ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile); … … 1046 1047 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl); 1047 1048 } else { 1048 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line .str()<< "." << endl);1049 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl); 1049 1050 status = false; 1050 1051 } … … 1056 1057 /** Storing the bond structure of a molecule to file. 1057 1058 * Simply stores Atom::nr and then the Atom::nr of all bond partners, one per line. 1058 * \param *path path tofile1059 * \param *filename name of file1059 * \param &filename name of file 1060 * \param path path to file, defaults to empty 1060 1061 * \return true - file written successfully, false - writing failed 1061 1062 */ 1062 bool molecule::StoreBondsToFile( char *path, char *filename)1063 bool molecule::StoreBondsToFile(std::string &filename, std::string path) 1063 1064 { 1064 1065 ofstream BondFile; 1065 string streamline;1066 string line; 1066 1067 bool status = true; 1067 1068 1068 if (path != NULL)1069 line << path << "/" <<filename;1069 if (path != "") 1070 line = path + "/" + filename; 1070 1071 else 1071 line <<filename;1072 BondFile.open(line. str().c_str(), ios::out);1072 line = filename; 1073 BondFile.open(line.c_str(), ios::out); 1073 1074 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl); 1074 if (BondFile != NULL) {1075 if (BondFile.good()) { 1075 1076 BondFile << "m\tn" << endl; 1076 1077 ActOnAllAtoms(&atom::OutputBonds, &BondFile); … … 1078 1079 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl); 1079 1080 } else { 1080 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line .str()<< "." << endl);1081 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl); 1081 1082 status = false; 1082 1083 } … … 1086 1087 ; 1087 1088 1088 bool CheckAdjacencyFileAgainstMolecule_Init( char *path, ifstream &File, int *&CurrentBonds)1089 { 1090 string streamfilename;1091 filename << path << "/" << FRAGMENTPREFIX <<ADJACENCYFILE;1092 File.open(filename. str().c_str(), ios::out);1089 bool CheckAdjacencyFileAgainstMolecule_Init(std::string &path, ifstream &File, int *&CurrentBonds) 1090 { 1091 string filename; 1092 filename = path + ADJACENCYFILE; 1093 File.open(filename.c_str(), ios::out); 1093 1094 DoLog(1) && (Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... " << endl); 1094 if (File == NULL)1095 if (File.fail()) 1095 1096 return false; 1096 1097 … … 1146 1147 * \return true - structure is equal, false - not equivalence 1147 1148 */ 1148 bool molecule::CheckAdjacencyFileAgainstMolecule( char *path, atom **ListOfAtoms)1149 bool molecule::CheckAdjacencyFileAgainstMolecule(std::string &path, atom **ListOfAtoms) 1149 1150 { 1150 1151 ifstream File; -
src/moleculelist.cpp
rdc0d21 r35b698 380 380 * bonded to the same atom, then we add for this pair a correction term constructed from a Morse 381 381 * potential function fit to QM calculations with respecting to the interatomic hydrogen distance. 382 * \param *out output stream for debugging 383 * \param *path path to file 384 */ 385 bool MoleculeListClass::AddHydrogenCorrection(char *path) 382 * \param &path path to file 383 */ 384 bool MoleculeListClass::AddHydrogenCorrection(std::string &path) 386 385 { 387 386 bond *Binder = NULL; … … 401 400 // 0a. find dimension of matrices with constants 402 401 line = path; 403 line.append("/");404 line += FRAGMENTPREFIX;405 402 line += "1"; 406 403 line += FITCONSTANTSUFFIX; 407 404 input.open(line.c_str()); 408 if (input == NULL) {405 if (input.fail()) { 409 406 DoLog(1) && (Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl); 410 407 return false; … … 570 567 571 568 /** Store force indices, i.e. the connection between the nuclear index in the total molecule config and the respective atom in fragment config. 572 * \param *out output stream for debugging 573 * \param *path path to file 569 * \param &path path to file 574 570 * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config 575 571 * \return true - file written successfully, false - writing failed 576 572 */ 577 bool MoleculeListClass::StoreForcesFile(char *path, 578 int *SortIndex) 573 bool MoleculeListClass::StoreForcesFile(std::string &path, int *SortIndex) 579 574 { 580 575 bool status = true; 581 ofstream ForcesFile; 582 stringstream line; 576 string filename(path); 577 filename += FORCESFILE; 578 ofstream ForcesFile(filename.c_str()); 583 579 periodentafel *periode=World::getInstance().getPeriode(); 584 580 585 581 // open file for the force factors 586 582 DoLog(1) && (Log() << Verbose(1) << "Saving force factors ... "); 587 line << path << "/" << FRAGMENTPREFIX << FORCESFILE; 588 ForcesFile.open(line.str().c_str(), ios::out); 589 if (ForcesFile != NULL) { 583 if (!ForcesFile.fail()) { 590 584 //Log() << Verbose(1) << "Final AtomicForcesList: "; 591 585 //output << prefix << "Forces" << endl; … … 612 606 } else { 613 607 status = false; 614 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str()<< "." << endl);608 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << filename << "." << endl); 615 609 } 616 610 ForcesFile.close(); … … 621 615 /** Writes a config file for each molecule in the given \a **FragmentList. 622 616 * \param *out output stream for debugging 623 * \param *configuration standard configuration to attach atoms in fragment molecule to.617 * \param &prefix path and prefix to the fragment config files 624 618 * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config 625 619 * \return true - success (each file was written), false - something went wrong. 626 620 */ 627 bool MoleculeListClass::OutputConfigForListOfFragments( config *configuration, int *SortIndex)621 bool MoleculeListClass::OutputConfigForListOfFragments(std::string &prefix, int *SortIndex) 628 622 { 629 623 ofstream outputFragment; 630 char FragmentName[MAXSTRINGSIZE];624 std::string FragmentName; 631 625 char PathBackup[MAXSTRINGSIZE]; 632 626 bool result = true; … … 646 640 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 647 641 // save default path as it is changed for each fragment 648 path = configuration->GetDefaultPath();642 path = World::getInstance().getConfig()->GetDefaultPath(); 649 643 if (path != NULL) 650 644 strcpy(PathBackup, path); … … 659 653 // output xyz file 660 654 FragmentNumber = FixedDigitNumber(ListOfMolecules.size(), FragmentCounter++); 661 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);662 outputFragment.open(FragmentName , ios::out);655 FragmentName = prefix + FragmentNumber + ".conf.xyz"; 656 outputFragment.open(FragmentName.c_str(), ios::out); 663 657 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ..."); 664 658 if ((intermediateResult = (*ListRunner)->OutputXYZ(&outputFragment))) … … 683 677 for (int k = 0; k < NDIM; k++) { 684 678 j += k + 1; 685 BoxDimension[k] = 2.5 * ( configuration->GetIsAngstroem() ? 1. : 1. / AtomicLengthToAngstroem);679 BoxDimension[k] = 2.5 * (World::getInstance().getConfig()->GetIsAngstroem() ? 1. : 1. / AtomicLengthToAngstroem); 686 680 cell_size[j] = BoxDimension[k] * 2.; 687 681 } … … 690 684 // also calculate necessary orbitals 691 685 (*ListRunner)->CountElements(); // this is a bugfix, atoms should shoulds actually be added correctly to this fragment 692 (*ListRunner)->CalculateOrbitals(*configuration);686 //(*ListRunner)->CalculateOrbitals(*World::getInstance().getConfig); 693 687 694 688 // change path in config 695 //strcpy(PathBackup, configuration->configpath); 696 sprintf(FragmentName, "%s/%s%s/", PathBackup, FRAGMENTPREFIX, FragmentNumber); 697 configuration->SetDefaultPath(FragmentName); 689 FragmentName = PathBackup; 690 FragmentName += "/"; 691 FragmentName += FRAGMENTPREFIX; 692 FragmentName += FragmentNumber; 693 FragmentName += "/"; 694 World::getInstance().getConfig()->SetDefaultPath(FragmentName.c_str()); 698 695 699 696 // and save as config 700 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);697 FragmentName = prefix + FragmentNumber + ".conf"; 701 698 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ..."); 702 if ((intermediateResult = configuration->Save(FragmentName, (*ListRunner)->elemente, (*ListRunner))))699 if ((intermediateResult = World::getInstance().getConfig()->Save(FragmentName.c_str(), (*ListRunner)->elemente, (*ListRunner)))) 703 700 DoLog(0) && (Log() << Verbose(0) << " done." << endl); 704 701 else … … 707 704 708 705 // restore old config 709 configuration->SetDefaultPath(PathBackup);706 World::getInstance().getConfig()->SetDefaultPath(PathBackup); 710 707 711 708 // and save as mpqc input file 712 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber);709 FragmentName = prefix + FragmentNumber + ".conf"; 713 710 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ..."); 714 if ((intermediateResult = configuration->SaveMPQC(FragmentName, (*ListRunner))))711 if ((intermediateResult = World::getInstance().getConfig()->SaveMPQC(FragmentName.c_str(), (*ListRunner)))) 715 712 DoLog(2) && (Log() << Verbose(2) << " done." << endl); 716 713 else … … 768 765 769 766 // 1. dissect the molecule into connected subgraphs 770 if (!configuration->BG->ConstructBondGraph(mol)) { 771 World::getInstance().destroyMolecule(mol); 772 DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl); 767 if (configuration->BG != NULL) { 768 if (!configuration->BG->ConstructBondGraph(mol)) { 769 World::getInstance().destroyMolecule(mol); 770 DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl); 771 return; 772 } 773 } else { 774 DoeLog(1) && (eLog()<< Verbose(1) << "There is no BondGraph class present to create bonds." << endl); 773 775 return; 774 776 } -
src/unittests/Makefile.am
rdc0d21 r35b698 52 52 GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} 53 53 ALLLIBS = ../libmolecuilder.a ${GSLLIBS} 54 PARSERLIBS = ../libparser.a ${ALLLIBS} 54 55 55 56 TESTSOURCES = \ … … 201 202 202 203 ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp 203 ParserUnitTest_LDADD = ${ ALLLIBS}204 ParserUnitTest_LDADD = ${PARSERLIBS} 204 205 205 206 periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp -
tests/regression/Domain/6/post/test-x.conf.xyz
rdc0d21 r35b698 1 1 22 2 2 Created by molecuilder on Mon May 31 19:07:16 2010 3 H 9.78209 2.64589 2.64589 4 C 27.2836 3.27519 3.53589 5 C 28.5328 4.15859 3.53589 6 C 29.7821 3.27519 3.53589 7 H 27.2836 2.64589 4.42589 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 27.2836 2.64589 2.64589 12 H 26.3936 3.90454 3.53589 13 H 28.5328 4.78789 4.42589 14 H 28.5328 4.78789 2.64589 15 H 30.672 3.90454 3.53589 16 H 29.7821 2.64589 4.42589 17 H 29.7821 2.64589 2.64589 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 3 H 9.78209 2.64589 2.64589 4 C 27.2836 3.27519 3.53589 5 C 28.5328 4.15859 3.53589 6 C 29.7821 3.27519 3.53589 7 H 27.2836 2.64589 4.42589 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 27.2836 2.64589 2.64589 12 H 26.3936 3.90454 3.53589 13 H 28.5328 4.78789 4.42589 14 H 28.5328 4.78789 2.64589 15 H 30.672 3.90454 3.53589 16 H 29.7821 2.64589 4.42589 17 H 29.7821 2.64589 2.64589 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 -
tests/regression/Domain/6/post/test-y.conf.xyz
rdc0d21 r35b698 1 1 22 2 2 Created by molecuilder on Mon May 31 19:07:16 2010 3 H 9.78209 2.64589 2.64589 4 C 7.28359 23.2752 3.53589 5 C 8.53279 24.1586 3.53589 6 C 9.78209 23.2752 3.53589 7 H 7.28359 22.6459 4.42589 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 7.28359 22.6459 2.64589 12 H 6.39363 23.9045 3.53589 13 H 8.53279 24.7879 4.42589 14 H 8.53279 24.7879 2.64589 15 H 10.672 23.9045 3.53589 16 H 9.78209 22.6459 4.42589 17 H 9.78209 22.6459 2.64589 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 3 H 9.78209 2.64589 2.64589 4 C 7.28359 23.2752 3.53589 5 C 8.53279 24.1586 3.53589 6 C 9.78209 23.2752 3.53589 7 H 7.28359 22.6459 4.42589 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 7.28359 22.6459 2.64589 12 H 6.39363 23.9045 3.53589 13 H 8.53279 24.7879 4.42589 14 H 8.53279 24.7879 2.64589 15 H 10.672 23.9045 3.53589 16 H 9.78209 22.6459 4.42589 17 H 9.78209 22.6459 2.64589 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 -
tests/regression/Domain/6/post/test-z.conf.xyz
rdc0d21 r35b698 1 1 22 2 2 Created by molecuilder on Mon May 31 19:07:16 2010 3 H 9.78209 2.64589 2.64589 4 C 7.28359 3.27519 23.5359 5 C 8.53279 4.15859 23.5359 6 C 9.78209 3.27519 23.5359 7 H 7.28359 2.64589 24.4259 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 7.28359 2.64589 22.6459 12 H 6.39363 3.90454 23.5359 13 H 8.53279 4.78789 24.4259 14 H 8.53279 4.78789 22.6459 15 H 10.672 3.90454 23.5359 16 H 9.78209 2.64589 24.4259 17 H 9.78209 2.64589 22.6459 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 3 H 9.78209 2.64589 2.64589 4 C 7.28359 3.27519 23.5359 5 C 8.53279 4.15859 23.5359 6 C 9.78209 3.27519 23.5359 7 H 7.28359 2.64589 24.4259 8 H 9.78209 2.64589 4.42589 9 H 10.672 3.90454 3.53589 10 H 8.53279 4.78789 2.64589 11 H 7.28359 2.64589 22.6459 12 H 6.39363 3.90454 23.5359 13 H 8.53279 4.78789 24.4259 14 H 8.53279 4.78789 22.6459 15 H 10.672 3.90454 23.5359 16 H 9.78209 2.64589 24.4259 17 H 9.78209 2.64589 22.6459 18 H 8.53279 4.78789 4.42589 19 H 6.39363 3.90454 3.53589 20 H 7.28359 2.64589 2.64589 21 H 7.28359 2.64589 4.42589 22 C 9.78209 3.27519 3.53589 23 C 8.53279 4.15859 3.53589 24 C 7.28359 3.27519 3.53589 -
tests/regression/Domain/6/post/test.conf.xyz
rdc0d21 r35b698 1 1 11 2 2 Created by molecuilder on Mon May 31 19:21:12 2010 3 H 9.78209 2.64589 2.64589 4 H 9.78209 2.64589 4.42589 5 H 10.672 3.90454 3.53589 6 H 8.53279 4.78789 2.64589 7 H 8.53279 4.78789 4.42589 8 H 6.39363 3.90454 3.53589 9 H 7.28359 2.64589 2.64589 10 H 7.28359 2.64589 4.42589 11 C 9.78209 3.27519 3.53589 12 C 8.53279 4.15859 3.53589 13 C 7.28359 3.27519 3.53589 3 H 9.78209 2.64589 2.64589 4 H 9.78209 2.64589 4.42589 5 H 10.672 3.90454 3.53589 6 H 8.53279 4.78789 2.64589 7 H 8.53279 4.78789 4.42589 8 H 6.39363 3.90454 3.53589 9 H 7.28359 2.64589 2.64589 10 H 7.28359 2.64589 4.42589 11 C 9.78209 3.27519 3.53589 12 C 8.53279 4.15859 3.53589 13 C 7.28359 3.27519 3.53589 -
tests/regression/Filling/1/post/test.conf
rdc0d21 r35b698 35 35 RelEpsTotalE 1e-07 # relative change in total energy 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 MaxMinStopStep 1350 # check every ..th steps37 MaxMinStopStep 680 # check every ..th steps 38 38 MaxMinGapStopStep 1 # check every ..th steps 39 39 … … 42 42 InitRelEpsTotalE 1e-05 # relative change in total energy 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 InitMaxMinStopStep 1350 # check every ..th steps44 InitMaxMinStopStep 680 # check every ..th steps 45 45 InitMaxMinGapStopStep 1 # check every ..th steps 46 46 … … 55 55 RiemannTensor 0 # (Use metric) 56 56 PsiType 0 # 0 - doubly occupied, 1 - SpinUp,SpinDown 57 MaxPsiDouble 1350 # here: specifying both maximum number of SpinUp- and -Down-states58 PsiMaxNoUp 1350 # here: specifying maximum number of SpinUp-states59 PsiMaxNoDown 1350 # here: specifying maximum number of SpinDown-states57 MaxPsiDouble 680 # here: specifying both maximum number of SpinUp- and -Down-states 58 PsiMaxNoUp 680 # here: specifying maximum number of SpinUp-states 59 PsiMaxNoDown 680 # here: specifying maximum number of SpinDown-states 60 60 AddPsis 0 # Additional unoccupied Psis for bandgap determination 61 61 -
tests/regression/Simple_configuration/2/post/test.conf.xyz
rdc0d21 r35b698 1 1 1 2 2 Created by molecuilder on Tue Oct 6 18:34:23 2009 3 H 10 10 10 3 H 10 10 10 -
tests/regression/Simple_configuration/3/post/test.conf.xyz
rdc0d21 r35b698 1 1 1 2 2 Created by molecuilder on Tue Oct 6 18:34:23 2009 3 H 10 10 10 3 H 10 10 10 -
tests/regression/Simple_configuration/4/post/test.conf
rdc0d21 r35b698 35 35 RelEpsTotalE 1e-07 # relative change in total energy 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 MaxMinStopStep 1# check every ..th steps37 MaxMinStopStep 2 # check every ..th steps 38 38 MaxMinGapStopStep 1 # check every ..th steps 39 39 … … 42 42 InitRelEpsTotalE 1e-05 # relative change in total energy 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 InitMaxMinStopStep 1# check every ..th steps44 InitMaxMinStopStep 2 # check every ..th steps 45 45 InitMaxMinGapStopStep 1 # check every ..th steps 46 46 … … 54 54 Level0Factor 2 # factor by which node number increases from S to 0 level 55 55 RiemannTensor 0 # (Use metric) 56 PsiType 1# 0 - doubly occupied, 1 - SpinUp,SpinDown57 MaxPsiDouble 0# here: specifying both maximum number of SpinUp- and -Down-states58 PsiMaxNoUp 0# here: specifying maximum number of SpinUp-states59 PsiMaxNoDown 1# here: specifying maximum number of SpinDown-states56 PsiType 0 # 0 - doubly occupied, 1 - SpinUp,SpinDown 57 MaxPsiDouble 2 # here: specifying both maximum number of SpinUp- and -Down-states 58 PsiMaxNoUp 2 # here: specifying maximum number of SpinUp-states 59 PsiMaxNoDown 2 # here: specifying maximum number of SpinDown-states 60 60 AddPsis 0 # Additional unoccupied Psis for bandgap determination 61 61 -
tests/regression/Simple_configuration/4/post/test.conf.xyz
rdc0d21 r35b698 1 1 1 2 2 Created by molecuilder on Tue Oct 6 18:31:23 2009 3 C 10 10 10 3 C 10 10 10 -
tests/regression/Simple_configuration/5/post/test.conf
rdc0d21 r35b698 35 35 RelEpsTotalE 1e-07 # relative change in total energy 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 MaxMinStopStep 1# check every ..th steps37 MaxMinStopStep 0 # check every ..th steps 38 38 MaxMinGapStopStep 1 # check every ..th steps 39 39 … … 42 42 InitRelEpsTotalE 1e-05 # relative change in total energy 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 InitMaxMinStopStep 1# check every ..th steps44 InitMaxMinStopStep 0 # check every ..th steps 45 45 InitMaxMinGapStopStep 1 # check every ..th steps 46 46 … … 54 54 Level0Factor 2 # factor by which node number increases from S to 0 level 55 55 RiemannTensor 0 # (Use metric) 56 PsiType 1# 0 - doubly occupied, 1 - SpinUp,SpinDown56 PsiType 0 # 0 - doubly occupied, 1 - SpinUp,SpinDown 57 57 MaxPsiDouble 0 # here: specifying both maximum number of SpinUp- and -Down-states 58 58 PsiMaxNoUp 0 # here: specifying maximum number of SpinUp-states 59 PsiMaxNoDown 1# here: specifying maximum number of SpinDown-states59 PsiMaxNoDown 0 # here: specifying maximum number of SpinDown-states 60 60 AddPsis 0 # Additional unoccupied Psis for bandgap determination 61 61 -
tests/regression/Simple_configuration/8/post/test.conf.xyz
rdc0d21 r35b698 1 1 144 2 2 Created by molecuilder on Mon May 31 18:50:20 2010 3 H 9.78209 2.64589 2.64589 4 H 9.78209 2.64589 4.42589 5 H 10.672 3.90454 3.53589 6 H 8.53279 4.78789 2.64589 7 H 8.53279 4.78789 4.42589 8 H 6.39363 3.90454 3.53589 9 H 7.28359 2.64589 2.64589 10 H 7.28359 2.64589 4.42589 11 H 0.758602 2.85714 3.86571 12 H 0.758602 2.85714 2.85714 13 H 0.758602 2.85714 5.71429 14 H 0.758602 5.71429 3.86571 15 H 0.758602 5.71429 2.85714 16 H 3.61574 0 1.00857 17 H 3.61574 0 0 18 H 3.61574 0 3.86571 19 H 3.61574 0 2.85714 20 H 3.61574 0 6.72285 21 H 3.61574 0 5.71429 22 H 3.61574 2.85714 1.00857 23 H 3.61574 2.85714 0 24 H 3.61574 2.85714 3.86571 25 H 3.61574 2.85714 2.85714 26 H 3.61574 2.85714 6.72285 27 H 3.61574 2.85714 5.71429 28 H 3.61574 2.85714 8.57143 29 H 3.61574 5.71429 1.00857 30 H 3.61574 5.71429 0 31 H 3.61574 5.71429 3.86571 32 H 3.61574 5.71429 2.85714 33 H 3.61574 5.71429 6.72285 34 H 3.61574 5.71429 5.71429 35 H 3.61574 5.71429 8.57143 36 H 3.61574 8.57143 1.00857 37 H 3.61574 8.57143 3.86571 38 H 3.61574 8.57143 2.85714 39 H 3.61574 8.57143 5.71429 40 H 6.47289 0 1.00857 41 H 6.47289 0 0 42 H 6.47289 0 3.86571 43 H 6.47289 0 2.85714 44 H 6.47289 0 6.72285 45 H 6.47289 0 5.71429 46 H 6.47289 0 9.58 47 H 6.47289 0 8.57143 48 H 6.47289 2.85714 0 49 H 6.47289 2.85714 6.72285 50 H 6.47289 2.85714 9.58 51 H 6.47289 2.85714 8.57143 52 H 6.47289 5.71429 1.00857 53 H 6.47289 5.71429 0 54 H 6.47289 5.71429 6.72285 55 H 6.47289 5.71429 5.71429 56 H 6.47289 5.71429 9.58 57 H 6.47289 5.71429 8.57143 58 H 6.47289 8.57143 1.00857 59 H 6.47289 8.57143 0 60 H 6.47289 8.57143 3.86571 61 H 6.47289 8.57143 2.85714 62 H 6.47289 8.57143 6.72285 63 H 6.47289 8.57143 5.71429 64 H 9.33003 0 1.00857 65 H 9.33003 0 0 66 H 9.33003 0 3.86571 67 H 9.33003 0 2.85714 68 H 9.33003 0 6.72285 69 H 9.33003 0 5.71429 70 H 9.33003 0 8.57143 71 H 9.33003 2.85714 0 72 H 9.33003 2.85714 6.72285 73 H 9.33003 2.85714 9.58 74 H 9.33003 2.85714 8.57143 75 H 9.33003 5.71429 0 76 H 9.33003 5.71429 6.72285 77 H 9.33003 5.71429 9.58 78 H 9.33003 5.71429 8.57143 79 H 9.33003 8.57143 1.00857 80 H 9.33003 8.57143 0 81 H 9.33003 8.57143 3.86571 82 H 9.33003 8.57143 2.85714 83 H 9.33003 8.57143 6.72285 84 H 9.33003 8.57143 5.71429 85 H 12.1872 0 1.00857 86 H 12.1872 0 0 87 H 12.1872 0 3.86571 88 H 12.1872 0 2.85714 89 H 12.1872 0 6.72285 90 H 12.1872 0 5.71429 91 H 12.1872 2.85714 1.00857 92 H 12.1872 2.85714 0 93 H 12.1872 2.85714 6.72285 94 H 12.1872 2.85714 5.71429 95 H 12.1872 5.71429 1.00857 96 H 12.1872 5.71429 0 97 H 12.1872 5.71429 3.86571 98 H 12.1872 5.71429 2.85714 99 H 12.1872 5.71429 6.72285 100 H 12.1872 5.71429 5.71429 101 C 9.78209 3.27519 3.53589 102 C 8.53279 4.15859 3.53589 103 C 7.28359 3.27519 3.53589 104 O 2.85714 0 0.504284 105 O 2.85714 0 3.36143 106 O 2.85714 0 6.21857 107 O 2.85714 2.85714 0.504284 108 O 2.85714 2.85714 3.36143 109 O 2.85714 2.85714 6.21857 110 O 2.85714 5.71429 0.504284 111 O 2.85714 5.71429 3.36143 112 O 2.85714 5.71429 6.21857 113 O 2.85714 8.57143 3.36143 114 O 5.71429 0 0.504284 115 O 5.71429 0 3.36143 116 O 5.71429 0 6.21857 117 O 5.71429 0 9.07571 118 O 5.71429 2.85714 0.504284 119 O 5.71429 2.85714 6.21857 120 O 5.71429 2.85714 9.07571 121 O 5.71429 5.71429 0.504284 122 O 5.71429 5.71429 6.21857 123 O 5.71429 5.71429 9.07571 124 O 5.71429 8.57143 0.504284 125 O 5.71429 8.57143 3.36143 126 O 5.71429 8.57143 6.21857 127 O 8.57143 0 0.504284 128 O 8.57143 0 3.36143 129 O 8.57143 0 6.21857 130 O 8.57143 0 9.07571 131 O 8.57143 2.85714 0.504284 132 O 8.57143 2.85714 9.07571 133 O 8.57143 5.71429 0.504284 134 O 8.57143 5.71429 9.07571 135 O 8.57143 8.57143 0.504284 136 O 8.57143 8.57143 3.36143 137 O 8.57143 8.57143 6.21857 138 O 11.4286 0 0.504284 139 O 11.4286 0 3.36143 140 O 11.4286 0 6.21857 141 O 11.4286 2.85714 0.504284 142 O 11.4286 2.85714 6.21857 143 O 11.4286 2.85714 9.07571 144 O 11.4286 5.71429 0.504284 145 O 11.4286 5.71429 6.21857 146 O 11.4286 8.57143 3.36143 3 H 9.78209 2.64589 2.64589 4 H 9.78209 2.64589 4.42589 5 H 10.672 3.90454 3.53589 6 H 8.53279 4.78789 2.64589 7 H 8.53279 4.78789 4.42589 8 H 6.39363 3.90454 3.53589 9 H 7.28359 2.64589 2.64589 10 H 7.28359 2.64589 4.42589 11 H 0.758602 2.85714 3.86571 12 H 0.758602 2.85714 2.85714 13 H 0.758602 2.85714 5.71429 14 H 0.758602 5.71429 3.86571 15 H 0.758602 5.71429 2.85714 16 H 3.61574 0 1.00857 17 H 3.61574 0 0 18 H 3.61574 0 3.86571 19 H 3.61574 0 2.85714 20 H 3.61574 0 6.72285 21 H 3.61574 0 5.71429 22 H 3.61574 2.85714 1.00857 23 H 3.61574 2.85714 0 24 H 3.61574 2.85714 3.86571 25 H 3.61574 2.85714 2.85714 26 H 3.61574 2.85714 6.72285 27 H 3.61574 2.85714 5.71429 28 H 3.61574 2.85714 8.57143 29 H 3.61574 5.71429 1.00857 30 H 3.61574 5.71429 0 31 H 3.61574 5.71429 3.86571 32 H 3.61574 5.71429 2.85714 33 H 3.61574 5.71429 6.72285 34 H 3.61574 5.71429 5.71429 35 H 3.61574 5.71429 8.57143 36 H 3.61574 8.57143 1.00857 37 H 3.61574 8.57143 3.86571 38 H 3.61574 8.57143 2.85714 39 H 3.61574 8.57143 5.71429 40 H 6.47289 0 1.00857 41 H 6.47289 0 0 42 H 6.47289 0 3.86571 43 H 6.47289 0 2.85714 44 H 6.47289 0 6.72285 45 H 6.47289 0 5.71429 46 H 6.47289 0 9.58 47 H 6.47289 0 8.57143 48 H 6.47289 2.85714 0 49 H 6.47289 2.85714 6.72285 50 H 6.47289 2.85714 9.58 51 H 6.47289 2.85714 8.57143 52 H 6.47289 5.71429 1.00857 53 H 6.47289 5.71429 0 54 H 6.47289 5.71429 6.72285 55 H 6.47289 5.71429 5.71429 56 H 6.47289 5.71429 9.58 57 H 6.47289 5.71429 8.57143 58 H 6.47289 8.57143 1.00857 59 H 6.47289 8.57143 0 60 H 6.47289 8.57143 3.86571 61 H 6.47289 8.57143 2.85714 62 H 6.47289 8.57143 6.72285 63 H 6.47289 8.57143 5.71429 64 H 9.33003 0 1.00857 65 H 9.33003 0 0 66 H 9.33003 0 3.86571 67 H 9.33003 0 2.85714 68 H 9.33003 0 6.72285 69 H 9.33003 0 5.71429 70 H 9.33003 0 8.57143 71 H 9.33003 2.85714 0 72 H 9.33003 2.85714 6.72285 73 H 9.33003 2.85714 9.58 74 H 9.33003 2.85714 8.57143 75 H 9.33003 5.71429 0 76 H 9.33003 5.71429 6.72285 77 H 9.33003 5.71429 9.58 78 H 9.33003 5.71429 8.57143 79 H 9.33003 8.57143 1.00857 80 H 9.33003 8.57143 0 81 H 9.33003 8.57143 3.86571 82 H 9.33003 8.57143 2.85714 83 H 9.33003 8.57143 6.72285 84 H 9.33003 8.57143 5.71429 85 H 12.1872 0 1.00857 86 H 12.1872 0 0 87 H 12.1872 0 3.86571 88 H 12.1872 0 2.85714 89 H 12.1872 0 6.72285 90 H 12.1872 0 5.71429 91 H 12.1872 2.85714 1.00857 92 H 12.1872 2.85714 0 93 H 12.1872 2.85714 6.72285 94 H 12.1872 2.85714 5.71429 95 H 12.1872 5.71429 1.00857 96 H 12.1872 5.71429 0 97 H 12.1872 5.71429 3.86571 98 H 12.1872 5.71429 2.85714 99 H 12.1872 5.71429 6.72285 100 H 12.1872 5.71429 5.71429 101 C 9.78209 3.27519 3.53589 102 C 8.53279 4.15859 3.53589 103 C 7.28359 3.27519 3.53589 104 O 2.85714 0 0.504284 105 O 2.85714 0 3.36143 106 O 2.85714 0 6.21857 107 O 2.85714 2.85714 0.504284 108 O 2.85714 2.85714 3.36143 109 O 2.85714 2.85714 6.21857 110 O 2.85714 5.71429 0.504284 111 O 2.85714 5.71429 3.36143 112 O 2.85714 5.71429 6.21857 113 O 2.85714 8.57143 3.36143 114 O 5.71429 0 0.504284 115 O 5.71429 0 3.36143 116 O 5.71429 0 6.21857 117 O 5.71429 0 9.07571 118 O 5.71429 2.85714 0.504284 119 O 5.71429 2.85714 6.21857 120 O 5.71429 2.85714 9.07571 121 O 5.71429 5.71429 0.504284 122 O 5.71429 5.71429 6.21857 123 O 5.71429 5.71429 9.07571 124 O 5.71429 8.57143 0.504284 125 O 5.71429 8.57143 3.36143 126 O 5.71429 8.57143 6.21857 127 O 8.57143 0 0.504284 128 O 8.57143 0 3.36143 129 O 8.57143 0 6.21857 130 O 8.57143 0 9.07571 131 O 8.57143 2.85714 0.504284 132 O 8.57143 2.85714 9.07571 133 O 8.57143 5.71429 0.504284 134 O 8.57143 5.71429 9.07571 135 O 8.57143 8.57143 0.504284 136 O 8.57143 8.57143 3.36143 137 O 8.57143 8.57143 6.21857 138 O 11.4286 0 0.504284 139 O 11.4286 0 3.36143 140 O 11.4286 0 6.21857 141 O 11.4286 2.85714 0.504284 142 O 11.4286 2.85714 6.21857 143 O 11.4286 2.85714 9.07571 144 O 11.4286 5.71429 0.504284 145 O 11.4286 5.71429 6.21857 146 O 11.4286 8.57143 3.36143 -
tests/regression/testsuite-fragmentation.at
rdc0d21 r35b698 12 12 AT_SETUP([Fragmentation - Fragmentation]) 13 13 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Fragmentation/2/pre/test.conf .], 0) 14 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f 0 --distance 1.55 --order 2], 0, [ignore], [ignore])14 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f ./BondFragment --molecule-by-id 0 --distance 1.55 --order 2], 0, [ignore], [ignore]) 15 15 AT_CHECK([ls -l BondFragment*.conf | wc -l], 0, [5 16 16 ], [ignore]) … … 21 21 AT_SETUP([Fragmentation - BROKEN: Fragmentation is at MaxOrder]) 22 22 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Fragmentation/3/pre/test.conf .], 0) 23 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f 0 --distance 1.55 --order 2], 0, [ignore], [ignore])24 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f 0 --distance 1.55 --order 2], [ignore], [ignore], [ignore])23 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f ./BondFragment --molecule-by-id 0 --distance 1.55 --order 2], 0, [ignore], [ignore]) 24 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 1 -f ./BondFragment --molecule-by-id 0 --distance 1.55 --order 2], [ignore], [ignore], [ignore]) 25 25 AT_CLEANUP
Note:
See TracChangeset
for help on using the changeset viewer.