Changeset 8b3553


Ignore:
Timestamp:
Feb 15, 2013, 4:48:27 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
7d8854
Parents:
3ad723
git-author:
Frederik Heber <heber@…> (02/15/13 16:46:21)
git-committer:
Frederik Heber <heber@…> (02/15/13 16:48:27)
Message:

MPQC now solely relies on computations of SamplingGrid.

  • we only set the window but take all grid-related stuff from the given functions of SamplingGrid.
File:
1 edited

Legend:

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

    r3ad723 r8b3553  
    16851685       SCVector3 max;
    16861686       SCVector3 delta;
    1687        SCVector3 samplepoints;
    1688        SCVector3 length;
    1689        SCVector3 total;
     1687       size_t samplepoints[3];
    16901688       // due to periodic boundary conditions, we don't need gridpoints-1 here
    16911689       // TODO: in case of open boundary conditions, we need data on the right
     
    16931691       const int gridpoints = data.sampled_grid.getGridPointsPerAxis();
    16941692       for (size_t i=0;i<3;++i) {
    1695          min(i) = bmin(i)/AtomicLengthToAngstroem;
    1696          max(i) = bmax(i)/AtomicLengthToAngstroem;
    1697          length(i) = bmax(i) - bmin(i);
    1698          total(i) = data.sampled_grid.end[i] - data.sampled_grid.begin[i];
    1699          delta(i) = total(i)/AtomicLengthToAngstroem/(double)gridpoints;
    1700          samplepoints(i) = floor(gridpoints*(length(i)/total(i))/AtomicLengthToAngstroem)+1;
     1693         min(i) = data.sampled_grid.begin_window[i]/AtomicLengthToAngstroem;
     1694         max(i) = data.sampled_grid.end_window[i]/AtomicLengthToAngstroem;
     1695         delta(i) = data.sampled_grid.getDeltaPerAxis(i)/AtomicLengthToAngstroem;
     1696         samplepoints[i] = data.sampled_grid.getWindowGridPointsPerAxis(i);
    17011697       }
    17021698       std::cout << "Grid starts at " << min
    17031699           << " and ends at " << max
    17041700           << " with a delta of " << delta
    1705            << " to get " << samplepoints << " samplepoints."
     1701           << " to get " << samplepoints[0] << "," << samplepoints[1] << "," << samplepoints[2] << "," << " samplepoints."
    17061702           << std::endl;
    1707        assert( data.sampled_grid.sampled_grid.size() == samplepoints(0)*samplepoints(1)*samplepoints(2));
     1703       assert( data.sampled_grid.sampled_grid.size() == samplepoints[0]*samplepoints[1]*samplepoints[2]);
    17081704
    17091705       // 3. sample the atomic density
     
    17121708       SCVector3 r = min;
    17131709       std::vector<double>::iterator griditer = data.sampled_grid.sampled_grid.begin();
    1714        for (size_t x = 0; x < samplepoints(0); ++x, r.x() += delta(0)) {
     1710       for (size_t x = 0; x < samplepoints[0]; ++x, r.x() += delta(0)) {
    17151711         std::cout << "Sampling now for x=" << r.x() << std::endl;
    1716          for (size_t y = 0; y < samplepoints(1); ++y, r.y() += delta(1)) {
    1717            for (size_t z = 0; z < samplepoints(2); ++z, r.z() += delta(2)) {
     1712         for (size_t y = 0; y < samplepoints[1]; ++y, r.y() += delta(1)) {
     1713           for (size_t z = 0; z < samplepoints[2]; ++z, r.z() += delta(2)) {
    17181714             const double dens_at_r = scf->density(r) * element_volume_conversion;
    17191715//             if (fabs(dens_at_r) > 1e-4)
Note: See TracChangeset for help on using the changeset viewer.