Changeset 0eb774e


Ignore:
Timestamp:
Jul 25, 2012, 6:21:36 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
737c47
Parents:
6bf68b
Message:

MPQCJob and MPQCData now contain information how to sample the density.

Location:
src/bin/mpqc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/bin/mpqc/MPQCJob.h

    r6bf68b r0eb774e  
    2727{
    2828public:
    29   MPQCJob(const JobId_t _JobId, const std::string &_inputfile) :
     29  MPQCJob(
     30      const JobId_t _JobId,
     31      const std::string &_inputfile,
     32      const double _begin[3],
     33      const double _size,
     34      const int _level) :
    3035    FragmentJob(_JobId),
    31     inputfile(_inputfile)
     36    inputfile(_inputfile),
     37    size(0.),
     38    level(0)
    3239  {}
    3340  virtual ~MPQCJob() {}
     
    3845  //!> contents of the input file
    3946  const std::string inputfile;
     47  //!> offset of grid
     48  double begin[3];
     49  //!> size of grid, i.e. edge length of cubic(!) domain
     50  const double size;
     51  //!> level, i.e. \f$2^{\text{level}}\f$ grid points per axis
     52  const int level;
    4053
    4154private:
     
    4356   */
    4457  MPQCJob() :
    45     FragmentJob(JobId::IllegalJob)
     58    FragmentJob(JobId::IllegalJob),
     59    size(0.),
     60    level(0)
    4661  {}
    4762
     
    5368    ar & boost::serialization::base_object<FragmentJob>(*this);
    5469    ar & const_cast<std::string &>(inputfile);
     70    int i;
     71    for (i=0; i<3; ++i)
     72      ar & begin[i];
     73    ar & const_cast<double &>(size);
     74    ar & const_cast<int &>(level);
    5575  }
    5676};
  • src/bin/mpqc/mpqc.cc

    r6bf68b r0eb774e  
    15791579     double boundary = 5.;  // boundary extent around compact domain containing basis functions
    15801580     double delta = 1.; // step width in density sampling
    1581      min -= boundary;
    1582      max += boundary;
     1581
     1582     // for the moment we always generate a grid of full size
     1583     min.x() = data.density.begin[0];
     1584     min.y() = data.density.begin[1];
     1585     min.z() = data.density.begin[2];
     1586     max.x() = min.x() + data.density.size;
     1587     max.y() = min.y() + data.density.size;
     1588     max.z() = min.z() + data.density.size;
     1589     const int gridpoints = pow(2,data.density.level);
     1590     delta = data.density.size / (double) gridpoints;
     1591     std::cout << "Grid starts at " << min
     1592         << " and ends at " << max
     1593         << " with a delta of " << delta
     1594         << " to get " << gridpoints << " gridpoints."
     1595         << std::endl;
    15831596
    15841597     // 3. sample the atomic density
     
    15881601     GaussianBasisSet::ValueData vdat(wfn->basis(), integral);
    15891602     SCVector3 r;
     1603     data.density.sampled_grid.clear();
     1604     data.density.sampled_grid.reserve(gridpoints*gridpoints*gridpoints);
    15901605     for (r.x() = min.x() ; r.x() < max.x(); r.x() += delta)
    1591        for (r.y() = min.y() ; r.y() < max.x(); r.y() += delta)
    1592          for (r.z() =min.z() ; r.z() < max.x(); r.z() += delta) {
     1606       for (r.y() = min.y() ; r.y() < max.y(); r.y() += delta)
     1607         for (r.z() =min.z() ; r.z() < max.z(); r.z() += delta) {
    15931608           wfn->basis()->values(r, &vdat, b_val);
    15941609           double sum = 0.;
    15951610           for (int i=0; i<nbasis; i++)
    15961611             sum += wfn->ao_density()->get_element(i,i)*b_val[i];
    1597            data.density.push_back(sum);
     1612           data.density.sampled_grid.push_back(sum);
    15981613         }
     1614
    15991615//     // GaussianShell is the actual orbital functions it seems ...
    16001616//     //ExEnv::out0() << "There are the following Gaussian Shells: " << endl;
     
    16941710  const char *input = 0;
    16951711  const char *generic_input = 0;
    1696   MPQCData data;
    16971712  Ref<MessageGrp> grp = MessageGrp::get_default_messagegrp();
    16981713  // create unique, temporary name and check whether it exists
     
    17041719    test.open(output);
    17051720  } while (test.good());
    1706   // now call work horse
     1721  // put info how to sample the density into MPQCData
     1722  MPQCData data;
     1723  data.density.size = size;
     1724  data.density.level = level;
     1725  for (int i=0;i<3; ++i)
     1726    data.density.begin[i] = begin[i];
     1727// now call work horse
    17071728  mainFunction(grp, values, output, input, generic_input, in_char_array, argc, argv, data);
    17081729//  delete[] in_char_array;
Note: See TracChangeset for help on using the changeset viewer.