Changeset 59076a


Ignore:
Timestamp:
Aug 29, 2012, 1:17:48 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
f0da45
Parents:
89ced8
Message:

Added linear sampling over the line between two bound atoms.

  • this as done to check on the electron density in between. However, the peak at the nuclei of the electron charge is really quite large for carbon in contract to e.g. hydrogen. So, we do sample the minimized density and not the core hamiltonian guess or else.
File:
1 edited

Legend:

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

    r89ced8 r59076a  
    17271727         r.y() = min.y();
    17281728       }
     1729       {
     1730         // additionally give electron density in a line between two atoms
     1731         SCVector3 start;
     1732         SCVector3 end;
     1733         double length;
     1734         size_t otherindex = 0;
     1735         do {
     1736           if (++otherindex == scf->basis()->ncenter())
     1737             break;
     1738           length = 0.;
     1739           for (size_t j=0;j<3;++j) {
     1740             start[j] = wfn->molecule()->r(0, j);
     1741             end[j] = wfn->molecule()->r(otherindex, j);
     1742             length += (end[j]-start[j])*(end[j]-start[j]);
     1743           }
     1744         } while (((length < pow(1.2/0.52917721,2))) && (length > pow(1.7/0.52917721,2)));
     1745         if (otherindex < scf->basis()->ncenter()) {
     1746           std::cout << "Sampling density between " << start << " and " << end << " for length of " << length << std::endl;
     1747           const size_t samples = 100;
     1748           for (size_t j=0;j<3;++j) {
     1749             end[j] -= start[j];
     1750             end[j] /= samples;
     1751           }
     1752           SCVector3 r = start - 2.*samples*end;
     1753           std::ofstream output("/home/heber/Desktop/test.dat");
     1754           for (size_t i=0;i<=4.*samples;++i, r += end) {
     1755             output << i << "\t" << scf->density(r) << std::endl;
     1756           }
     1757           output.close();
     1758         }
     1759       }
    17291760       assert( data.sampled_grid.sampled_grid.size() == gridpoints*gridpoints*gridpoints);
    17301761       // normalization of electron charge to equal electron number
Note: See TracChangeset for help on using the changeset viewer.