From: kanschat Date: Thu, 23 Aug 2012 16:57:57 +0000 (+0000) Subject: test double contraction X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a461b64ed1bb0d228b32ab95a1387f6b96bee1cf;p=dealii-svn.git test double contraction git-svn-id: https://svn.dealii.org/trunk@26100 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/tensor_05.cc b/tests/base/tensor_05.cc index 41d7d6f355..91a918933a 100644 --- a/tests/base/tensor_05.cc +++ b/tests/base/tensor_05.cc @@ -22,10 +22,11 @@ int main () { - std::ofstream logfile("tensor_05/output"); - deallog << std::setprecision(3); + 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); deallog.threshold_double(1.e-10); double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}}; diff --git a/tests/base/tensor_07.cc b/tests/base/tensor_07.cc new file mode 100644 index 0000000000..442fe0a142 --- /dev/null +++ b/tests/base/tensor_07.cc @@ -0,0 +1,89 @@ +//---------------------------- tensor_05.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// 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. +// +//---------------------------- tensor_05.cc --------------------------- + +// check double_contract(Tensor<2,dim>,Tensor<2,dim>) + +#include "../tests.h" +#include +#include +#include +#include +#include + +template +void test_constant() +{ + Tensor<2,dim> t; + for (unsigned int i=0;i +void test_equal() +{ + Tensor<2,dim> t; + unsigned int sum = 0; + for (unsigned int i=0;i +void test_unequal() +{ + Tensor<2,dim> s; + Tensor<2,dim> t; + unsigned int sum = 0; + for (unsigned int i=0;i(); + test_constant<3>(); + test_constant<4>(); + + test_equal<2>(); + test_equal<3>(); + test_equal<4>(); + + test_unequal<2>(); + test_unequal<3>(); + test_unequal<4>(); +} diff --git a/tests/base/tensor_07/cmp/generic b/tests/base/tensor_07/cmp/generic new file mode 100644 index 0000000000..4d35b35229 --- /dev/null +++ b/tests/base/tensor_07/cmp/generic @@ -0,0 +1,10 @@ + +DEAL::Constant dim 2 16.0000 compare 16 +DEAL::Constant dim 3 36.0000 compare 36 +DEAL::Constant dim 4 64.0000 compare 64 +DEAL::Equal dim 2 14.0000 compare 14 +DEAL::Equal dim 3 204.000 compare 204 +DEAL::Equal dim 4 1240.00 compare 1240 +DEAL::Unequal dim 2 13.0000 compare 13 +DEAL::Unequal dim 3 180.000 compare 180 +DEAL::Unequal dim 4 1060.00 compare 1060