/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2001, 2002, 2003 by the deal.II authors */
+/* Copyright (C) 2001, 2002, 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 */
// For the numerical quadrature on
// all cells we employ a quadrature
// rule of sufficiently high
- // degree. We choose QGauss4 that
- // is of order 8, to be sure that
+ // degree. We choose QGauss that
+ // is of order 8 (4 points), to be sure that
// the errors due to numerical
// quadrature are of higher order
// than the order (maximal 6) that
// computations, but could as well
// have used any quadrature formula
// of like order instead.
- const QGauss4<dim> quadrature;
+ const QGauss<dim> quadrature(4);
// Now start by looping over
// polynomial mapping degrees=1..4:
// as we will integrate over
// (boundary) lines rather than
// over cells.
- const QGauss4<dim-1> quadrature;
+ const QGauss<dim-1> quadrature(4);
// We loop over all degrees, create
// the Triangulation, the Boundary,
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2001, 2002, 2003 by the deal.II authors */
+/* Copyright (C) 2001, 2002, 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 */
// formula above computing
// ``gauss_degree''.
//
- // Note also, that we have used a
- // class called ``QGauss''. By now,
- // we have only used ``QGauss4'',
- // or the like, which implement a
- // Gauss quadrature rule of fixed
- // order. The ``QGauss'' class is
- // more general, taking a parameter
- // which indicates of which degree
- // it shall be; for small degrees,
- // the object then parallels
- // objects of type ``QGaussR'' with
- // fixed R, but it also provides
- // quadrature rules of higher
- // degree which are no longer
- // hard-coded in the library.
-
// Since the generation of the body
// force contributions to the right
// hand side vector was so simple,
// formulae for the cell and the
// face terms of the
// discretization.
- const QGauss4<dim> quadrature;
- const QGauss4<dim-1> face_quadrature;
+ const QGauss<dim> quadrature;
+ const QGauss<dim-1> face_quadrature;
// And there are two solution
// vectors, that store the
// different degrees.
fe (1),
dof_handler (triangulation),
- quadrature (),
- face_quadrature (),
+ quadrature (4),
+ face_quadrature (4),
dg ()
{}
{
Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
KellyErrorEstimator<dim>::estimate (this->dof_handler,
- QGauss3<dim-1>(),
+ QGauss<dim-1>(3),
typename FunctionMap<dim>::type(),
this->solution,
estimated_error_per_cell);
GridGenerator::hyper_cube (triangulation, -1, 1);
triangulation.refine_global (2);
const FE_Q<dim> fe(1);
- const QGauss4<dim> quadrature;
+ const QGauss<dim> quadrature(4);
const RightHandSide<dim> rhs_function;
const Solution<dim> boundary_values;
{
Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
KellyErrorEstimator<dim>::estimate (this->dof_handler,
- QGauss3<dim-1>(),
+ QGauss<dim-1>(3),
typename FunctionMap<dim>::type(),
this->solution,
estimated_error_per_cell);
// formula, have abbreviations
// for the number of quadrature
// points and shape functions...
- QGauss4<dim> quadrature;
+ QGauss<dim> quadrature(4);
FEValues<dim> fe_values (dof_handler.get_fe(), quadrature,
update_gradients |
update_q_points |
// is a polynomial of sixth order. Thus,
// the appropriate quadrature formula is
// the one we have chosen here.
- QGauss4<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(4);
FEValues<dim> fe_values (fe, quadrature_formula,
UpdateFlags(update_values |
update_gradients |
// that the integrand is a polynomial of
// degree six, so a 4-point Gauss formula
// is appropriate:
- QGauss4<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(4);
FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula,
UpdateFlags(update_values |
update_gradients |
template <int dim>
void LaplaceProblem<dim>::assemble_system ()
{
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
FEValues<dim> fe_values (fe, quadrature_formula,
UpdateFlags(update_values |
template <int dim>
void LaplaceProblem<dim>::assemble_multigrid ()
{
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
FEValues<dim> fe_values (fe, quadrature_formula,
UpdateFlags(update_values |
// from step-8. Note that we still use the
// deal.II full matrix and vector types for
// the local systems.
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
FEValues<dim> fe_values (fe, quadrature_formula,
UpdateFlags(update_values |
update_gradients |
// (i.e. the one indicating the subdomain):
Vector<float> local_error_per_cell (triangulation.n_active_cells());
KellyErrorEstimator<dim>::estimate (dof_handler,
- QGauss2<dim-1>(),
+ QGauss<dim-1>(2),
typename FunctionMap<dim>::type(),
localized_solution,
local_error_per_cell,
// the matrix entries are quadratic
// (in 1D), this is sufficient. The
// same holds for 2D.
- QGauss2<2> quadrature_formula;
+ QGauss<2> quadrature_formula(2);
// And we initialize the object
// which we have briefly talked
// about above. It needs to be told
template <int dim>
void LaplaceProblem<dim>::assemble_system ()
{
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
// We wanted to have a non-constant
// right hand side, so we use an
// object will be used for this:
const Coefficient<dim> coefficient;
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
FEValues<dim> fe_values (fe, quadrature_formula,
UpdateFlags(update_values |
// we use consist, a Gauss formula
// with three points in each
// direction is sufficient.
- QGauss3<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(3);
// The ``FEValues'' object
// automatically adjusts the
// integrates polynomials up to
// order 5 exactly.)
KellyErrorEstimator<dim>::estimate (dof_handler,
- QGauss3<dim-1>(),
+ QGauss<dim-1>(3),
neumann_boundary,
solution,
estimated_error_per_cell);
// a quadrature rule for the faces:
// it is simply a quadrature rule
// for one dimension less!
- QGauss3<dim> quadrature_formula;
- QGauss3<dim-1> face_quadrature_formula;
+ QGauss<dim> quadrature_formula(3);
+ QGauss<dim-1> face_quadrature_formula(3);
// For simpler use later on, we
// alias the number of quadrature
// points to local variables:
typename FunctionMap<dim>::type neumann_boundary;
KellyErrorEstimator<dim>::estimate (dof_handler,
- QGauss3<dim-1>(),
+ QGauss<dim-1>(3),
neumann_boundary,
solution,
estimated_error_per_cell);
solution,
Solution<dim>(),
difference_per_cell,
- QGauss3<dim>(),
+ QGauss<dim>(3),
VectorTools::L2_norm);
// Finally, we want to get the
// global L2 norm. This can of
solution,
Solution<dim>(),
difference_per_cell,
- QGauss3<dim>(),
+ QGauss<dim>(3),
VectorTools::H1_seminorm);
const double H1_error = difference_per_cell.l2_norm();
// formula does not need
// modification since we still deal
// with bilinear functions.
- QGauss2<dim> quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
// Also, the ``FEValues'' objects
// takes care of everything for us
// (or better: it does not really
typename FunctionMap<dim>::type neumann_boundary;
KellyErrorEstimator<dim>::estimate (dof_handler,
- QGauss2<dim-1>(),
+ QGauss<dim-1>(2),
neumann_boundary,
solution,
estimated_error_per_cell);
// twice before we first
// solve on it. The reason
// is the following: we use
- // the ``Gauss2''
- // quadrature formula for
+ // the ``Gauss''
+ // quadrature formula with
+ // two points in each direction for
// integration of the right
// hand side; that means
// that there are four
// elements, Gauss formulae with
// two points in each space
// direction are sufficient.
- QGauss2<dim> quadrature_formula;
- QGauss2<dim-1> face_quadrature_formula;
+ QGauss<dim> quadrature_formula(2);
+ QGauss<dim-1> face_quadrature_formula(2);
// Finally, we need objects of type
// ``FEValues'' and