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_coulomb;
|
---|
55 | double electron_exchange;
|
---|
56 | double correlation;
|
---|
57 | double overlap;
|
---|
58 | double kinetic;
|
---|
59 | double hcore;
|
---|
60 |
|
---|
61 | std::vector<double> eigenvalues;
|
---|
62 | } energies;
|
---|
63 |
|
---|
64 | /// Forces
|
---|
65 | typedef std::vector<double> vector_type;
|
---|
66 | std::vector< vector_type > forces;
|
---|
67 |
|
---|
68 | /// Density
|
---|
69 | typedef std::vector<double> grid_type;
|
---|
70 | grid_type density;
|
---|
71 |
|
---|
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 |
|
---|
84 | private:
|
---|
85 | friend class boost::serialization::access;
|
---|
86 | // serialization
|
---|
87 | template <typename Archive>
|
---|
88 | void serialize(Archive& ar, const unsigned int version)
|
---|
89 | {
|
---|
90 | ar & energies.total;
|
---|
91 | ar & energies.nuclear_repulsion;
|
---|
92 | ar & energies.electron_coulomb;
|
---|
93 | ar & energies.electron_exchange;
|
---|
94 | ar & energies.correlation;
|
---|
95 | ar & energies.overlap;
|
---|
96 | ar & energies.kinetic;
|
---|
97 | ar & energies.hcore;
|
---|
98 | ar & energies.eigenvalues;
|
---|
99 | ar & forces;
|
---|
100 | ar & density;
|
---|
101 | ar & times.walltime;
|
---|
102 | ar & times.cputime;
|
---|
103 | ar & times.flops;
|
---|
104 | }
|
---|
105 | };
|
---|
106 |
|
---|
107 | std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
|
---|
108 |
|
---|
109 | #endif /* MPQCDATA_HPP_ */
|
---|