]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add the forgotten output operator.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 16 Jul 2009 04:10:49 +0000 (04:10 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 16 Jul 2009 04:10:49 +0000 (04:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@19091 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor_base.h

index 7ee19d626ca02cc72b1489427a6afb9e636e91f9..103c6fe14c98c9d9ce9052666ecfc695d058e7c6 100644 (file)
@@ -1178,6 +1178,22 @@ Tensor<1,dim>::memory_consumption ()
 #endif // DOXYGEN
 
 
+/**
+ * Output operator for tensors of rank 0. Since such tensors are
+ * scalars, we simply print this one value.
+ *
+ * @relates Tensor<0,dim>
+ */
+template <int dim>
+inline
+std::ostream & operator << (std::ostream &out, const Tensor<0,dim> &p)
+{
+  out << static_cast<double>(p);
+  return out;
+}
+
+
+
 /**
  * Output operator for tensors of rank 1. Print the elements
  * consecutively, with a space in between.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.