Changeset 0eb774e
- Timestamp:
- Jul 25, 2012, 6:21:36 PM (13 years ago)
- Children:
- 737c47
- Parents:
- 6bf68b
- Location:
- src/bin/mpqc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/bin/mpqc/MPQCJob.h
r6bf68b r0eb774e 27 27 { 28 28 public: 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) : 30 35 FragmentJob(_JobId), 31 inputfile(_inputfile) 36 inputfile(_inputfile), 37 size(0.), 38 level(0) 32 39 {} 33 40 virtual ~MPQCJob() {} … … 38 45 //!> contents of the input file 39 46 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; 40 53 41 54 private: … … 43 56 */ 44 57 MPQCJob() : 45 FragmentJob(JobId::IllegalJob) 58 FragmentJob(JobId::IllegalJob), 59 size(0.), 60 level(0) 46 61 {} 47 62 … … 53 68 ar & boost::serialization::base_object<FragmentJob>(*this); 54 69 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); 55 75 } 56 76 }; -
src/bin/mpqc/mpqc.cc
r6bf68b r0eb774e 1579 1579 double boundary = 5.; // boundary extent around compact domain containing basis functions 1580 1580 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; 1583 1596 1584 1597 // 3. sample the atomic density … … 1588 1601 GaussianBasisSet::ValueData vdat(wfn->basis(), integral); 1589 1602 SCVector3 r; 1603 data.density.sampled_grid.clear(); 1604 data.density.sampled_grid.reserve(gridpoints*gridpoints*gridpoints); 1590 1605 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) { 1593 1608 wfn->basis()->values(r, &vdat, b_val); 1594 1609 double sum = 0.; 1595 1610 for (int i=0; i<nbasis; i++) 1596 1611 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); 1598 1613 } 1614 1599 1615 // // GaussianShell is the actual orbital functions it seems ... 1600 1616 // //ExEnv::out0() << "There are the following Gaussian Shells: " << endl; … … 1694 1710 const char *input = 0; 1695 1711 const char *generic_input = 0; 1696 MPQCData data;1697 1712 Ref<MessageGrp> grp = MessageGrp::get_default_messagegrp(); 1698 1713 // create unique, temporary name and check whether it exists … … 1704 1719 test.open(output); 1705 1720 } 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 1707 1728 mainFunction(grp, values, output, input, generic_input, in_char_array, argc, argv, data); 1708 1729 // delete[] in_char_array;
Note:
See TracChangeset
for help on using the changeset viewer.
