From: Matthias Maier Date: Thu, 3 May 2018 02:48:47 +0000 (-0500) Subject: add a test X-Git-Tag: v9.0.0-rc1~28^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52757f01b8fa367980a9fbdbf994ca68a16eb8c5;p=dealii.git add a test --- diff --git a/tests/lac/linear_operator_17.cc b/tests/lac/linear_operator_17.cc new file mode 100644 index 0000000000..6c2ad6679d --- /dev/null +++ b/tests/lac/linear_operator_17.cc @@ -0,0 +1,51 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2015 - 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +// Test the LinearOperator template on a trivial vector implementation +// :: RightVector -> LeftVector + +#include "../tests.h" + +#include +#include + + +using namespace dealii; + + +int main() +{ + initlog(); + + const std::function &, bool)> reinit_vector = + [](Vector &v, bool omit_zeroing_entries) { + v.reinit(3, omit_zeroing_entries); + }; + + const auto filter = mean_value_filter(reinit_vector); + + Vector vec (3); + vec[0] = 1.; + vec[1] = 2.; + vec[2] = 3.; + + deallog << vec << std::endl; + + filter.vmult_add(vec, vec); + deallog << vec << std::endl; + + filter.vmult(vec, vec); + deallog << vec << std::endl; +} diff --git a/tests/lac/linear_operator_17.output b/tests/lac/linear_operator_17.output new file mode 100644 index 0000000000..16f08000f1 --- /dev/null +++ b/tests/lac/linear_operator_17.output @@ -0,0 +1,7 @@ + +DEAL::1.00000 2.00000 3.00000 +DEAL:: +DEAL::0.00000 2.00000 4.00000 +DEAL:: +DEAL::-2.00000 0.00000 2.00000 +DEAL::