Ignore:
Timestamp:
Oct 30, 2009, 3:49:38 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
245826
Parents:
5f697c
git-author:
Frederik Heber <heber@…> (10/30/09 15:33:51)
git-committer:
Frederik Heber <heber@…> (10/30/09 15:49:38)
Message:

BondGraph is parsed if command line switch '-g' is given.

  • builder.cpp: case 'g' which gives a bond length table file which is parsed after the configuration and before other command line options.
  • BondGraph::BondLengthMatrixMinMaxDistance() falls back to CovalentMinMaxDistance() if no table parsed.
  • Bond Length Table was changed to have first row _and_ column each enlist all the elements and does not have a "#" in front anymore.
  • The unit test has been changed accordingly.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r5f697c rb84ab4  
    13571357  int argptr;
    13581358  molecule *mol = NULL;
     1359  string BondGraphFileName("");
    13591360  strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1);
    13601361
     
    13841385            cout << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    13851386            cout << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
     1387            cout << "\t-g <file>\tParses a bond length table from the given file." << endl;
    13861388            cout << "\t-h/-H/-?\tGive this help screen." << endl;
    13871389            cout << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;
     
    14201422            }
    14211423            break;
     1424          case 'g':
     1425            if ((argptr >= argc) || (argv[argptr][0] == '-')) {
     1426              cerr << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl;
     1427            } else {
     1428              BondGraphFileName = argv[argptr];
     1429              cout << "Using " << BondGraphFileName << " as bond length table." << endl;
     1430              argptr+=1;
     1431            }
     1432            break;
    14221433          case 'n':
    14231434            cout << "I won't parse trajectories." << endl;
     
    14321443    } while (argptr < argc);
    14331444
    1434     // 2. Parse the element database
     1445    // 3a. Parse the element database
    14351446    if (periode->LoadPeriodentafel(configuration.databasepath)) {
    14361447      cout << Verbose(0) << "Element list loaded successfully." << endl;
     
    14401451      return 1;
    14411452    }
    1442     // 3. Find config file name and parse if possible
     1453    // 3b. Find config file name and parse if possible
    14431454    if (argv[1][0] != '-') {
    14441455      // simply create a new molecule, wherein the config file is loaded and the manipulation takes place
     
    14831494    } else
    14841495      configPresent = absent;
     1496    // 3c. parse the bond graph file if given
     1497    configuration.BG = new BondGraph(configuration.GetIsAngstroem());
     1498    if (configuration.BG->LoadBondLengthTable((ofstream *)&cout, BondGraphFileName)) {
     1499      cout << Verbose(0) << "Bond length table loaded successfully." << endl;
     1500    } else {
     1501      cout << Verbose(0) << "Bond length table loading failed." << endl;
     1502      return 1;
     1503    }
    14851504    // 4. parse again through options, now for those depending on elements db and config presence
    14861505    argptr = 1;
Note: See TracChangeset for help on using the changeset viewer.