Changeset 928f65
- Timestamp:
- May 18, 2016, 10:04:49 PM (9 years ago)
- Branches:
- CombiningParticlePotentialParsing
- Children:
- 52b5ca
- Parents:
- 9bb977
- git-author:
- Frederik Heber <heber@…> (03/10/16 11:52:01)
- git-committer:
- Frederik Heber <heber@…> (05/18/16 22:04:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/PotentialAction/SavePotentialsAction.cpp
r9bb977 r928f65 50 50 #include "Potentials/Exceptions.hpp" 51 51 #include "Potentials/RegistrySerializer.hpp" 52 #include "Potentials/Particles/Particle.hpp" 53 #include "Potentials/Particles/ParticleRegistry.hpp" 52 54 #include "Potentials/PotentialRegistry.hpp" 53 55 … … 63 65 // store the potentials 64 66 if (!params.potential_file.get().string().empty()) { 65 // print fitted potentials66 std::stringstream potentials;67 RegistrySerializer<EmpiricalPotential> serialize(68 potentials,69 PotentialRegistry::getInstance(),70 std::string("potential"));71 serialize();72 LOG(1, "STATUS: Resulting parameters are " << std::endl << potentials.str());73 67 std::ofstream returnstream(params.potential_file.get().string().c_str()); 74 68 if (returnstream.good()) { 69 // print particles 70 std::stringstream particles; 71 RegistrySerializer<Particle> serialize( 72 particles, 73 ParticleRegistry::getInstance(), 74 std::string("particle")); 75 serialize(); 76 LOG(1, "STATUS: Resulting particles are " << std::endl << particles.str()); 77 returnstream << particles.str(); 78 } else { 79 STATUS("Could not open stream to write particles!"); 80 return Action::failure; 81 } 82 if (returnstream.good()) { 83 // print fitted potentials 84 std::stringstream potentials; 85 RegistrySerializer<EmpiricalPotential> serialize( 86 potentials, 87 PotentialRegistry::getInstance(), 88 std::string("potential")); 89 serialize(); 90 LOG(1, "STATUS: Resulting parameters are " << std::endl << potentials.str()); 75 91 returnstream << potentials.str(); 76 92 } else { … … 79 95 } 80 96 } else { 81 STATUS("No existing potential file given!");97 STATUS("No usable potential filename given!"); 82 98 return Action::failure; 83 99 }
Note:
See TracChangeset
for help on using the changeset viewer.