diff --git a/include/openmc/position.h b/include/openmc/position.h index 4f0ed8a9ae..2be72b27cb 100644 --- a/include/openmc/position.h +++ b/include/openmc/position.h @@ -3,6 +3,7 @@ #include #include // for sqrt +#include #include // for out_of_range #include @@ -94,6 +95,8 @@ inline bool operator==(Position a, Position b) inline bool operator!=(Position a, Position b) {return a.x != b.x || a.y != b.y || a.z != b.z;} +std::ostream& operator<<(std::ostream& os, Position a); + //============================================================================== //! Type representing a vector direction in Cartesian coordinates //============================================================================== diff --git a/src/position.cpp b/src/position.cpp index d7175912b0..1215bfb12e 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -94,4 +94,11 @@ Position::rotate(const std::vector& rotation) const }; } +std::ostream& +operator<<(std::ostream& os, Position r) +{ + os << "(" << r.x << ", " << r.y << ", " << r.z << ")"; + return os; +} + } // namespace openmc