[cc276e] | 1 | /*
|
---|
[4bc75d] | 2 | * MPQCData.hpp
|
---|
[cc276e] | 3 | *
|
---|
| 4 | * Created on: Feb 08, 2012
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[4bc75d] | 8 | #ifndef MPQCDATA_HPP_
|
---|
| 9 | #define MPQCDATA_HPP_
|
---|
[cc276e] | 10 |
|
---|
| 11 | // include config.h
|
---|
| 12 | #ifdef HAVE_CONFIG_H
|
---|
| 13 | #include <config.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
| 16 | #include <boost/serialization/access.hpp>
|
---|
| 17 | #include <boost/serialization/vector.hpp>
|
---|
| 18 |
|
---|
[509014] | 19 | #include <iosfwd>
|
---|
[cc276e] | 20 | #include <vector>
|
---|
| 21 |
|
---|
| 22 | class MPQCCommandJob;
|
---|
| 23 | class MPQCCommandJobTest;
|
---|
| 24 | class MPQCDataTest;
|
---|
| 25 |
|
---|
| 26 | /** Internal class that holds the data and can be serialized.
|
---|
| 27 | *
|
---|
| 28 | */
|
---|
| 29 | class MPQCData {
|
---|
| 30 | //!> allow MPQCCommandJob access to member variables directly
|
---|
| 31 | friend class MPQCCommandJob;
|
---|
| 32 | //!> grant MPQCCommandJob's unit test access
|
---|
| 33 | friend class MPQCCommandJobTest;
|
---|
| 34 | //!> grant unit test access
|
---|
| 35 | friend class MPQCDataTest;
|
---|
[509014] | 36 | //!> grant access to output stream operator
|
---|
| 37 | friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
[cc276e] | 38 | public:
|
---|
| 39 | bool operator==(const MPQCData &other) const;
|
---|
| 40 |
|
---|
| 41 | bool operator!=(const MPQCData &other) const {
|
---|
| 42 | return !(*this == other);
|
---|
| 43 | }
|
---|
| 44 |
|
---|
[a9558f] | 45 | /// Energie structure
|
---|
| 46 | struct energy_t {
|
---|
| 47 | /** Constructor for struct energy_t, sets all to zero.
|
---|
| 48 | *
|
---|
| 49 | */
|
---|
| 50 | energy_t();
|
---|
| 51 |
|
---|
| 52 | double total;
|
---|
| 53 | double nuclear_repulsion;
|
---|
[adccae] | 54 | double electron_coulomb;
|
---|
| 55 | double electron_exchange;
|
---|
[a9558f] | 56 | double correlation;
|
---|
| 57 | double overlap;
|
---|
| 58 | double kinetic;
|
---|
| 59 | double hcore;
|
---|
[188639] | 60 |
|
---|
| 61 | std::vector<double> eigenvalues;
|
---|
[a9558f] | 62 | } energies;
|
---|
[cc276e] | 63 |
|
---|
[a9558f] | 64 | /// Forces
|
---|
| 65 | typedef std::vector<double> vector_type;
|
---|
[cc276e] | 66 | std::vector< vector_type > forces;
|
---|
| 67 |
|
---|
[815f60] | 68 | /// Density
|
---|
| 69 | typedef std::vector<double> grid_type;
|
---|
| 70 | grid_type density;
|
---|
| 71 |
|
---|
[a9558f] | 72 | /// Timing structure
|
---|
| 73 | struct times_t {
|
---|
| 74 | /** Constructor for struct times_t, sets all to zero.
|
---|
| 75 | *
|
---|
| 76 | */
|
---|
| 77 | times_t();
|
---|
| 78 |
|
---|
| 79 | double walltime;
|
---|
| 80 | double cputime;
|
---|
| 81 | double flops;
|
---|
| 82 | } times;
|
---|
| 83 |
|
---|
[cc276e] | 84 | private:
|
---|
| 85 | friend class boost::serialization::access;
|
---|
| 86 | // serialization
|
---|
| 87 | template <typename Archive>
|
---|
| 88 | void serialize(Archive& ar, const unsigned int version)
|
---|
| 89 | {
|
---|
[a9558f] | 90 | ar & energies.total;
|
---|
| 91 | ar & energies.nuclear_repulsion;
|
---|
[adccae] | 92 | ar & energies.electron_coulomb;
|
---|
| 93 | ar & energies.electron_exchange;
|
---|
[a9558f] | 94 | ar & energies.correlation;
|
---|
| 95 | ar & energies.overlap;
|
---|
| 96 | ar & energies.kinetic;
|
---|
| 97 | ar & energies.hcore;
|
---|
[188639] | 98 | ar & energies.eigenvalues;
|
---|
[cc276e] | 99 | ar & forces;
|
---|
[815f60] | 100 | ar & density;
|
---|
[a9558f] | 101 | ar & times.walltime;
|
---|
| 102 | ar & times.cputime;
|
---|
| 103 | ar & times.flops;
|
---|
[cc276e] | 104 | }
|
---|
| 105 | };
|
---|
| 106 |
|
---|
[509014] | 107 | std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
| 108 |
|
---|
[4bc75d] | 109 | #endif /* MPQCDATA_HPP_ */
|
---|