<h3>Specific improvements</h3>
<ol>
+<li> New: There are now global functions l1_norm() and linfty_norm() that compute
+the respective norms of a rank-2 tensor.
+<br>
+(Wolfgang Bangerth, 2012/02/08)
<li> New: VectorTools::interpolation_to_different_mesh implemented which interpolates between
DoFHandlers with different triangulations based on a common coarse grid.
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2011, 2012 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#endif // DOXYGEN
+/**
+ * Return the $l_1$ norm of the given rank-2 tensor, where
+ * $||t||_1 = \max_j \sum_i |t_{ij}|$ (maximum of
+ * the sums over columns).
+ *
+ * @relates Tensor
+ * @author Wolfgang Bangerth, 2012
+ */
+template <int dim, typename Number>
+inline
+double
+l1_norm (const Tensor<2,dim,Number> &t)
+{
+ double max = 0;
+ for (unsigned int j=0; j<dim; ++j)
+ {
+ double sum = 0;
+ for (unsigned int i=0; i<dim; ++i)
+ sum += std::fabs(t[i][j]);
+
+ if (sum > max)
+ max = sum;
+ }
+
+ return max;
+}
+
+
+
+/**
+ * Return the $l_\infty$ norm of the given rank-2 tensor, where
+ * $||t||_\infty = \max_i \sum_j |t_{ij}|$ (maximum of
+ * the sums over rows).
+ *
+ * @relates Tensor
+ * @author Wolfgang Bangerth, 2012
+ */
+template <int dim, typename Number>
+inline
+double
+linfty_norm (const Tensor<2,dim,Number> &t)
+{
+ double max = 0;
+ for (unsigned int i=0; i<dim; ++i)
+ {
+ double sum = 0;
+ for (unsigned int j=0; j<dim; ++j)
+ sum += std::fabs(t[i][j]);
+
+ if (sum > max)
+ max = sum;
+ }
+
+ return max;
+}
+
+
/**
* Multiplication of a tensor of general rank with a scalar Number