From: bangerth Date: Tue, 22 Nov 2011 16:48:35 +0000 (+0000) Subject: New test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bcfb4cab5c2c216af33318c67f8da0d28b810fb;p=dealii-svn.git New test. git-svn-id: https://svn.dealii.org/trunk@24759 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/functions_06.cc b/tests/base/functions_06.cc new file mode 100644 index 0000000000..60fbf9bb88 --- /dev/null +++ b/tests/base/functions_06.cc @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007, 2008, 2010, 2011 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. +// +//----------------------------------------------------------------------------- + +// Test VectorFunctionFromScalarFunctionObject + +#include "../tests.h" +#include +#include + + +template +void check1 () +{ + VectorFunctionFromScalarFunctionObject + object (&Point::norm, 3, 1); + + Assert (object.n_components == 3, ExcInternalError()); + + for (unsigned int i=0; i<10; ++i) + { + Point p; + for (unsigned int d=0; d v(3); + object.vector_value (p, v); + for (unsigned int c=0; c<3; ++c) + Assert (v(c) == (c==1 ? p.norm() : 0), + ExcInternalError()); + } + + deallog << "OK" << std::endl; +} + + +template +void check2 () +{ + Point q; + for (unsigned int d=0; d + object (std_cxx1x::bind (&Point::distance, + q, + std_cxx1x::_1)); + + for (unsigned int i=0; i<10; ++i) + { + Point p; + for (unsigned int d=0; d (); + check1<2> (); + check1<3> (); + + check2<1> (); + check2<2> (); + check2<3> (); +} + + diff --git a/tests/base/functions_06/cmp/generic b/tests/base/functions_06/cmp/generic new file mode 100644 index 0000000000..0aa61ff573 --- /dev/null +++ b/tests/base/functions_06/cmp/generic @@ -0,0 +1,7 @@ + +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK