From: Guido Kanschat Date: Mon, 8 Jan 2001 20:59:52 +0000 (+0000) Subject: test for QProjector and several dim X-Git-Tag: v8.0.0~19845 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13130da88d8ca87d084e84ef2036b2d896ce447d;p=dealii.git test for QProjector and several dim git-svn-id: https://svn.dealii.org/trunk@3616 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/quadrature_test.cc b/tests/base/quadrature_test.cc index 71b347cf0c..402d048b8c 100644 --- a/tests/base/quadrature_test.cc +++ b/tests/base/quadrature_test.cc @@ -19,58 +19,170 @@ #include #include -int main(int,char) +template +void +fill_vector (vector *>& quadratures) +{ + quadratures.push_back (new QGauss2()); + quadratures.push_back (new QGauss3()); + quadratures.push_back (new QGauss4()); + quadratures.push_back (new QGauss5()); + quadratures.push_back (new QGauss6()); + quadratures.push_back (new QGauss7()); + quadratures.push_back (new QMidpoint()); + quadratures.push_back (new QTrapez()); + quadratures.push_back (new QSimpson()); + quadratures.push_back (new QMilne()); + quadratures.push_back (new QWeddle()); +} + +template +void +check_cells (vector*>& quadratures) { - ofstream logfile("quadrature_test.output"); - deallog.attach(logfile); - deallog.depth_console(0); - vector *> quadratures; - quadratures.push_back (new QGauss2<2>()); - quadratures.push_back (new QGauss3<2>()); - quadratures.push_back (new QGauss4<2>()); - quadratures.push_back (new QGauss5<2>()); - quadratures.push_back (new QGauss6<2>()); - quadratures.push_back (new QGauss7<2>()); - quadratures.push_back (new QMidpoint<2>()); - quadratures.push_back (new QTrapez<2>()); - quadratures.push_back (new QSimpson<2>()); - quadratures.push_back (new QMilne<2>()); - quadratures.push_back (new QWeddle<2>()); - for (unsigned int n=0; n *quadrature=quadratures[n]; - const vector > &points=quadrature->get_points(); - const vector &weights=quadrature->get_weights(); + Quadrature& quadrature = *quadratures[n]; + const vector > &points=quadrature.get_points(); + const vector &weights=quadrature.get_weights(); deallog << "Quadrature no." << n - << " (" << typeid(*quadrature).name() << ")"; - + << " (" << typeid(*quadratures[n]).name() << ")"; + unsigned int i=0; double quadrature_int=0; double exact_int=0; double err = 0; + do { ++i; quadrature_int=0; - // Check the polynomial x^i*y^i - for (unsigned int x=0; xn_quadrature_points; ++x) - quadrature_int+=pow(points[x](0), i)*pow(points[x](1), i)*weights[x]; - + for (unsigned int x=0; x +void +check_faces (vector*>& quadratures, bool sub) +{ + if (sub) + deallog.push("subfaces"); + else + deallog.push("faces"); + + for (unsigned int n=0; n quadrature(*quadratures[n], sub); + const vector > &points=quadrature.get_points(); + const vector &weights=quadrature.get_weights(); + + deallog << "Quadrature no." << n + << " (" << typeid(*quadratures[n]).name() << ")"; + + unsigned int i=0; + double quadrature_int=0; + double exact_int=0; + double err = 0; + + do + { + ++i; + + quadrature_int=0; + // Check the polynomial x^i*y^i + + for (unsigned int x=0; x *> q1; + vector *> q2; + vector *> q3; + fill_vector (q1); + fill_vector (q2); + fill_vector (q3); + + deallog.push("1d"); + check_cells(q1); + deallog.pop(); + + deallog.push("2d"); + check_cells(q2); + check_faces(q1,false); + check_faces(q1,true); + deallog.pop(); + + deallog.push("3d"); + check_cells(q3); + check_faces(q2,false); + check_faces(q2,true); + deallog.pop(); } diff --git a/tests/base/quadrature_test.checked b/tests/base/quadrature_test.checked index 3e93755ef9..06a51219bd 100644 --- a/tests/base/quadrature_test.checked +++ b/tests/base/quadrature_test.checked @@ -1,12 +1,78 @@ -DEAL::Quadrature no.0 (t7QGauss21i2) is exact for polynomials of degree 3 -DEAL::Quadrature no.1 (t7QGauss31i2) is exact for polynomials of degree 5 -DEAL::Quadrature no.2 (t7QGauss41i2) is exact for polynomials of degree 7 -DEAL::Quadrature no.3 (t7QGauss51i2) is exact for polynomials of degree 9 -DEAL::Quadrature no.4 (t7QGauss61i2) is exact for polynomials of degree 11 -DEAL::Quadrature no.5 (t7QGauss71i2) is exact for polynomials of degree 13 -DEAL::Quadrature no.6 (t9QMidpoint1i2) is exact for polynomials of degree 1 -DEAL::Quadrature no.7 (t7QTrapez1i2) is exact for polynomials of degree 1 -DEAL::Quadrature no.8 (t8QSimpson1i2) is exact for polynomials of degree 3 -DEAL::Quadrature no.9 (t6QMilne1i2) is exact for polynomials of degree 5 -DEAL::Quadrature no.10 (t7QWeddle1i2) is exact for polynomials of degree 7 +DEAL:1d::Quadrature no.0 (t7QGauss21i1) is exact for polynomials of degree 3 +DEAL:1d::Quadrature no.1 (t7QGauss31i1) is exact for polynomials of degree 5 +DEAL:1d::Quadrature no.2 (t7QGauss41i1) is exact for polynomials of degree 7 +DEAL:1d::Quadrature no.3 (t7QGauss51i1) is exact for polynomials of degree 9 +DEAL:1d::Quadrature no.4 (t7QGauss61i1) is exact for polynomials of degree 11 +DEAL:1d::Quadrature no.5 (t7QGauss71i1) is exact for polynomials of degree 13 +DEAL:1d::Quadrature no.6 (t9QMidpoint1i1) is exact for polynomials of degree 1 +DEAL:1d::Quadrature no.7 (t7QTrapez1i1) is exact for polynomials of degree 1 +DEAL:1d::Quadrature no.8 (t8QSimpson1i1) is exact for polynomials of degree 3 +DEAL:1d::Quadrature no.9 (t6QMilne1i1) is exact for polynomials of degree 5 +DEAL:1d::Quadrature no.10 (t7QWeddle1i1) is exact for polynomials of degree 7 +DEAL:2d::Quadrature no.0 (t7QGauss21i2) is exact for polynomials of degree 3 +DEAL:2d::Quadrature no.1 (t7QGauss31i2) is exact for polynomials of degree 5 +DEAL:2d::Quadrature no.2 (t7QGauss41i2) is exact for polynomials of degree 7 +DEAL:2d::Quadrature no.3 (t7QGauss51i2) is exact for polynomials of degree 9 +DEAL:2d::Quadrature no.4 (t7QGauss61i2) is exact for polynomials of degree 11 +DEAL:2d::Quadrature no.5 (t7QGauss71i2) is exact for polynomials of degree 13 +DEAL:2d::Quadrature no.6 (t9QMidpoint1i2) is exact for polynomials of degree 1 +DEAL:2d::Quadrature no.7 (t7QTrapez1i2) is exact for polynomials of degree 1 +DEAL:2d::Quadrature no.8 (t8QSimpson1i2) is exact for polynomials of degree 3 +DEAL:2d::Quadrature no.9 (t6QMilne1i2) is exact for polynomials of degree 5 +DEAL:2d::Quadrature no.10 (t7QWeddle1i2) is exact for polynomials of degree 7 +DEAL:2d:faces::Quadrature no.0 (t7QGauss21i1) is exact for polynomials of degree 3 +DEAL:2d:faces::Quadrature no.1 (t7QGauss31i1) is exact for polynomials of degree 5 +DEAL:2d:faces::Quadrature no.2 (t7QGauss41i1) is exact for polynomials of degree 7 +DEAL:2d:faces::Quadrature no.3 (t7QGauss51i1) is exact for polynomials of degree 9 +DEAL:2d:faces::Quadrature no.4 (t7QGauss61i1) is exact for polynomials of degree 11 +DEAL:2d:faces::Quadrature no.5 (t7QGauss71i1) is exact for polynomials of degree 13 +DEAL:2d:faces::Quadrature no.6 (t9QMidpoint1i1) is exact for polynomials of degree 1 +DEAL:2d:faces::Quadrature no.7 (t7QTrapez1i1) is exact for polynomials of degree 1 +DEAL:2d:faces::Quadrature no.8 (t8QSimpson1i1) is exact for polynomials of degree 3 +DEAL:2d:faces::Quadrature no.9 (t6QMilne1i1) is exact for polynomials of degree 5 +DEAL:2d:faces::Quadrature no.10 (t7QWeddle1i1) is exact for polynomials of degree 7 +DEAL:2d:subfaces::Quadrature no.0 (t7QGauss21i1) is exact for polynomials of degree 3 +DEAL:2d:subfaces::Quadrature no.1 (t7QGauss31i1) is exact for polynomials of degree 5 +DEAL:2d:subfaces::Quadrature no.2 (t7QGauss41i1) is exact for polynomials of degree 7 +DEAL:2d:subfaces::Quadrature no.3 (t7QGauss51i1) is exact for polynomials of degree 9 +DEAL:2d:subfaces::Quadrature no.4 (t7QGauss61i1) is exact for polynomials of degree 11 +DEAL:2d:subfaces::Quadrature no.5 (t7QGauss71i1) is exact for polynomials of degree 13 +DEAL:2d:subfaces::Quadrature no.6 (t9QMidpoint1i1) is exact for polynomials of degree 1 +DEAL:2d:subfaces::Quadrature no.7 (t7QTrapez1i1) is exact for polynomials of degree 1 +DEAL:2d:subfaces::Quadrature no.8 (t8QSimpson1i1) is exact for polynomials of degree 3 +DEAL:2d:subfaces::Quadrature no.9 (t6QMilne1i1) is exact for polynomials of degree 5 +DEAL:2d:subfaces::Quadrature no.10 (t7QWeddle1i1) is exact for polynomials of degree 7 +DEAL:3d::Quadrature no.0 (t7QGauss21i3) is exact for polynomials of degree 3 +DEAL:3d::Quadrature no.1 (t7QGauss31i3) is exact for polynomials of degree 5 +DEAL:3d::Quadrature no.2 (t7QGauss41i3) is exact for polynomials of degree 7 +DEAL:3d::Quadrature no.3 (t7QGauss51i3) is exact for polynomials of degree 9 +DEAL:3d::Quadrature no.4 (t7QGauss61i3) is exact for polynomials of degree 11 +DEAL:3d::Quadrature no.5 (t7QGauss71i3) is exact for polynomials of degree 13 +DEAL:3d::Quadrature no.6 (t9QMidpoint1i3) is exact for polynomials of degree 1 +DEAL:3d::Quadrature no.7 (t7QTrapez1i3) is exact for polynomials of degree 1 +DEAL:3d::Quadrature no.8 (t8QSimpson1i3) is exact for polynomials of degree 3 +DEAL:3d::Quadrature no.9 (t6QMilne1i3) is exact for polynomials of degree 5 +DEAL:3d::Quadrature no.10 (t7QWeddle1i3) is exact for polynomials of degree 7 +DEAL:3d:faces::Quadrature no.0 (t7QGauss21i2) is exact for polynomials of degree 3 +DEAL:3d:faces::Quadrature no.1 (t7QGauss31i2) is exact for polynomials of degree 5 +DEAL:3d:faces::Quadrature no.2 (t7QGauss41i2) is exact for polynomials of degree 7 +DEAL:3d:faces::Quadrature no.3 (t7QGauss51i2) is exact for polynomials of degree 9 +DEAL:3d:faces::Quadrature no.4 (t7QGauss61i2) is exact for polynomials of degree 11 +DEAL:3d:faces::Quadrature no.5 (t7QGauss71i2) is exact for polynomials of degree 13 +DEAL:3d:faces::Quadrature no.6 (t9QMidpoint1i2) is exact for polynomials of degree 1 +DEAL:3d:faces::Quadrature no.7 (t7QTrapez1i2) is exact for polynomials of degree 1 +DEAL:3d:faces::Quadrature no.8 (t8QSimpson1i2) is exact for polynomials of degree 3 +DEAL:3d:faces::Quadrature no.9 (t6QMilne1i2) is exact for polynomials of degree 5 +DEAL:3d:faces::Quadrature no.10 (t7QWeddle1i2) is exact for polynomials of degree 7 +DEAL:3d:subfaces::Quadrature no.0 (t7QGauss21i2) is exact for polynomials of degree 3 +DEAL:3d:subfaces::Quadrature no.1 (t7QGauss31i2) is exact for polynomials of degree 5 +DEAL:3d:subfaces::Quadrature no.2 (t7QGauss41i2) is exact for polynomials of degree 7 +DEAL:3d:subfaces::Quadrature no.3 (t7QGauss51i2) is exact for polynomials of degree 9 +DEAL:3d:subfaces::Quadrature no.4 (t7QGauss61i2) is exact for polynomials of degree 11 +DEAL:3d:subfaces::Quadrature no.5 (t7QGauss71i2) is exact for polynomials of degree 13 +DEAL:3d:subfaces::Quadrature no.6 (t9QMidpoint1i2) is exact for polynomials of degree 1 +DEAL:3d:subfaces::Quadrature no.7 (t7QTrapez1i2) is exact for polynomials of degree 1 +DEAL:3d:subfaces::Quadrature no.8 (t8QSimpson1i2) is exact for polynomials of degree 3 +DEAL:3d:subfaces::Quadrature no.9 (t6QMilne1i2) is exact for polynomials of degree 5 +DEAL:3d:subfaces::Quadrature no.10 (t7QWeddle1i2) is exact for polynomials of degree 7