- Timestamp:
- Oct 6, 2009, 5:56:15 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:
- e9f8f9
- Parents:
- cee0b57
- git-author:
- Frederik Heber <heber@…> (10/06/09 17:37:50)
- git-committer:
- Frederik Heber <heber@…> (10/06/09 17:56:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
rcee0b57 rebcade 1382 1382 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; 1383 1383 cout << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl; 1384 cout << "\t-r \t\tConvert file from an old pcp syntax." << endl;1385 cout << "\t-R \t\tRemove all atoms out of sphere around a given one." << endl;1384 cout << "\t-r <id>\t\tRemove an atom with given id." << endl; 1385 cout << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl; 1386 1386 cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl; 1387 1387 cout << "\t-S <file> Store temperatures from the config file in <file>." << endl; … … 1480 1480 switch(argv[argptr-1][1]) { 1481 1481 case 'p': 1482 ExitFlag = 1;1482 if (ExitFlag == 0) ExitFlag = 1; 1483 1483 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1484 1484 ExitFlag = 255; … … 1496 1496 break; 1497 1497 case 'a': 1498 ExitFlag = 1;1498 if (ExitFlag == 0) ExitFlag = 1; 1499 1499 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1]))) { 1500 1500 ExitFlag = 255; … … 1535 1535 break; 1536 1536 case 'D': 1537 ExitFlag = 1;1537 if (ExitFlag == 0) ExitFlag = 1; 1538 1538 { 1539 1539 cout << Verbose(1) << "Depth-First-Search Analysis." << endl; … … 1568 1568 break; 1569 1569 case 'E': 1570 ExitFlag = 1;1570 if (ExitFlag == 0) ExitFlag = 1; 1571 1571 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) { 1572 1572 ExitFlag = 255; … … 1581 1581 break; 1582 1582 case 'F': 1583 ExitFlag = 1;1583 if (ExitFlag == 0) ExitFlag = 1; 1584 1584 if (argptr+5 >=argc) { 1585 1585 ExitFlag = 255; … … 1619 1619 break; 1620 1620 case 'A': 1621 ExitFlag = 1;1621 if (ExitFlag == 0) ExitFlag = 1; 1622 1622 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1623 1623 ExitFlag =255; … … 1632 1632 break; 1633 1633 case 'N': 1634 ExitFlag = 1;1634 if (ExitFlag == 0) ExitFlag = 1; 1635 1635 if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-')){ 1636 1636 ExitFlag = 255; … … 1652 1652 break; 1653 1653 case 'S': 1654 ExitFlag = 1;1654 if (ExitFlag == 0) ExitFlag = 1; 1655 1655 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1656 1656 ExitFlag = 255; … … 1669 1669 break; 1670 1670 case 'L': 1671 ExitFlag = 1;1671 if (ExitFlag == 0) ExitFlag = 1; 1672 1672 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1673 1673 ExitFlag = 255; … … 1686 1686 break; 1687 1687 case 'P': 1688 ExitFlag = 1;1688 if (ExitFlag == 0) ExitFlag = 1; 1689 1689 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1690 1690 ExitFlag = 255; … … 1701 1701 break; 1702 1702 case 'R': 1703 ExitFlag = 1;1704 if ((argptr+1 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {1703 if (ExitFlag == 0) ExitFlag = 1; 1704 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 1705 1705 ExitFlag = 255; 1706 1706 cerr << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl; … … 1726 1726 break; 1727 1727 case 't': 1728 ExitFlag = 1;1729 if ((argptr+2 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1728 if (ExitFlag == 0) ExitFlag = 1; 1729 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1730 1730 ExitFlag = 255; 1731 1731 cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl; 1732 1732 } else { 1733 ExitFlag = 1;1733 if (ExitFlag == 0) ExitFlag = 1; 1734 1734 SaveFlag = true; 1735 1735 cout << Verbose(1) << "Translating all ions by given vector." << endl; … … 1741 1741 break; 1742 1742 case 'T': 1743 ExitFlag = 1;1744 if ((argptr+2 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1743 if (ExitFlag == 0) ExitFlag = 1; 1744 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1745 1745 ExitFlag = 255; 1746 1746 cerr << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl; 1747 1747 } else { 1748 ExitFlag = 1;1748 if (ExitFlag == 0) ExitFlag = 1; 1749 1749 SaveFlag = true; 1750 1750 cout << Verbose(1) << "Translating all ions periodically by given vector." << endl; … … 1756 1756 break; 1757 1757 case 's': 1758 ExitFlag = 1;1759 if ((argptr >= argc) || ( !IsValidNumber(argv[argptr])) ) {1758 if (ExitFlag == 0) ExitFlag = 1; 1759 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) ) { 1760 1760 ExitFlag = 255; 1761 1761 cerr << "Not enough or invalid arguments given for scaling: -s <factor/[factor_x]> [factor_y] [factor_z]" << endl; … … 1783 1783 break; 1784 1784 case 'b': 1785 ExitFlag = 1;1786 if ((argptr+5 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {1785 if (ExitFlag == 0) ExitFlag = 1; 1786 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])) ) { 1787 1787 ExitFlag = 255; 1788 1788 cerr << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl; … … 1800 1800 break; 1801 1801 case 'B': 1802 ExitFlag = 1;1803 if ((argptr+5 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) {1802 if (ExitFlag == 0) ExitFlag = 1; 1803 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])) ) { 1804 1804 ExitFlag = 255; 1805 1805 cerr << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl; … … 1817 1817 break; 1818 1818 case 'c': 1819 ExitFlag = 1;1820 if ((argptr+2 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1819 if (ExitFlag == 0) ExitFlag = 1; 1820 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1821 1821 ExitFlag = 255; 1822 1822 cerr << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl; … … 1841 1841 break; 1842 1842 case 'O': 1843 ExitFlag = 1;1843 if (ExitFlag == 0) ExitFlag = 1; 1844 1844 SaveFlag = true; 1845 1845 cout << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl; … … 1850 1850 break; 1851 1851 case 'r': 1852 ExitFlag = 1; 1853 SaveFlag = true; 1854 cout << Verbose(1) << "Converting config file from supposed old to new syntax." << endl; 1852 if (ExitFlag == 0) ExitFlag = 1; 1853 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr]))) { 1854 ExitFlag = 255; 1855 cerr << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl; 1856 } else { 1857 SaveFlag = true; 1858 cout << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl; 1859 atom *first = mol->FindAtom(atoi(argv[argptr])); 1860 mol->RemoveAtom(first); 1861 argptr+=1; 1862 } 1855 1863 break; 1856 1864 case 'f': 1857 ExitFlag = 1;1858 if ((argptr+1 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {1865 if (ExitFlag == 0) ExitFlag = 1; 1866 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 1859 1867 ExitFlag = 255; 1860 1868 cerr << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl; … … 1874 1882 break; 1875 1883 case 'm': 1876 ExitFlag = 1;1884 if (ExitFlag == 0) ExitFlag = 1; 1877 1885 j = atoi(argv[argptr++]); 1878 1886 if ((j<0) || (j>1)) { … … 1888 1896 break; 1889 1897 case 'o': 1890 ExitFlag = 1;1898 if (ExitFlag == 0) ExitFlag = 1; 1891 1899 if ((argptr+1 >= argc) || (argv[argptr][0] == '-')){ 1892 1900 ExitFlag = 255; … … 1908 1916 break; 1909 1917 case 'U': 1910 ExitFlag = 1;1911 if ((argptr+1 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) {1918 if (ExitFlag == 0) ExitFlag = 1; 1919 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) { 1912 1920 ExitFlag = 255; 1913 1921 cerr << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl; … … 1918 1926 } 1919 1927 case 'u': 1920 ExitFlag = 1;1921 if ((argptr >= argc) || ( !IsValidNumber(argv[argptr])) ) {1928 if (ExitFlag == 0) ExitFlag = 1; 1929 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) ) { 1922 1930 if (volume != -1) 1923 1931 ExitFlag = 255; … … 1942 1950 break; 1943 1951 case 'd': 1944 ExitFlag = 1;1945 if ((argptr+2 >= argc) || ( !IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) {1952 if (ExitFlag == 0) ExitFlag = 1; 1953 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 1946 1954 ExitFlag = 255; 1947 1955 cerr << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.