- Timestamp:
- Apr 27, 2008, 12:59:18 PM (17 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:
- 206887
- Parents:
- cf959d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
rcf959d r73f80e 694 694 ofstream output; 695 695 696 cout << Verbose(0) << "Storing configuration ... " << endl; 696 697 // get correct valence orbitals 697 698 mol->CalculateOrbitals(*configuration); … … 746 747 char filename[255]; 747 748 char *ConfigFileName = NULL; 749 char *ElementsFileName = NULL; 748 750 int flag = 1; 749 751 int Z; … … 757 759 element **Elements; 758 760 vector **Vectors; 759 760 // load element list 761 periode->LoadPeriodentafel(); 762 cout << Verbose(1) << "Element list loaded." << endl; 763 764 // parse config file if given 761 int argptr; 762 763 // =========================== PARSE COMMAND LINE OPTIONS ==================================== 765 764 if (argc >= 1) { // config file specified as option 766 if (argv[argc-1][0] != '-') { 765 // 1. : Parse options that just set variables or print help 766 argptr = 1; 767 do { 768 if (argv[argptr][0] == '-') { 769 cout << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n"; 770 argptr++; 771 switch(argv[argptr-1][1]) { 772 case 'h': 773 case 'H': 774 case '?': 775 cout << "MoleCuilder suite" << endl << "==================" << endl << endl; 776 cout << "Usage: " << argv[0] << "[-{acepsthH?vfrp}] [further arguments] [config file]" << endl; 777 cout << "or simply " << argv[0] << " without arguments for interactive session." << endl; 778 cout << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl; 779 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 780 cout << "\t-e <file>\tSets the element database to be parsed from this file (default: elements.db in same dir as " << argv[0] << ")." << endl; 781 cout << "\t-h/-H/-?\tGive this help screen." << endl; 782 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; 783 cout << "\t-r\t\tConvert file from an old pcp syntax." << endl; 784 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl; 785 cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl; 786 cout << "\t-v/-V\t\tGives version information." << endl; 787 return 0; 788 break; 789 case 'v': 790 case 'V': 791 cout << argv[0] << " " << VERSIONSTRING << endl; 792 cout << "Build your own molecule position set." << endl; 793 return 0; 794 break; 795 case 'e': 796 cout << "Using " << argv[argptr] << " as elements database." << endl; 797 ElementsFileName = argv[argptr]; 798 argptr+=1; 799 break; 800 default: // no match? Step on 801 argptr++; 802 break; 803 } 804 } else 805 argptr++; 806 } while (argptr < (argc-1)); 807 // 2. Parse the element database 808 if (periode->LoadPeriodentafel(ElementsFileName)) 809 cout << Verbose(0) << "Element list loaded successfully." << endl; 810 else 811 cout << Verbose(0) << "Element list loading failed." << endl; 812 // 3. Find config file name and parse if possible 813 if (argv[argc-1][0] != '-') { 767 814 cout << Verbose(0) << "Config file given." << endl; 768 815 test.open(argv[argc-1], ios::in); … … 799 846 test.close(); 800 847 } 801 802 803 int argptr = 1;804 do {805 if (argv[argptr][0] == '-'){806 cout << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n";848 } else 849 config_present = absent; 850 // 4. parse again through options, now for those depending on elements db and config presence 851 argptr = 1; 852 do { 853 if (argv[argptr][0] == '-') { 807 854 argptr++; 808 switch(argv[argptr-1][1]) {809 case 'h':810 case 'H':811 case '?':812 cout << "MoleCuilder suite" << endl << "==================" << endl << endl;813 cout << "Usage: " << argv[0] << "[-{acsthH?vfrp}] [further arguments] [config file]" << endl;814 cout << "or simply " << argv[0] << " without arguments for interactive session." << endl;815 cout << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;816 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;817 cout << "\t-h/-H/-?\tGive this help screen." << endl;818 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;819 cout << "\t-r\t\tConvert file from an old pcp syntax." << endl;820 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;821 cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;822 cout << "\t-v/-V\t\tGives version information." << endl;823 return 0;824 break;825 case 'v':826 case 'V':827 cout << argv[0] << " " << VERSIONSTRING << endl;828 cout << "Build your own molecule position set." << endl;829 return 0;830 break;831 default:832 break;833 }834 855 if ((config_present == present) || (config_present == empty)) { 835 856 switch(argv[argptr-1][1]) { … … 840 861 else 841 862 cout << Verbose(2) << "File found and parsed." << endl; 863 config_present = present; 842 864 break; 843 default: 865 default: // no match? Don't step on (this is done in next switch's default) 844 866 break; 845 867 } … … 965 987 } 966 988 break; 967 default: 989 default: // no match? Step on 990 argptr++; 968 991 break; 969 992 } … … 991 1014 } 992 1015 } 1016 1017 // =========================== START INTERACTIVE SESSION ==================================== 993 1018 994 1019 // now the main construction loop … … 1197 1222 1198 1223 // save element data base 1199 if (periode->StorePeriodentafel()) 1224 if (periode->StorePeriodentafel()) //ElementsFileName 1200 1225 cout << Verbose(0) << "Saving of elements.db successful." << endl; 1201 1226 else
Note:
See TracChangeset
for help on using the changeset viewer.