From 027d9f3a31b415bfe440f2e337bd82059e4931a6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 13 Jul 2012 22:15:02 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@25699 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/functions_07.cc | 74 +++++++++++++++++++++++++++++ tests/base/functions_07/cmp/generic | 4 ++ 2 files changed, 78 insertions(+) create mode 100644 tests/base/functions_07.cc create mode 100644 tests/base/functions_07/cmp/generic diff --git a/tests/base/functions_07.cc b/tests/base/functions_07.cc new file mode 100644 index 0000000000..84fb883c22 --- /dev/null +++ b/tests/base/functions_07.cc @@ -0,0 +1,74 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007, 2008, 2010, 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 +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//----------------------------------------------------------------------------- + +// synthesize the laplacian_list function out of repeated calls to +// laplacian + +#include "../tests.h" +#include +#include + + +template +class F : public Function +{ + public: + double laplacian (const Point &p, + const unsigned int c) const + { + Assert (c == 0, ExcInternalError()); + return p.norm(); + } +}; + + +template +void check () +{ + std::vector > points; + for (unsigned int i=0; i<10; ++i) + { + Point p; + for (unsigned int d=0; d f; + std::vector laplacians(10); + f.laplacian_list (points, laplacians); + + for (unsigned int i=0; i<10; ++i) + Assert (points[i].norm() == laplacians[i], + ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + + +int main() +{ + std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output"); + std::ofstream logfile(logname.c_str()); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + check<1> (); + check<2> (); + check<3> (); +} + + diff --git a/tests/base/functions_07/cmp/generic b/tests/base/functions_07/cmp/generic new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/base/functions_07/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK -- 2.39.5