Changeset 6ca1f7
- Timestamp:
- May 30, 2010, 11:03:49 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:
- 2a92ff
- Parents:
- 26f75a
- git-author:
- Frederik Heber <heber@…> (05/30/10 22:52:33)
- git-committer:
- Frederik Heber <heber@…> (05/30/10 23:03:49)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
r26f75a r6ca1f7 93 93 ShortFormMap["boundary"] = "c"; 94 94 ShortFormMap["bound-in-box"] = "B"; 95 ShortFormMap["change-box"] = "B"; 95 96 ShortFormMap["center-edge"] = "O"; 96 97 ShortFormMap["center-in-box"] = "b"; … … 189 190 // generic.insert("center-edge"); 190 191 // generic.insert("center-in-box"); 191 //generic.insert("change-box");192 generic.insert("change-box"); 192 193 // generic.insert("change-molname"); 193 194 // generic.insert("change-element"); -
src/builder.cpp
r26f75a r6ca1f7 1495 1495 */ 1496 1496 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1497 config& configuration, char * &ConfigFileName, set<int> &ArgcList)1497 config& configuration, char **ConfigFileName, set<int> &ArgcList) 1498 1498 { 1499 1499 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1540 1540 break; 1541 1541 case 'B': 1542 ArgcList.insert(argptr-1); 1543 ArgcList.insert(argptr); 1544 ArgcList.insert(argptr+1); 1545 ArgcList.insert(argptr+2); 1546 ArgcList.insert(argptr+3); 1547 ArgcList.insert(argptr+4); 1548 ArgcList.insert(argptr+5); 1549 argptr+=6; 1542 1550 if (ExitFlag == 0) ExitFlag = 1; 1543 if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {1544 ExitFlag = 255;1545 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl);1546 performCriticalExit();1547 } else {1548 SaveFlag = true;1549 j = -1;1550 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl);1551 double * const cell_size = World::getInstance().getDomain();1552 for (int i=0;i<6;i++) {1553 cell_size[i] = atof(argv[argptr+i]);1554 }1555 argptr+=6;1556 }1557 1551 break; 1558 1552 case 'e': … … 1626 1620 } else { 1627 1621 DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl); 1628 ConfigFileName = argv[1];1622 strcpy(*ConfigFileName, argv[1]); 1629 1623 configPresent = empty; 1630 1624 output.close(); … … 1632 1626 } else { 1633 1627 test.close(); 1634 ConfigFileName = argv[1];1628 strcpy(*ConfigFileName, argv[1]); 1635 1629 DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... "); 1636 switch (configuration.TestSyntax( ConfigFileName, periode)) {1630 switch (configuration.TestSyntax(*ConfigFileName, periode)) { 1637 1631 case 1: 1638 1632 DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl); 1639 configuration.Load( ConfigFileName, BondGraphFileName, periode, molecules);1633 configuration.Load(*ConfigFileName, BondGraphFileName, periode, molecules); 1640 1634 configPresent = present; 1641 1635 break; 1642 1636 case 0: 1643 1637 DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl); 1644 configuration.LoadOld( ConfigFileName, BondGraphFileName, periode, molecules);1638 configuration.LoadOld(*ConfigFileName, BondGraphFileName, periode, molecules); 1645 1639 configPresent = present; 1646 1640 break; … … 1663 1657 mol = World::getInstance().createMolecule(); 1664 1658 mol->ActiveFlag = true; 1665 if ( ConfigFileName != NULL)1666 mol->SetNameFromFilename( ConfigFileName);1659 if (*ConfigFileName != NULL) 1660 mol->SetNameFromFilename(*ConfigFileName); 1667 1661 molecules->insert(mol); 1668 1662 } … … 2449 2443 } while (argptr < argc); 2450 2444 if (SaveFlag) 2451 configuration.SaveAll( ConfigFileName, periode, molecules);2445 configuration.SaveAll(*ConfigFileName, periode, molecules); 2452 2446 } else { // no arguments, hence scan the elements db 2453 2447 if (periode->LoadPeriodentafel(configuration.databasepath)) … … 2490 2484 int ExitFlag = 0; 2491 2485 bool ArgumentsCopied = false; 2486 char *ConfigFileName = new char[MAXSTRINGSIZE]; 2492 2487 2493 2488 // print version check whether arguments are present at all … … 2514 2509 ArgcList.insert(0); // push back program! 2515 2510 ArgcList.insert(1); // push back config file name 2516 char ConfigFileName[MAXSTRINGSIZE];2517 2511 // handle arguments by ParseCommandLineOptions() 2518 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList);2512 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, ArgcList); 2519 2513 // copy all remaining arguments to a new argv 2520 2514 Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments"); … … 2546 2540 } 2547 2541 2542 Log() << Verbose(0) << "Saving to " << ConfigFileName << "." << endl; 2543 World::getInstance().getConfig()->SaveAll(ConfigFileName, World::getInstance().getPeriode(), World::getInstance().getMolecules()); 2548 2544 if(World::getInstance().getPeriode()->StorePeriodentafel(configuration->databasepath)) 2549 2545 Log() << Verbose(0) << "Saving of elements.db successful." << endl; … … 2558 2554 Free(&Arguments); 2559 2555 } 2556 delete[](ConfigFileName); 2560 2557 2561 2558 return (ExitFlag == 1 ? 0 : ExitFlag);
Note:
See TracChangeset
for help on using the changeset viewer.