Changeset 4885953


Ignore:
Timestamp:
Apr 29, 2008, 7:45:23 AM (17 years ago)
Author:
Frederik Heber <heber@…>
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:
1fa5b7
Parents:
04980c
Message:

changed config file to first argument again and standard config name incorporated.

./molecuilder -e elements.db is hard to scan whether elements.db is the config file or a further argument, hence switch-back to old method of having it in the first place. (this also matches all the scripts written so far again).

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    r04980c r4885953  
    700700  if (ConfigFileName != NULL) {
    701701    output.open(ConfigFileName, ios::trunc);
    702   } else {
     702  } else if (strlen(configuration->configname) != 0) {
    703703    output.open(configuration->configname, ios::trunc);
    704   }
     704    } else {
     705      output.open(DEFAULTCONFIG, ios::trunc);
     706    }
    705707  if (configuration->Save(&output, periode, mol))
    706708    cout << Verbose(0) << "Saving of config file successful." << endl;
     
    779781          case '?':
    780782            cout << "MoleCuilder suite" << endl << "==================" << endl << endl;
    781             cout << "Usage: " << argv[0] << "[-{acepsthH?vfrp}] [further arguments] [config file]" << endl;
     783            cout << "Usage: " << argv[0] << "[config file] [-{acepsthH?vfrp}] [further arguments]" << endl;
    782784            cout << "or simply " << argv[0] << " without arguments for interactive session." << endl;
    783785            cout << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;
     
    814816          } else
    815817            argptr++;
    816     } while (argptr < (argc-1));
     818    } while (argptr < argc);
     819       
    817820        // 2. Parse the element database
    818821    if (periode->LoadPeriodentafel(ElementsFileName))
     
    820823    else
    821824      cout << Verbose(0) << "Element list loading failed." << endl;
     825   
    822826        // 3. Find config file name and parse if possible
    823     if (argv[argc-1][0] != '-') {
     827    if (argv[1][0] != '-') {
    824828      cout << Verbose(0) << "Config file given." << endl;
    825       test.open(argv[argc-1], ios::in);
     829      test.open(argv[1], ios::in);
    826830      if (test == NULL) {
    827831        //return (1);
    828         output.open(argv[argc-1], ios::out);
     832        output.open(argv[1], ios::out);
    829833        if (output == NULL) {
    830           cout << Verbose(1) << "Specified config file " << argv[argc-1] << " not found." << endl;
     834          cout << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;
    831835          config_present = absent;
    832836        } else {
    833837          cout << "Empty configuration file." << endl;
    834           ConfigFileName = argv[argc-1];
     838          ConfigFileName = argv[1];
    835839          config_present = empty;
    836840          output.close();
     
    838842      } else {
    839843        test.close();
    840         ConfigFileName = argv[argc-1];
     844        ConfigFileName = argv[1];
    841845        cout << Verbose(1) << "Specified config file found, parsing ...";
    842846        switch (configuration.TestSyntax(ConfigFileName, periode, mol)) {
     
    858862    } else
    859863      config_present = absent;
     864   
    860865    // 4. parse again through options, now for those depending on elements db and config presence
    861866    argptr = 1;
     
    951956                int i,j;
    952957                flag = 1;
    953                 if (argc > argptr+3) {
     958                cout << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << " and type " << argv[argptr+2] << "." << endl;
     959                if (argc >= argptr+3) {
    954960                  cout << Verbose(0) << "Creating connection matrix..." << endl;
    955961                  start = clock();
     
    10011007                  cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
    10021008                  argptr+=2;
     1009                } else {
     1010                  cerr << "Not enough arguments for fragmentation: -f <max. bond distance> <bond order> <type>" << endl;
    10031011                }
    10041012                break;
     
    10071015                break;
    10081016            }
    1009           } else {
    1010             cout << "Cannot apply command line parameter as no valid config file was found." << endl;
    1011             return 1;
    10121017          }
    10131018        }
    10141019          } else argptr++;
    1015         } while (argptr < (argc-1));
     1020        } while (argptr < argc);
    10161021    if (flag == 1) { // 1 means save and exit
    10171022      SaveConfig(ConfigFileName, &configuration, periode, mol);
     
    10251030    else
    10261031      cout << Verbose(0) << "Element list loading failed." << endl;
    1027     config_present = absent;
    10281032    configuration.RetrieveConfigPathAndName("main_pcp_linux");
    10291033  }
  • src/defs.hpp

    r04980c r4885953  
    3838
    3939// various standard filenames
     40#define DEFAULTCONFIG "main_pcp_linux"
    4041#define KEYSETFILE "KeySets.dat"
    4142#define ADJACENCYFILE "Adjacency.dat"
Note: See TracChangeset for help on using the changeset viewer.