File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131#include < cstdlib> // *must* precede <cmath> for proper std:abs() on PGI, Sun Studio CC
3232#include < cmath>
3333#include < complex>
34+ #include < iostream>
35+ #include < iomanip> // for std::setw, std::setiosflags
3436
3537namespace libMesh
3638{
@@ -1100,6 +1102,30 @@ TypeVector<T> TypeVector<T>::unit() const
11001102
11011103}
11021104
1105+ template <typename T>
1106+ void TypeVector<T>::print(std::ostream & os) const
1107+ {
1108+ #if LIBMESH_DIM == 1
1109+
1110+ os << " x=" << (*this )(0 );
1111+
1112+ #endif
1113+ #if LIBMESH_DIM == 2
1114+
1115+ os << " (x,y)=("
1116+ << std::setw (8 ) << (*this )(0 ) << " , "
1117+ << std::setw (8 ) << (*this )(1 ) << " )" ;
1118+
1119+ #endif
1120+ #if LIBMESH_DIM == 3
1121+
1122+ os << " (x,y,z)=("
1123+ << std::setw (8 ) << (*this )(0 ) << " , "
1124+ << std::setw (8 ) << (*this )(1 ) << " , "
1125+ << std::setw (8 ) << (*this )(2 ) << " )" ;
1126+ #endif
1127+ }
1128+
11031129template <typename T>
11041130struct CompareTypes <TypeVector<T>, TypeVector<T>>
11051131{
Original file line number Diff line number Diff line change 2222#include "libmesh/type_vector.h"
2323
2424// C++ includes
25- #include <iostream>
26- #include <iomanip> // for std::setw, std::setiosflags
2725#include <type_traits> // std::is_trivially_copyable
2826
2927
@@ -43,32 +41,6 @@ namespace libMesh
4341
4442// ------------------------------------------------------------
4543// TypeVector<T> class member functions
46- template < typename T >
47- void TypeVector < T > ::print (std ::ostream & os ) const
48- {
49- #if LIBMESH_DIM == 1
50-
51- os << "x=" << (* this )(0 );
52-
53- #endif
54- #if LIBMESH_DIM == 2
55-
56- os << "(x,y)=("
57- << std ::setw (8 ) << (* this )(0 ) << ", "
58- << std ::setw (8 ) << (* this )(1 ) << ")" ;
59-
60- #endif
61- #if LIBMESH_DIM == 3
62-
63- os << "(x,y,z)=("
64- << std ::setw (8 ) << (* this )(0 ) << ", "
65- << std ::setw (8 ) << (* this )(1 ) << ", "
66- << std ::setw (8 ) << (* this )(2 ) << ")" ;
67- #endif
68- }
69-
70-
71-
7244
7345
7446template < typename T >
You can’t perform that action at this time.
0 commit comments