From: kanschat Date: Thu, 23 Aug 2012 17:06:17 +0000 (+0000) Subject: test contract3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da8787a26faa3426bec8d6495a85dad49d8c8790;p=dealii-svn.git test contract3 git-svn-id: https://svn.dealii.org/trunk@26101 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/tensor_08.cc b/tests/base/tensor_08.cc new file mode 100644 index 0000000000..32ec919468 --- /dev/null +++ b/tests/base/tensor_08.cc @@ -0,0 +1,58 @@ +//---------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 2006, 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. +// +//---------------------------------------------------------------------- + +// check contract(Tensor<1,dim>,Tensor<2,dim>,Tensor<1,dim>) + +#include "../tests.h" +#include +#include +#include +#include +#include + +template +void test_select(double f1, double f2) +{ + Tensor<2,dim> t; + unsigned int k = 0; + for (unsigned int i=0;i u, v; + u[i] = f1; + v[j] = f2; + deallog << '\t' << contract3(u,t,v); + } + deallog << 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 << std::setprecision(3); + + test_select<2>(1.,1.); + test_select<3>(1.,1.); + test_select<4>(1.,1.); + + test_select<2>(2.,3.); + test_select<3>(2.,3.); + test_select<4>(2.,3.); +} diff --git a/tests/base/tensor_08/cmp/generic b/tests/base/tensor_08/cmp/generic new file mode 100644 index 0000000000..4b541e0282 --- /dev/null +++ b/tests/base/tensor_08/cmp/generic @@ -0,0 +1,7 @@ + +DEAL:: 1.00 2.00 3.00 4.00 +DEAL:: 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 +DEAL:: 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.0 11.0 12.0 13.0 14.0 15.0 16.0 +DEAL:: 6.00 12.0 18.0 24.0 +DEAL:: 6.00 12.0 18.0 24.0 30.0 36.0 42.0 48.0 54.0 +DEAL:: 6.00 12.0 18.0 24.0 30.0 36.0 42.0 48.0 54.0 60.0 66.0 72.0 78.0 84.0 90.0 96.0