Changeset 05c6bc


Ignore:
Timestamp:
Jul 10, 2012, 1:15:50 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
1c7075
Parents:
9b827f
git-author:
Frederik Heber <heber@…> (07/06/12 19:40:51)
git-committer:
Frederik Heber <heber@…> (07/10/12 13:15:50)
Message:

Extracted checking of basis set against given limit into own function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/bin/mpqc/mpqc.cc

    r9b827f r05c6bc  
    867867}
    868868
     869/** Checks whether limit on command-line exceeds the basis functions.
     870 *
     871 * \param options parsed command-line options
     872 * \param mole molecular energy object
     873 * \return 0 - not exceeded, 1 - exceeded
     874 */
     875int checkBasisSetLimit(
     876    GetLongOpt &options,
     877    Ref<MolecularEnergy> &mole
     878    )
     879{
     880  int check = (options.retrieve("c") != 0);
     881  int limit = atoi(options.retrieve("l"));
     882  if (limit) {
     883    Ref<Wavefunction> wfn; wfn << mole;
     884    if (wfn.nonnull() && wfn->ao_dimension()->n() > limit) {
     885      ExEnv::out0() << endl << indent
     886           << "The limit of " << limit << " basis functions has been exceeded."
     887           << endl;
     888      check = 1;
     889    }
     890  }
     891  return check;
     892}
     893
    869894int
    870895try_main(int argc, char *argv[])
     
    10311056
    10321057  // see if frequencies are wanted
    1033 
    10341058  Ref<MolecularHessian> molhess;
    10351059  molhess << keyval->describedclassvalue("hess");
    10361060  Ref<MolecularFrequencies> molfreq;
    10371061  molfreq << keyval->describedclassvalue("freq");
    1038  
    1039   int check = (options.retrieve("c") != 0);
    1040   int limit = atoi(options.retrieve("l"));
    1041   if (limit) {
    1042     Ref<Wavefunction> wfn; wfn << mole;
    1043     if (wfn.nonnull() && wfn->ao_dimension()->n() > limit) {
    1044       ExEnv::out0() << endl << indent
    1045            << "The limit of " << limit << " basis functions has been exceeded."
    1046            << endl;
    1047       check = 1;
    1048     }
    1049   }
    1050 
     1062
     1063  // check basis set limit
     1064  const int check = checkBasisSetLimit(options, mole);
    10511065  if (check) {
    10521066    ExEnv::out0() << endl << indent
Note: See TracChangeset for help on using the changeset viewer.