<h3>Specific improvements</h3>
<ol>
+<li> New: There is now an operator* for the multiplication of a <code>SymmetricTensor@<2,dim@></code>
+and a <code>Tensor@<1,dim@></code>.
+<br>
+(Wolfgang Bangerth, 2011/04/12)
+
<li> Fixed: Added some instantiations to make KellyErrorEstimator and SolutionTransfer
work in codimension one. Fixed some dim in spacedim.
<br>
(Luca Heltai, 2011/04/11)
-<li> Fixed: Added some instantiations to make anisotropic refinement work
+<li> Fixed: Added some instantiations to make anisotropic refinement work
in codimension one.
<br>
(Luca Heltai, 2011/03/31)
for (unsigned int i=0; i<stokes_dofs_per_cell; ++i)
for (unsigned int j=0; j<elasticity_dofs_per_cell; ++j)
local_matrix(i,j) += (2 * viscosity *
- contract(stokes_phi_grads_u[i],
- normal_vector) *
+ (stokes_phi_grads_u[i] *
+ normal_vector) *
elasticity_phi[j] *
stokes_fe_face_values.JxW(q));
}
+/**
+ * Multiplication operator performing a contraction of the last index
+ * of the first argument and the first index of the second
+ * argument. This function therefore does the same as the
+ * corresponding <tt>contract</tt> function, but returns the result as
+ * a return value, rather than writing it into the reference given as
+ * the first argument to the <tt>contract</tt> function.
+ *
+ * Note that for the <tt>Tensor</tt> class, the multiplication
+ * operator only performs a contraction over a single pair of
+ * indices. This is in contrast to the multiplication operator for
+ * symmetric tensors, which does the double contraction.
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+Tensor<1,dim>
+operator * (const SymmetricTensor<2,dim> &src1,
+ const Tensor<1,dim> &src2)
+{
+ Tensor<1,dim> dest;
+ for (unsigned int i=0; i<dim; ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ dest[i] += src1[i][j] * src2[j];
+ return dest;
+}
+
+
/**
* Output operator for symmetric tensors of rank 2. Print the elements
* consecutively, with a space in between, two spaces between rank 1