1 | /*
|
---|
2 | * MPQCData.hpp
|
---|
3 | *
|
---|
4 | * Created on: Feb 08, 2012
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef MPQCDATA_HPP_
|
---|
9 | #define 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 |
|
---|
19 | #include <iosfwd>
|
---|
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;
|
---|
36 | //!> grant access to output stream operator
|
---|
37 | friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
38 | public:
|
---|
39 | bool operator==(const MPQCData &other) const;
|
---|
40 |
|
---|
41 | bool operator!=(const MPQCData &other) const {
|
---|
42 | return !(*this == other);
|
---|
43 | }
|
---|
44 |
|
---|
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 |
|
---|
60 | std::vector<double> eigenvalues;
|
---|
61 | } energies;
|
---|
62 |
|
---|
63 | /// Forces
|
---|
64 | typedef std::vector<double> vector_type;
|
---|
65 | std::vector< vector_type > forces;
|
---|
66 |
|
---|
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 |
|
---|
79 | private:
|
---|
80 | friend class boost::serialization::access;
|
---|
81 | // serialization
|
---|
82 | template <typename Archive>
|
---|
83 | void serialize(Archive& ar, const unsigned int version)
|
---|
84 | {
|
---|
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;
|
---|
92 | ar & energies.eigenvalues;
|
---|
93 | ar & forces;
|
---|
94 | ar & times.walltime;
|
---|
95 | ar & times.cputime;
|
---|
96 | ar & times.flops;
|
---|
97 | }
|
---|
98 | };
|
---|
99 |
|
---|
100 | std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
101 |
|
---|
102 | #endif /* MPQCDATA_HPP_ */
|
---|