- Timestamp:
- Oct 26, 2012, 3:54:07 PM (12 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, 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_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 4bc75d
- Parents:
- 28e894
- git-author:
- Frederik Heber <heber@…> (07/12/12 10:40:29)
- git-committer:
- Frederik Heber <heber@…> (10/26/12 15:54:07)
- Location:
- src/Jobs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Jobs/MPQCCommandJob.cpp
r28e894 ra9558f 134 134 tok_iter++; 135 135 std::stringstream energystring(*tok_iter); 136 energystring >> data.energ y;136 energystring >> data.energies.total; 137 137 } 138 138 // ... and forces ("Total Gradient") from resultstring -
src/Jobs/MPQCCommandJob_MPQCData.cpp
r28e894 ra9558f 43 43 #include "LinearAlgebra/defs.hpp" 44 44 45 46 /** Constructor for class MPQCData. 47 * 48 */ 49 MPQCData::MPQCData() : 50 energy(0.) 45 MPQCData::energy_t::energy_t() : 46 total(0.), 47 nuclear_repulsion(0.), 48 electron_repulsion(0.), 49 correlation(0.), 50 overlap(0.), 51 kinetic(0.), 52 hcore(0.) 51 53 {} 52 54 53 /** Destructor for class MPQCData. 54 *55 */56 MPQCData::~MPQCData()55 MPQCData::times_t::times_t() : 56 walltime(0.), 57 cputime(0.), 58 flops(0.) 57 59 {} 58 60 … … 62 64 bool MPQCData::operator==(const MPQCData &other) const 63 65 { 64 if (fabs(energ y - other.energy) > std::numeric_limits<double>::epsilon()) {66 if (fabs(energies.total - other.energies.total) > std::numeric_limits<double>::epsilon()) { 65 67 LOG(1, "INFO: Energy's in MPQCData differ: " 66 << energ y << " != " << other.energy<< ".");68 << energies.total << " != " << other.energies.total << "."); 67 69 return false; 68 70 } … … 85 87 std::ostream & operator<<(std::ostream &ost, const MPQCData &data) 86 88 { 87 ost << "Energy: " << data.energy << "\t"; 88 ost << "Forces: " << data.forces; 89 ost << "Energy: " << data.energies.total << "\t"; 90 ost << "Forces: " << data.forces << "\t"; 91 ost << "Times: " << data.times.walltime << ", " << data.times.cputime << ", " << data.times.flops; 89 92 return ost; 90 93 } -
src/Jobs/MPQCCommandJob_MPQCData.hpp
r28e894 ra9558f 37 37 friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data); 38 38 public: 39 MPQCData();40 ~MPQCData();41 42 39 bool operator==(const MPQCData &other) const; 43 40 … … 46 43 } 47 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 } energies; 60 61 /// Forces 48 62 typedef std::vector<double> vector_type; 63 std::vector< vector_type > forces; 49 64 50 double energy; 51 std::vector< vector_type > forces; 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; 52 76 53 77 private: … … 57 81 void serialize(Archive& ar, const unsigned int version) 58 82 { 59 ar & energy; 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; 60 90 ar & forces; 91 ar & times.walltime; 92 ar & times.cputime; 93 ar & times.flops; 61 94 } 62 95 }; -
src/Jobs/MPQCJob.cpp
r28e894 ra9558f 46 46 #include <sstream> 47 47 48 MPQCJob::MPQCJob(const JobId_t _JobId, const std::string &_inputfile) : 49 FragmentJob(_JobId), 50 inputfile(_inputfile) 51 {} 52 53 MPQCJob::MPQCJob() : 54 FragmentJob(JobId::IllegalJob) 55 {} 56 57 MPQCJob::~MPQCJob() 58 {} 59 48 60 FragmentResult::ptr MPQCJob::Work() 49 61 { -
src/Jobs/MPQCJob.hpp
r28e894 ra9558f 27 27 { 28 28 public: 29 MPQCJob(const JobId_t _JobId, const std::string &_inputfile) : 30 FragmentJob(_JobId), 31 inputfile(_inputfile) 32 {} 33 virtual ~MPQCJob() {} 29 MPQCJob(const JobId_t _JobId, const std::string &_inputfile); 30 virtual ~MPQCJob(); 34 31 35 32 FragmentResult::ptr Work(); … … 42 39 /** private default cstor for serialization only 43 40 */ 44 MPQCJob() : 45 FragmentJob(JobId::IllegalJob) 46 {} 41 MPQCJob(); 47 42 48 43 friend class boost::serialization::access; -
src/Jobs/unittests/MPQCCommandJobUnitTest.cpp
r28e894 ra9558f 110 110 // prepare result container 111 111 MPQCData data; 112 data.energ y= -75.637499283020;112 data.energies.total = -75.637499283020; 113 113 std::vector<double> force; 114 114 std::vector< std::vector<double> > forces; -
src/Jobs/unittests/MPQCDataUnitTest.cpp
r28e894 ra9558f 67 67 data = new MPQCData; 68 68 69 data->energ y= -37.3479855;69 data->energies.total = -37.3479855; 70 70 std::vector<double> force; 71 71 std::vector< std::vector<double> > forces; … … 100 100 101 101 // construct closer and closer pendant 102 otherData.energ y= -37.3479855;102 otherData.energies.total = -37.3479855; 103 103 CPPUNIT_ASSERT( *data != otherData ); 104 104 std::vector<double> force; … … 117 117 118 118 // change energy 119 otherData.energ y= -4;119 otherData.energies.total = -4; 120 120 CPPUNIT_ASSERT( *data != otherData ); 121 otherData.energ y= -37.3479855;121 otherData.energies.total = -37.3479855; 122 122 CPPUNIT_ASSERT( *data == otherData ); 123 123 … … 129 129 130 130 // check sensibility 131 otherData.energ y-= 1e-1*std::numeric_limits<double>::epsilon();131 otherData.energies.total -= 1e-1*std::numeric_limits<double>::epsilon(); 132 132 CPPUNIT_ASSERT( *data == otherData ); 133 133 otherData.forces[1][0] -= 1e-1*std::numeric_limits<double>::epsilon();
Note:
See TracChangeset
for help on using the changeset viewer.