From 088c90f4be586409dd1420a576eb7086794638b4 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 4 Jul 2012 12:16:47 +0000 Subject: [PATCH] Make tests more specific. git-svn-id: https://svn.dealii.org/trunk@25677 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/fe_field_function_04.cc | 20 +++++++++++++++++++- tests/bits/fe_field_function_05.cc | 24 +++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/bits/fe_field_function_04.cc b/tests/bits/fe_field_function_04.cc index b54a7fabf7..6d469a7d0f 100644 --- a/tests/bits/fe_field_function_04.cc +++ b/tests/bits/fe_field_function_04.cc @@ -26,6 +26,19 @@ #include #include #include +#include + + +template +class F : public Function +{ + public: + virtual double value (const Point &p, + const unsigned int) const + { + return p.square(); + } +}; template @@ -43,6 +56,7 @@ void test() dof_handler.distribute_dofs(fe); Vector solution(dof_handler.n_dofs()); + VectorTools::interpolate (dof_handler, F(), solution); Functions::FEFieldFunction<2> fe_function (dof_handler, solution); std::vector > points; @@ -68,7 +82,11 @@ void test() std::vector m (points.size()); fe_function.value_list (points, m); - triangulation.set_boundary (0); + for (unsigned int i=0; i #include #include +#include + + +template +class F : public Function +{ + public: + virtual double value (const Point &p, + const unsigned int) const + { + return p.square(); + } +}; template @@ -46,7 +59,12 @@ void test() DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); + // interpolate a quadratic function + // into the space; this function + // can be represented exactly, so + // that we can compare again later Vector solution(dof_handler.n_dofs()); + VectorTools::interpolate (dof_handler, F(), solution); Functions::FEFieldFunction<2> fe_function (dof_handler, solution); std::vector > points; @@ -75,7 +93,11 @@ void test() std::vector m (points.size()); fe_function.value_list (points, m); - triangulation.set_boundary (0); + for (unsigned int i=0; i