From e269e6cf9bc1e1302a1902c659eb239f3eb3620e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 10 Jul 2016 13:52:30 -0500 Subject: [PATCH] Add a test. --- tests/base/derivative_forms_02.cc | 62 +++++++++++++++++++++++++++ tests/base/derivative_forms_02.output | 13 ++++++ 2 files changed, 75 insertions(+) create mode 100644 tests/base/derivative_forms_02.cc create mode 100644 tests/base/derivative_forms_02.output diff --git a/tests/base/derivative_forms_02.cc b/tests/base/derivative_forms_02.cc new file mode 100644 index 0000000000..edd6cd52c5 --- /dev/null +++ b/tests/base/derivative_forms_02.cc @@ -0,0 +1,62 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2000 - 2016 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + +// exercise DerivativeForm::norm() + + +#include "../tests.h" +#include + + +template +void test() +{ + DerivativeForm<1,dim,spacedim> dF; + double dF_norm_sqr = 0; + for (unsigned int i=0; i ddF; + double ddF_norm_sqr = 0; + for (unsigned int i=0; i(); + test<1,2>(); + test<1,3>(); + test<2,2>(); + test<2,3>(); + test<3,3>(); +} diff --git a/tests/base/derivative_forms_02.output b/tests/base/derivative_forms_02.output new file mode 100644 index 0000000000..d21740850c --- /dev/null +++ b/tests/base/derivative_forms_02.output @@ -0,0 +1,13 @@ + +DEAL::||dF||: 1.00000 +DEAL::||ddF||: 1.00000 +DEAL::||dF||: 2.23607 +DEAL::||ddF||: 2.23607 +DEAL::||dF||: 3.74166 +DEAL::||ddF||: 3.74166 +DEAL::||dF||: 5.47723 +DEAL::||ddF||: 12.4900 +DEAL::||dF||: 8.00000 +DEAL::||ddF||: 17.0294 +DEAL::||dF||: 13.1909 +DEAL::||ddF||: 39.6863 -- 2.39.5