Line data Source code
1 : #include "crpropa/module/OutputShell.h" 2 : #include "crpropa/Units.h" 3 : 4 : #include <iomanip> 5 : 6 : namespace crpropa { 7 : 8 0 : void ShellOutput::process(Candidate* c) const { 9 0 : #pragma omp critical 10 : { 11 : std::cout << std::fixed << std::showpoint << std::setprecision(3) 12 : << std::setw(6); 13 0 : std::cout << c->getTrajectoryLength() / Mpc << " Mpc, "; 14 0 : std::cout << c->getRedshift() << ", "; 15 0 : std::cout << c->current.getId() << ", "; 16 0 : std::cout << c->current.getEnergy() / EeV << " EeV, "; 17 0 : std::cout << c->current.getPosition() / Mpc << " Mpc, "; 18 0 : std::cout << c->current.getDirection(); 19 : std::cout << std::endl; 20 : } 21 0 : } 22 : 23 0 : std::string ShellOutput::getDescription() const { 24 0 : return "Shell output"; 25 : } 26 : 27 0 : void ShellOutput1D::process(Candidate* c) const { 28 0 : #pragma omp critical 29 : { 30 : std::cout << std::fixed << std::showpoint << std::setprecision(3) 31 : << std::setw(6); 32 0 : std::cout << c->current.getPosition().x / Mpc << " Mpc, "; 33 0 : std::cout << c->getRedshift() << ", "; 34 0 : std::cout << c->current.getId() << ", "; 35 0 : std::cout << c->current.getEnergy() / EeV << " EeV"; 36 : std::cout << std::endl; 37 : } 38 0 : } 39 : 40 0 : std::string ShellOutput1D::getDescription() const { 41 0 : return "Shell output for 1D"; 42 : } 43 : 44 0 : void ShellPropertyOutput::process(Candidate* c) const { 45 : Candidate::PropertyMap::const_iterator i = c->properties.begin(); 46 0 : #pragma omp critical 47 : { 48 0 : for ( ; i != c->properties.end(); i++) { 49 0 : std::cout << " " << i->first << ", " << i->second << std::endl; 50 : } 51 : } 52 0 : } 53 : 54 0 : std::string ShellPropertyOutput::getDescription() const { 55 0 : return "Shell property output"; 56 : } 57 : 58 : } // namespace crpropa