deallog.attach(logfile);
deallog.depth_console(0);
- vector<Quadrature<1> *> gauss_quadratures(9);
- gauss_quadratures[2]=new QGauss2<1>();
- gauss_quadratures[3]=new QGauss3<1>();
- gauss_quadratures[4]=new QGauss4<1>();
- gauss_quadratures[5]=new QGauss5<1>();
- gauss_quadratures[6]=new QGauss6<1>();
- gauss_quadratures[7]=new QGauss7<1>();
- gauss_quadratures[8]=new QGauss8<1>();
+ vector<Quadrature<1> *> quadratures(14);
+ quadratures[2]=new QGauss2<1>();
+ quadratures[3]=new QGauss3<1>();
+ quadratures[4]=new QGauss4<1>();
+ quadratures[5]=new QGauss5<1>();
+ quadratures[6]=new QGauss6<1>();
+ quadratures[7]=new QGauss7<1>();
+ quadratures[8]=new QGauss8<1>();
+ quadratures[9] = new QMidpoint<1>();
+ quadratures[10] = new QTrapez<1>();
+ quadratures[11] = new QSimpson<1>();
+ quadratures[12] = new QMilne<1>();
+ quadratures[13] = new QWeddle<1>();
- for (unsigned int n=2; n<9; ++n)
+ for (unsigned int n=2; n<14; ++n)
{
- Quadrature<1> *quadrature=gauss_quadratures[n];
+ Quadrature<1> *quadrature=quadratures[n];
const vector<Point<1> > &points=quadrature->get_points();
const vector<double> &weights=quadrature->get_weights();
- deallog << "Gauss" << n;
+ deallog << "Quadrature no." << n;
unsigned int i=0;
- double quadrature_int=0, exact_int=0;
+ double quadrature_int=0;
+ double exact_int=0;
+ double err = 0;
do
{
++i;
// the exact integral is 1/(i+1)
exact_int=1./(i+1);
+ err = fabs(quadrature_int-exact_int);
}
- while (fabs(quadrature_int-exact_int)<1e-15);
+ while (err<1e-15);
+ // Uncomment here for testing
+// deallog << " (Error " << err << ")";
deallog << " is exact for polynomials of degree " << i-1 << endl;
}
}
-DEAL::Gauss2 is exact for polynomials of degree 3
-DEAL::Gauss3 is exact for polynomials of degree 5
-DEAL::Gauss4 is exact for polynomials of degree 7
-DEAL::Gauss5 is exact for polynomials of degree 9
-DEAL::Gauss6 is exact for polynomials of degree 11
-DEAL::Gauss7 is exact for polynomials of degree 13
-DEAL::Gauss8 is exact for polynomials of degree 0
+DEAL::Quadrature no.2 is exact for polynomials of degree 3
+DEAL::Quadrature no.3 is exact for polynomials of degree 5
+DEAL::Quadrature no.4 is exact for polynomials of degree 7
+DEAL::Quadrature no.5 is exact for polynomials of degree 9
+DEAL::Quadrature no.6 is exact for polynomials of degree 11
+DEAL::Quadrature no.7 is exact for polynomials of degree 13
+DEAL::Quadrature no.8 is exact for polynomials of degree 0
+DEAL::Quadrature no.9 is exact for polynomials of degree 1
+DEAL::Quadrature no.10 is exact for polynomials of degree 1
+DEAL::Quadrature no.11 is exact for polynomials of degree 3
+DEAL::Quadrature no.12 is exact for polynomials of degree 5
+DEAL::Quadrature no.13 is exact for polynomials of degree 7