#include <deal.II/grid/manifold_lib.h>
#include <deal.II/lac/affine_constraints.h>
+#include <deal.II/lac/linear_operator.h>
#include <deal.II/lac/trilinos_sparse_matrix.h>
#include <deal.II/lac/trilinos_sparsity_pattern.h>
mf.vmult(out, in);
+ // Check that things work with LinearOperator too. This verifies that the
+ // detection mechanism for initialize_dof_vector() works.
+ {
+ LinearAlgebra::distributed::Vector<number> out2;
+ mf.initialize_dof_vector(out2);
+
+ const auto op_mf = linear_operator<decltype(out2)>(mf);
+ op_mf.vmult(out2, in);
+
+ out2 -= out;
+ AssertThrow(out2.l2_norm() == 0.0, ExcInternalError());
+ }
// assemble trilinos sparse matrix with
// (v, u) for reference
sparse_matrix.vmult(ref, in);
out -= ref;
- const double diff_norm = out.linfty_norm();
+ // For completeness, try again with LinearOperator for the same detection
+ // reasons as above:
+ {
+ LinearAlgebra::distributed::Vector<number> out2;
+ mf.initialize_dof_vector(out2);
+
+ const auto op_mf = linear_operator<decltype(out2)>(sparse_matrix);
+ op_mf.vmult(out2, in);
+
+ out2 -= ref;
+ AssertThrow(out2.l2_norm() == 0.0, ExcInternalError());
+ }
+
+ const double diff_norm = out.linfty_norm();
deallog << "Norm of difference: " << diff_norm << std::endl << std::endl;
}
-// the same as laplace_operator_01, but tests heterogeneous Laplace operator.
+// the same as laplace_operator_01 (excluding the extra detection tests), but
+// tests heterogeneous Laplace operator.
#include <deal.II/base/function.h>
#include <deal.II/base/utilities.h>
-// the same as laplace_operator_01, but heterogeneous Laplace operator with a
-// single constant coefficient per cell
+// the same as laplace_operator_01 (excluding the extra detection tests), but
+// heterogeneous Laplace operator with a single constant coefficient per cell
#include <deal.II/base/function.h>
#include <deal.II/base/utilities.h>