Changeset ebcade for src


Ignore:
Timestamp:
Oct 6, 2009, 5:56:15 PM (15 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:
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)
Message:

Extended the testsuite to encompass the vital areas of molecuilder.

  • the vital areas are: simple geometry, Graph, fragmentation, tesselation
  • in molecuilder/tests a dir regression was added for each case with pre and post dirs. Pre contains files needed for the test, post contains results to compare to
  • builder.cpp: check for commands that need extra arguments that first arguments does not begin with '-' missing for many cases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/builder.cpp

    rcee0b57 rebcade  
    13821382            cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
    13831383            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;
    13861386            cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;
    13871387            cout << "\t-S <file> Store temperatures from the config file in <file>." << endl;
     
    14801480          switch(argv[argptr-1][1]) {
    14811481            case 'p':
    1482               ExitFlag = 1;
     1482              if (ExitFlag == 0) ExitFlag = 1;
    14831483              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    14841484                ExitFlag = 255;
     
    14961496              break;
    14971497            case 'a':
    1498               ExitFlag = 1;
     1498              if (ExitFlag == 0) ExitFlag = 1;
    14991499              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1]))) {
    15001500                ExitFlag = 255;
     
    15351535              break;
    15361536            case 'D':
    1537               ExitFlag = 1;
     1537              if (ExitFlag == 0) ExitFlag = 1;
    15381538              {
    15391539                cout << Verbose(1) << "Depth-First-Search Analysis." << endl;
     
    15681568              break;
    15691569            case 'E':
    1570               ExitFlag = 1;
     1570              if (ExitFlag == 0) ExitFlag = 1;
    15711571              if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) {
    15721572                ExitFlag = 255;
     
    15811581              break;
    15821582            case 'F':
    1583               ExitFlag = 1;
     1583              if (ExitFlag == 0) ExitFlag = 1;
    15841584              if (argptr+5 >=argc) {
    15851585                ExitFlag = 255;
     
    16191619              break;
    16201620            case 'A':
    1621               ExitFlag = 1;
     1621              if (ExitFlag == 0) ExitFlag = 1;
    16221622              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16231623                ExitFlag =255;
     
    16321632              break;
    16331633            case 'N':
    1634               ExitFlag = 1;
     1634              if (ExitFlag == 0) ExitFlag = 1;
    16351635              if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-')){
    16361636                ExitFlag = 255;
     
    16521652              break;
    16531653            case 'S':
    1654               ExitFlag = 1;
     1654              if (ExitFlag == 0) ExitFlag = 1;
    16551655              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16561656                ExitFlag = 255;
     
    16691669              break;
    16701670            case 'L':
    1671               ExitFlag = 1;
     1671              if (ExitFlag == 0) ExitFlag = 1;
    16721672              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16731673                ExitFlag = 255;
     
    16861686              break;
    16871687            case 'P':
    1688               ExitFlag = 1;
     1688              if (ExitFlag == 0) ExitFlag = 1;
    16891689              if ((argptr >= argc) || (argv[argptr][0] == '-')) {
    16901690                ExitFlag = 255;
     
    17011701              break;
    17021702            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])))  {
    17051705                ExitFlag = 255;
    17061706                cerr << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;
     
    17261726              break;
    17271727            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])) ) {
    17301730                ExitFlag = 255;
    17311731                cerr << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;
    17321732              } else {
    1733                 ExitFlag = 1;
     1733                if (ExitFlag == 0) ExitFlag = 1;
    17341734                SaveFlag = true;
    17351735                cout << Verbose(1) << "Translating all ions by given vector." << endl;
     
    17411741              break;
    17421742            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])) ) {
    17451745                ExitFlag = 255;
    17461746                cerr << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;
    17471747              } else {
    1748                 ExitFlag = 1;
     1748                if (ExitFlag == 0) ExitFlag = 1;
    17491749                SaveFlag = true;
    17501750                cout << Verbose(1) << "Translating all ions periodically by given vector." << endl;
     
    17561756              break;
    17571757            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])) ) {
    17601760                ExitFlag = 255;
    17611761                cerr << "Not enough or invalid arguments given for scaling: -s <factor/[factor_x]> [factor_y] [factor_z]" << endl;
     
    17831783              break;
    17841784            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])) ) {
    17871787                ExitFlag = 255;
    17881788                cerr << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     
    18001800              break;
    18011801            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])) ) {
    18041804                ExitFlag = 255;
    18051805                cerr << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl;
     
    18171817              break;
    18181818            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])) ) {
    18211821                ExitFlag = 255;
    18221822                cerr << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl;
     
    18411841              break;
    18421842            case 'O':
    1843               ExitFlag = 1;
     1843              if (ExitFlag == 0) ExitFlag = 1;
    18441844              SaveFlag = true;
    18451845              cout << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl;
     
    18501850              break;
    18511851            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              }
    18551863              break;
    18561864            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]))) {
    18591867                ExitFlag = 255;
    18601868                cerr << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl;
     
    18741882              break;
    18751883            case 'm':
    1876               ExitFlag = 1;
     1884              if (ExitFlag == 0) ExitFlag = 1;
    18771885              j = atoi(argv[argptr++]);
    18781886              if ((j<0) || (j>1)) {
     
    18881896              break;
    18891897            case 'o':
    1890               ExitFlag = 1;
     1898              if (ExitFlag == 0) ExitFlag = 1;
    18911899              if ((argptr+1 >= argc) || (argv[argptr][0] == '-')){
    18921900                ExitFlag = 255;
     
    19081916              break;
    19091917            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])) ) {
    19121920                ExitFlag = 255;
    19131921                cerr << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl;
     
    19181926              }
    19191927            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])) ) {
    19221930                if (volume != -1)
    19231931                  ExitFlag = 255;
     
    19421950              break;
    19431951            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])) ) {
    19461954                ExitFlag = 255;
    19471955                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.