From: wolf Date: Tue, 21 Jun 2005 21:35:24 +0000 (+0000) Subject: Tes the opposite case of _01. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=297fc78c9705095346b129377f159a18a4663d5a;p=dealii-svn.git Tes the opposite case of _01. git-svn-id: https://svn.dealii.org/trunk@10917 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/fe_tools_cpfqpm_03.cc b/tests/bits/fe_tools_cpfqpm_03.cc new file mode 100644 index 0000000000..4be6c19c24 --- /dev/null +++ b/tests/bits/fe_tools_cpfqpm_03.cc @@ -0,0 +1,67 @@ +//---------------------------- fe_tools_cpfqpm_03.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. +// +//---------------------------- fe_tools_cpfqpm_03.cc --------------------------- + +#include "../tests.h" +#include "fe_tools_common.cc" +#include + +// check +// FETools::compute_projection_from_quadrature_points_matrix +// we put this into the fe_tools_common framework for simplicity, but +// in fact we ignore the second FE it passes to the check_this() function +// and we can only test as well for scalar elements, since this is all +// the function presently supports. +// +// this test simply computes the matrix and outputs some of its +// characteristics. in contrast to the _01 test, we choose a FE that has less +// DoFs than there are quadrature points -- not an uncommon case, and one that +// needs to work + + +std::string output_file_name = "fe_tools_cpfqpm_03.output"; + + +template +void +check_this (const FiniteElement &fe, + const FiniteElement &/*fe2*/) +{ + // only check if both elements have + // support points. otherwise, + // interpolation doesn't really + // work + if (fe.n_components() != 1) + return; + + // ignore this check if this fe has already + // been treated + static std::set already_checked; + if (already_checked.find(fe.get_name()) != already_checked.end()) + return; + already_checked.insert (fe.get_name()); + + + // test with different quadrature formulas + QGauss q_lhs(fe.degree+1); + QGauss q_rhs(fe.degree+3); + + FullMatrix X (fe.dofs_per_cell, + q_rhs.n_quadrature_points); + + FETools::compute_projection_from_quadrature_points_matrix (fe, + q_lhs, q_rhs, + X); + + output_matrix (X); +} +