From: Wolfgang Bangerth Date: Fri, 24 Mar 2006 20:35:21 +0000 (+0000) Subject: New tests X-Git-Tag: v8.0.0~12027 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73c90efe2596c3c0957dcaffcb596deb747a373e;p=dealii.git New tests git-svn-id: https://svn.dealii.org/trunk@12673 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/Makefile b/tests/base/Makefile index 08e4ce2698..da984a95c3 100644 --- a/tests/base/Makefile +++ b/tests/base/Makefile @@ -30,6 +30,7 @@ tests_x = logtest \ slice_vector \ table \ tensor \ + tensor_* \ symmetric_tensor_* \ full_tensor_* \ timer \ diff --git a/tests/base/symmetric_tensor_20.cc b/tests/base/symmetric_tensor_20.cc new file mode 100644 index 0000000000..69d5f31df9 --- /dev/null +++ b/tests/base/symmetric_tensor_20.cc @@ -0,0 +1,41 @@ +//---------------------------- symmetric_tensor_20.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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. +// +//---------------------------- symmetric_tensor_20.cc --------------------------- + +// check SymmetricTensor<2,dim>::operator= (double) + +#include +#include +#include +#include +#include + +int main () +{ + std::ofstream logfile("symmetric_tensor_20/output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + const unsigned int dim=3; + SymmetricTensor<2,dim> t; + t[0][0] = t[1][0] = t[1][1] = t[2][2] = 3; + + deallog << t.norm() << std::endl; + t = 0; + deallog << t.norm() << std::endl; + + Assert (t.norm() == 0, ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/symmetric_tensor_20/cmp/generic b/tests/base/symmetric_tensor_20/cmp/generic new file mode 100644 index 0000000000..2f6e72a06b --- /dev/null +++ b/tests/base/symmetric_tensor_20/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::6.71 +DEAL::0 +DEAL::OK diff --git a/tests/base/symmetric_tensor_21.cc b/tests/base/symmetric_tensor_21.cc new file mode 100644 index 0000000000..ee8699172f --- /dev/null +++ b/tests/base/symmetric_tensor_21.cc @@ -0,0 +1,42 @@ +//---------------------------- symmetric_tensor_21.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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. +// +//---------------------------- symmetric_tensor_21.cc --------------------------- + +// check SymmetricTensor<2,dim>::operator= (double) + +#include +#include +#include +#include +#include + +int main () +{ + std::ofstream logfile("symmetric_tensor_21/output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + const unsigned int dim=3; + SymmetricTensor<4,dim> t; + t[0][0][0][0] = t[1][0][1][0] = t[1][1][1][1] + = t[2][2][2][2] = t[2][0][2][0] = 3; + + deallog << t.norm() << std::endl; + t = 0; + deallog << t.norm() << std::endl; + + Assert (t.norm() == 0, ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/symmetric_tensor_21/cmp/generic b/tests/base/symmetric_tensor_21/cmp/generic new file mode 100644 index 0000000000..db9438b167 --- /dev/null +++ b/tests/base/symmetric_tensor_21/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::9.95 +DEAL::0 +DEAL::OK diff --git a/tests/base/tensor_02.cc b/tests/base/tensor_02.cc new file mode 100644 index 0000000000..255df374e9 --- /dev/null +++ b/tests/base/tensor_02.cc @@ -0,0 +1,42 @@ +//---------------------------- tensor_02.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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_02.cc --------------------------- + +// check Tensor::operator= (double) + +#include +#include +#include +#include +#include + +int main () +{ + std::ofstream logfile("tensor_02/output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}}; + + const unsigned int dim=3; + Tensor<2,dim> t(a); + + deallog << t.norm() << std::endl; + t = 0; + deallog << t.norm() << std::endl; + + Assert (t.norm() == 0, ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/tensor_02/cmp/generic b/tests/base/tensor_02/cmp/generic new file mode 100644 index 0000000000..4931f44c9b --- /dev/null +++ b/tests/base/tensor_02/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::14.6 +DEAL::0 +DEAL::OK diff --git a/tests/base/tensor_03.cc b/tests/base/tensor_03.cc new file mode 100644 index 0000000000..901e2348d8 --- /dev/null +++ b/tests/base/tensor_03.cc @@ -0,0 +1,42 @@ +//---------------------------- tensor_03.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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_03.cc --------------------------- + +// check Tensor<1,dim>::operator= (double) + +#include +#include +#include +#include +#include + +int main () +{ + std::ofstream logfile("tensor_03/output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + double a[3] = {1, 2, 3}; + + const unsigned int dim=3; + Tensor<1,dim> t(a); + + deallog << t.norm() << std::endl; + t = 0; + deallog << t.norm() << std::endl; + + Assert (t.norm() == 0, ExcInternalError()); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/tensor_03/cmp/generic b/tests/base/tensor_03/cmp/generic new file mode 100644 index 0000000000..4c40f1b7af --- /dev/null +++ b/tests/base/tensor_03/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::3.74 +DEAL::0 +DEAL::OK