From 1dbf40d55208d132442a654a6ca7995def604b67 Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 12 Mar 2004 10:09:04 +0000 Subject: [PATCH] Check prolongation and get_interpolation. git-svn-id: https://svn.dealii.org/trunk@8720 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/dgp_monomial_1.cc | 83 ++++++++++++++++++++++++++++++++++++++ tests/fe/dgp_monomial_2.cc | 83 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 tests/fe/dgp_monomial_1.cc create mode 100644 tests/fe/dgp_monomial_2.cc diff --git a/tests/fe/dgp_monomial_1.cc b/tests/fe/dgp_monomial_1.cc new file mode 100644 index 0000000000..64ca909bc2 --- /dev/null +++ b/tests/fe/dgp_monomial_1.cc @@ -0,0 +1,83 @@ +//---------------------------- q_2.cc --------------------------- +// q_2.cc,v 1.1 2003/05/05 13:49:41 wolf Exp +// Version: +// +// Copyright (C) 2003, 2004 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 +// fuqher information on this license. +// +//---------------------------- q_2.cc --------------------------- + + +// Just output the embedding matrices of the FE_Q element. Test +// introduced when we started to compute them on the fly, rather than +// precomputing them for a number of elements and storing them in a +// table + +#include "../tests.h" +#include +#include + +#include +#include + +#define PRECISION 5 + + + +template +void +test(const unsigned int degree) +{ + deallog << "FE_DGPMonomial<" << dim << "> (" << degree << ")" + << std::endl; + + FE_DGPMonomial fe_q(degree); + + for (unsigned int c=0; c::children_per_cell; ++c) + { + const FullMatrix & m = fe_q.get_prolongation_matrix(c); + + for (unsigned int i=0; i(degree); + + for (unsigned int degree=1; degree<=4; ++degree) + test<2>(degree); + + for (unsigned int degree=1; degree<=2; ++degree) + test<3>(degree); + + return 0; +} + + + diff --git a/tests/fe/dgp_monomial_2.cc b/tests/fe/dgp_monomial_2.cc new file mode 100644 index 0000000000..5ba0af7021 --- /dev/null +++ b/tests/fe/dgp_monomial_2.cc @@ -0,0 +1,83 @@ +//---------------------------- q_4.cc --------------------------- +// q_4.cc,v 1.1 2003/05/08 14:54:41 wolf Exp +// Version: +// +// Copyright (C) 2003 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 +// fuqher information on this license. +// +//---------------------------- q_4.cc --------------------------- + + +// previously, the FETools::get_interpolation_matrix function would +// compute its result itself by interpolation. now, the different +// finite elements do that themselves, if they can. make sure the +// result doesn't change + +#include "../tests.h" +#include +#include +#include + +#include +#include + +#define PRECISION 5 + + + +template +void +test(const unsigned int degree1, + const unsigned int degree2) +{ + deallog << "FE_DGPMonomial" << dim << "> (" << degree1 << ")" + << " to FE_DGPMonomial<" << dim << "> (" << degree2 << ")" + << std::endl; + + FE_DGPMonomial fe1(degree1); + FE_DGPMonomial fe2(degree2); + + FullMatrix m (fe2.dofs_per_cell, + fe1.dofs_per_cell); + FETools::get_interpolation_matrix (fe1, fe2, m); + + for (unsigned int i=0; i(degree1, degree2); + for (unsigned int degree1=1; degree1<=3; ++degree1) + for (unsigned int degree2=1; degree2<=3; ++degree2) + test<2>(degree1, degree2); + for (unsigned int degree1=1; degree1<=2; ++degree1) + for (unsigned int degree2=1; degree2<=2; ++degree2) + test<3>(degree1, degree2); + + return 0; +} + + + -- 2.39.5