From: wolf Date: Sat, 28 May 2005 19:04:57 +0000 (+0000) Subject: New tests. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d70438f1b446063f8a2f24e17d2228a6415042aa;p=dealii-svn.git New tests. git-svn-id: https://svn.dealii.org/trunk@10770 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/symmetric_tensor_10.cc b/tests/base/symmetric_tensor_10.cc new file mode 100644 index 0000000000..b78187fb82 --- /dev/null +++ b/tests/base/symmetric_tensor_10.cc @@ -0,0 +1,66 @@ +//---------------------------- symmetric_tensor_10.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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_10.cc --------------------------- + +// test deviator + +#include "../tests.h" +#include +#include +#include +#include + + +template +void test () +{ + deallog << "dim=" << dim << std::endl; + + SymmetricTensor<2,dim> t; + for (unsigned int i=0; i x = deviator(t); + + deallog << "x=" << std::endl; + for (unsigned int i=0; i (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/symmetric_tensor_11.cc b/tests/base/symmetric_tensor_11.cc new file mode 100644 index 0000000000..c04f9432f0 --- /dev/null +++ b/tests/base/symmetric_tensor_11.cc @@ -0,0 +1,68 @@ +//---------------------------- symmetric_tensor_11.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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_11.cc --------------------------- + +// test deviator_tensor and make sure it yields the same result as calling +// deviator() + +#include "../tests.h" +#include +#include +#include +#include + + +template +void test () +{ + deallog << "dim=" << dim << std::endl; + + SymmetricTensor<2,dim> t; + for (unsigned int i=0; i x = deviator_tensor() * t; + Assert ((x-deviator(t)).norm() < 1e-15*t.norm(), ExcInternalError()); + + deallog << "x=" << std::endl; + for (unsigned int i=0; i (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/symmetric_tensor_12.cc b/tests/base/symmetric_tensor_12.cc new file mode 100644 index 0000000000..6b97539b4f --- /dev/null +++ b/tests/base/symmetric_tensor_12.cc @@ -0,0 +1,53 @@ +//---------------------------- symmetric_tensor_12.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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_12.cc --------------------------- + +// deviators are trace free by definition + +#include "../tests.h" +#include +#include +#include +#include + + +template +void test () +{ + deallog << "dim=" << dim << std::endl; + + SymmetricTensor<2,dim> t; + for (unsigned int i=0; i (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/base/symmetric_tensor_13.cc b/tests/base/symmetric_tensor_13.cc new file mode 100644 index 0000000000..b5c0b8ffc3 --- /dev/null +++ b/tests/base/symmetric_tensor_13.cc @@ -0,0 +1,53 @@ +//---------------------------- symmetric_tensor_13.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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_13.cc --------------------------- + +// deviators are trace free by definition + +#include "../tests.h" +#include +#include +#include +#include + + +template +void test () +{ + deallog << "dim=" << dim << std::endl; + + SymmetricTensor<2,dim> t; + for (unsigned int i=0; i()*t) < 1e-15*t.norm(), + ExcInternalError()); +} + + + + +int main () +{ + std::ofstream logfile("symmetric_tensor_13.output"); + logfile.precision(3); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_10.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_10.output new file mode 100644 index 0000000000..8ef487a5ac --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_10.output @@ -0,0 +1,39 @@ + +DEAL::dim=1 +DEAL::x= +DEAL::0 0 0 +DEAL::t-x= +DEAL::0 0 1.00 +DEAL::dim=2 +DEAL::x= +DEAL::0 0 -2.00 +DEAL::0 1 3.00 +DEAL::1 0 3.00 +DEAL::1 1 2.00 +DEAL::t-x= +DEAL::0 0 3.00 +DEAL::0 1 0 +DEAL::1 0 0 +DEAL::1 1 3.00 +DEAL::dim=3 +DEAL::x= +DEAL::0 0 -5.33 +DEAL::0 1 3.00 +DEAL::0 2 5.00 +DEAL::1 0 3.00 +DEAL::1 1 -1.33 +DEAL::1 2 9.00 +DEAL::2 0 5.00 +DEAL::2 1 9.00 +DEAL::2 2 6.67 +DEAL::t-x= +DEAL::0 0 6.33 +DEAL::0 1 0 +DEAL::0 2 0 +DEAL::1 0 0 +DEAL::1 1 6.33 +DEAL::1 2 0 +DEAL::2 0 0 +DEAL::2 1 0 +DEAL::2 2 6.33 +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_11.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_11.output new file mode 100644 index 0000000000..8ef487a5ac --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_11.output @@ -0,0 +1,39 @@ + +DEAL::dim=1 +DEAL::x= +DEAL::0 0 0 +DEAL::t-x= +DEAL::0 0 1.00 +DEAL::dim=2 +DEAL::x= +DEAL::0 0 -2.00 +DEAL::0 1 3.00 +DEAL::1 0 3.00 +DEAL::1 1 2.00 +DEAL::t-x= +DEAL::0 0 3.00 +DEAL::0 1 0 +DEAL::1 0 0 +DEAL::1 1 3.00 +DEAL::dim=3 +DEAL::x= +DEAL::0 0 -5.33 +DEAL::0 1 3.00 +DEAL::0 2 5.00 +DEAL::1 0 3.00 +DEAL::1 1 -1.33 +DEAL::1 2 9.00 +DEAL::2 0 5.00 +DEAL::2 1 9.00 +DEAL::2 2 6.67 +DEAL::t-x= +DEAL::0 0 6.33 +DEAL::0 1 0 +DEAL::0 2 0 +DEAL::1 0 0 +DEAL::1 1 6.33 +DEAL::1 2 0 +DEAL::2 0 0 +DEAL::2 1 0 +DEAL::2 2 6.33 +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_12.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_12.output new file mode 100644 index 0000000000..fe42c7cdec --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_12.output @@ -0,0 +1,5 @@ + +DEAL::dim=1 +DEAL::dim=2 +DEAL::dim=3 +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_13.output b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_13.output new file mode 100644 index 0000000000..fe42c7cdec --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/base/symmetric_tensor_13.output @@ -0,0 +1,5 @@ + +DEAL::dim=1 +DEAL::dim=2 +DEAL::dim=3 +DEAL::OK