[cc276e] | 1 | /*
|
---|
| 2 | * MPQCCommandJob_MPQCData.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Feb 08, 2012
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef MPQCCOMMANDJOB_MPQCDATA_HPP_
|
---|
| 9 | #define MPQCCOMMANDJOB_MPQCDATA_HPP_
|
---|
| 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;
|
---|
| 59 | } energies;
|
---|
[cc276e] | 60 |
|
---|
[a9558f] | 61 | /// Forces
|
---|
| 62 | typedef std::vector<double> vector_type;
|
---|
[cc276e] | 63 | std::vector< vector_type > forces;
|
---|
| 64 |
|
---|
[a9558f] | 65 | /// Timing structure
|
---|
| 66 | struct times_t {
|
---|
| 67 | /** Constructor for struct times_t, sets all to zero.
|
---|
| 68 | *
|
---|
| 69 | */
|
---|
| 70 | times_t();
|
---|
| 71 |
|
---|
| 72 | double walltime;
|
---|
| 73 | double cputime;
|
---|
| 74 | double flops;
|
---|
| 75 | } times;
|
---|
| 76 |
|
---|
[cc276e] | 77 | private:
|
---|
| 78 | friend class boost::serialization::access;
|
---|
| 79 | // serialization
|
---|
| 80 | template <typename Archive>
|
---|
| 81 | void serialize(Archive& ar, const unsigned int version)
|
---|
| 82 | {
|
---|
[a9558f] | 83 | ar & energies.total;
|
---|
| 84 | ar & energies.nuclear_repulsion;
|
---|
| 85 | ar & energies.electron_repulsion;
|
---|
| 86 | ar & energies.correlation;
|
---|
| 87 | ar & energies.overlap;
|
---|
| 88 | ar & energies.kinetic;
|
---|
| 89 | ar & energies.hcore;
|
---|
[cc276e] | 90 | ar & forces;
|
---|
[a9558f] | 91 | ar & times.walltime;
|
---|
| 92 | ar & times.cputime;
|
---|
| 93 | ar & times.flops;
|
---|
[cc276e] | 94 | }
|
---|
| 95 | };
|
---|
| 96 |
|
---|
[509014] | 97 | std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
| 98 |
|
---|
[cc276e] | 99 | #endif /* MPQCCOMMANDJOB_MPQCDATA_HPP_ */
|
---|