source: src/Fragmentation/Summation/Containers/MPQCData.hpp@ 160ad7

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 160ad7 was 9ff818, checked in by Frederik Heber <heber@…>, 9 years ago

MPQCJob and VMGJob contain reached and desired accuracy.

  • both set exitflag to 1 if desired accuracy has not been reached.
  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[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>
[a2a2f7]18#include <boost/serialization/version.hpp>
[cc276e]19
[509014]20#include <iosfwd>
[cc276e]21#include <vector>
22
[fbf143]23#include "Fragmentation/Summation/SetValues/SamplingGrid.hpp"
[20bb3b]24#include "Fragmentation/Summation/SetValues/FragmentForces.hpp"
[28c025]25
[cc276e]26class MPQCCommandJob;
27class MPQCCommandJobTest;
28class MPQCDataTest;
29
30/** Internal class that holds the data and can be serialized.
31 *
32 */
33class MPQCData {
34 //!> allow MPQCCommandJob access to member variables directly
35 friend class MPQCCommandJob;
36 //!> grant MPQCCommandJob's unit test access
37 friend class MPQCCommandJobTest;
38 //!> grant unit test access
39 friend class MPQCDataTest;
[509014]40 //!> grant access to output stream operator
41 friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
[cc276e]42public:
[28c025]43 /** Constructor for class MPQCData with full sampling information.
44 *
45 * \param _props properties of the grid
46 */
47 MPQCData(const SamplingGridProperties &_props);
48
49 /** Default Constructor for class MPQCData.
50 *
51 */
52 MPQCData();
53
[cc276e]54 bool operator==(const MPQCData &other) const;
55
56 bool operator!=(const MPQCData &other) const {
57 return !(*this == other);
58 }
59
[a9558f]60 /// Energie structure
61 struct energy_t {
62 /** Constructor for struct energy_t, sets all to zero.
63 *
64 */
65 energy_t();
66
67 double total;
68 double nuclear_repulsion;
[adccae]69 double electron_coulomb;
70 double electron_exchange;
[a9558f]71 double correlation;
72 double overlap;
73 double kinetic;
74 double hcore;
[188639]75
76 std::vector<double> eigenvalues;
[a9558f]77 } energies;
[cc276e]78
[a9558f]79 /// Forces
[20bb3b]80 FragmentForces forces;
[cc276e]81
[503acc1]82 //!> whether to actually sample the density
83 enum DoLongrange_t {
84 DontSampleDensity=0,
85 DoSampleDensity=1
86 };
87 DoLongrange_t DoLongrange;
88
[6ff62c]89 //!> whether to sample just the valence or the total electron and nuclei density
90 enum DoValenceOnly_t {
91 DontSampleValenceOnly=0,
92 DoSampleValenceOnly=1
93 };
94 DoValenceOnly_t DoValenceOnly;
95
[815f60]96 /// Density
[28c025]97 SamplingGrid sampled_grid;
[815f60]98
[cd77fc]99 // nuclei positions and charges
100 std::vector< std::vector<double> > positions;
101 std::vector<double> charges;
102
[a9558f]103 /// Timing structure
104 struct times_t {
105 /** Constructor for struct times_t, sets all to zero.
106 *
107 */
108 times_t();
109
[4aee30]110 double total_walltime;
111 double total_cputime;
112 double total_flops;
113 double gather_walltime;
114 double gather_cputime;
115 double gather_flops;
[a9558f]116 } times;
117
[9ff818]118 //!> reached (relative) accuracy
119 double accuracy;
120 //!> desired accuracy
121 double desired_accuracy;
122
[cc276e]123private:
124 friend class boost::serialization::access;
125 // serialization
126 template <typename Archive>
127 void serialize(Archive& ar, const unsigned int version)
128 {
[a9558f]129 ar & energies.total;
130 ar & energies.nuclear_repulsion;
[adccae]131 ar & energies.electron_coulomb;
132 ar & energies.electron_exchange;
[a9558f]133 ar & energies.correlation;
134 ar & energies.overlap;
135 ar & energies.kinetic;
136 ar & energies.hcore;
[188639]137 ar & energies.eigenvalues;
[20bb3b]138 if (version < 2) {
139 FragmentForces::forces_t justforces(forces);
140 ar & justforces;
141 dynamic_cast<FragmentForces::forces_t &>(forces) = justforces;
142 } else
143 ar & forces;
[28c025]144 ar & sampled_grid;
[503acc1]145 ar & DoLongrange;
[6ff62c]146 if (version > 0)
147 ar & DoValenceOnly;
[cd77fc]148 ar & positions;
149 ar & charges;
[4aee30]150 ar & times.total_walltime;
151 ar & times.total_cputime;
152 ar & times.total_flops;
153 ar & times.gather_walltime;
154 ar & times.gather_cputime;
155 ar & times.gather_flops;
[9ff818]156 if (version > 2) {
157 ar & accuracy;
158 ar & desired_accuracy;
159 }
[cc276e]160 }
161};
162
[9ff818]163BOOST_CLASS_VERSION(MPQCData, 3)
[6ff62c]164
[509014]165std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
166
[4bc75d]167#endif /* MPQCDATA_HPP_ */
Note: See TracBrowser for help on using the repository browser.