From: Wolfgang Bangerth Date: Thu, 20 Oct 2005 05:04:09 +0000 (+0000) Subject: New tests X-Git-Tag: v8.0.0~12972 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94bd2c8ef65b3305b489b4d7a62305782b877543;p=dealii.git New tests git-svn-id: https://svn.dealii.org/trunk@11631 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/rt_8.cc b/tests/fe/rt_8.cc new file mode 100644 index 0000000000..b55047c614 --- /dev/null +++ b/tests/fe/rt_8.cc @@ -0,0 +1,108 @@ +//---------------------------- rt_8.cc --------------------------- +// rt_8.cc,v 1.3 2003/06/09 16:00:38 wolf Exp +// Version: +// +// Copyright (C) 2003, 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. +// +//---------------------------- rt_8.cc --------------------------- + +// build a mass matrix for the RT element and try to invert it. we had trouble +// with this at one time + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PRECISION 2 + + +std::ofstream logfile ("rt_8.output"); + +template +void +test (const unsigned int degree) +{ + FE_RaviartThomas fe_rt(degree); + Triangulation tr; + GridGenerator::hyper_cube(tr, 0., 1.); + + DoFHandler dof(tr); + typename DoFHandler::cell_iterator c = dof.begin(); + dof.distribute_dofs(fe_rt); + + QTrapez<1> q_trapez; + const unsigned int div=4; + QIterated q(q_trapez, div); + FEValues fe(fe_rt, q, update_values|update_JxW_values); + fe.reinit(c); + + const unsigned int dofs_per_cell = fe_rt.dofs_per_cell; + FullMatrix mass_matrix (dofs_per_cell, dofs_per_cell); + + Assert (fe.get_fe().n_components() == dim, ExcInternalError()); + + + for (unsigned int q_point=0; q_point vector_memory; + SolverCG<> cg (solver_control, vector_memory); + + Vector tmp1(dofs_per_cell), tmp2(dofs_per_cell); + for (unsigned int i=0; i(i); + + return 0; +} + + + diff --git a/tests/fe/rt_9.cc b/tests/fe/rt_9.cc new file mode 100644 index 0000000000..01c896cbdd --- /dev/null +++ b/tests/fe/rt_9.cc @@ -0,0 +1,104 @@ +//---------------------------- rt_9.cc --------------------------- +// rt_9.cc,v 1.3 2003/06/09 16:00:38 wolf Exp +// Version: +// +// Copyright (C) 2003, 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. +// +//---------------------------- rt_9.cc --------------------------- + +// build a mass matrix for the RT element and try to invert it. like the rt_8 +// test, except that we use a library function to build the mass matrix + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PRECISION 2 + + +std::ofstream logfile ("rt_9.output"); + +template +void +test (const unsigned int degree) +{ + FE_RaviartThomas fe_rt(degree); + Triangulation tr; + GridGenerator::hyper_cube(tr, 0., 1.); + + DoFHandler dof(tr); + typename DoFHandler::cell_iterator c = dof.begin(); + dof.distribute_dofs(fe_rt); + + QTrapez<1> q_trapez; + const unsigned int div=4; + QIterated q(q_trapez, div); + + const unsigned int dofs_per_cell = fe_rt.dofs_per_cell; + SparsityPattern sp (dofs_per_cell, dofs_per_cell, dofs_per_cell); + for (unsigned int i=0; i mass_matrix (sp); + + MatrixTools::create_mass_matrix (dof, q, mass_matrix); + + mass_matrix.print_formatted (logfile, 3, false, 0, " ", 1); + + SolverControl solver_control (dofs_per_cell, + 1e-8); + PrimitiveVectorMemory<> vector_memory; + SolverCG<> cg (solver_control, vector_memory); + + Vector tmp1(dofs_per_cell), tmp2(dofs_per_cell); + for (unsigned int i=0; i(i); + + return 0; +} + + +