/* * MPQCData.hpp * * Created on: Feb 08, 2012 * Author: heber */ #ifndef MPQCDATA_HPP_ #define MPQCDATA_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include class MPQCCommandJob; class MPQCCommandJobTest; class MPQCDataTest; /** Internal class that holds the data and can be serialized. * */ class MPQCData { //!> allow MPQCCommandJob access to member variables directly friend class MPQCCommandJob; //!> grant MPQCCommandJob's unit test access friend class MPQCCommandJobTest; //!> grant unit test access friend class MPQCDataTest; //!> grant access to output stream operator friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data); public: bool operator==(const MPQCData &other) const; bool operator!=(const MPQCData &other) const { return !(*this == other); } /// Energie structure struct energy_t { /** Constructor for struct energy_t, sets all to zero. * */ energy_t(); double total; double nuclear_repulsion; double electron_coulomb; double electron_exchange; double correlation; double overlap; double kinetic; double hcore; std::vector eigenvalues; } energies; /// Forces typedef std::vector vector_type; std::vector< vector_type > forces; /// Density struct density_t { //!> Begin (min coordinates) of grid in real space double begin[3]; //!> edge length of cubic(!) domain double size; //!> level of the grid, hence \f$2^\text{level}\f$ int level; //!> typedef for vector of samples grids typedef std::vector grid_type; //!> vector of sample points in order x, y, z grid_type sampled_grid; } density; /// Timing structure struct times_t { /** Constructor for struct times_t, sets all to zero. * */ times_t(); double walltime; double cputime; double flops; } times; private: friend class boost::serialization::access; // serialization template void serialize(Archive& ar, const unsigned int version) { ar & energies.total; ar & energies.nuclear_repulsion; ar & energies.electron_coulomb; ar & energies.electron_exchange; ar & energies.correlation; ar & energies.overlap; ar & energies.kinetic; ar & energies.hcore; ar & energies.eigenvalues; ar & forces; int i; for (int i=0; i<3; ++i) ar & density.begin[i]; ar & density.size; ar & density.level; ar & density.sampled_grid; ar & times.walltime; ar & times.cputime; ar & times.flops; } }; std::ostream & operator<<(std::ostream &ost, const MPQCData &data); #endif /* MPQCDATA_HPP_ */