[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;
|
---|
| 54 | double electron_repulsion;
|
---|
| 55 | double correlation;
|
---|
| 56 | double overlap;
|
---|
| 57 | double kinetic;
|
---|
| 58 | double hcore;
|
---|
[188639] | 59 |
|
---|
| 60 | std::vector<double> eigenvalues;
|
---|
[a9558f] | 61 | } energies;
|
---|
[cc276e] | 62 |
|
---|
[a9558f] | 63 | /// Forces
|
---|
| 64 | typedef std::vector<double> vector_type;
|
---|
[cc276e] | 65 | std::vector< vector_type > forces;
|
---|
| 66 |
|
---|
[a9558f] | 67 | /// Timing structure
|
---|
| 68 | struct times_t {
|
---|
| 69 | /** Constructor for struct times_t, sets all to zero.
|
---|
| 70 | *
|
---|
| 71 | */
|
---|
| 72 | times_t();
|
---|
| 73 |
|
---|
| 74 | double walltime;
|
---|
| 75 | double cputime;
|
---|
| 76 | double flops;
|
---|
| 77 | } times;
|
---|
| 78 |
|
---|
[cc276e] | 79 | private:
|
---|
| 80 | friend class boost::serialization::access;
|
---|
| 81 | // serialization
|
---|
| 82 | template <typename Archive>
|
---|
| 83 | void serialize(Archive& ar, const unsigned int version)
|
---|
| 84 | {
|
---|
[a9558f] | 85 | ar & energies.total;
|
---|
| 86 | ar & energies.nuclear_repulsion;
|
---|
| 87 | ar & energies.electron_repulsion;
|
---|
| 88 | ar & energies.correlation;
|
---|
| 89 | ar & energies.overlap;
|
---|
| 90 | ar & energies.kinetic;
|
---|
| 91 | ar & energies.hcore;
|
---|
[188639] | 92 | ar & energies.eigenvalues;
|
---|
[cc276e] | 93 | ar & forces;
|
---|
[a9558f] | 94 | ar & times.walltime;
|
---|
| 95 | ar & times.cputime;
|
---|
| 96 | ar & times.flops;
|
---|
[cc276e] | 97 | }
|
---|
| 98 | };
|
---|
| 99 |
|
---|
[509014] | 100 | std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
| 101 |
|
---|
[4bc75d] | 102 | #endif /* MPQCDATA_HPP_ */
|
---|