2
/// This file is part of Rheolef.
4
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
6
/// Rheolef is free software; you can redistribute it and/or modify
7
/// it under the terms of the GNU General Public License as published by
8
/// the Free Software Foundation; either version 2 of the License, or
9
/// (at your option) any later version.
11
/// Rheolef is distributed in the hope that it will be useful,
12
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
/// GNU General Public License for more details.
16
/// You should have received a copy of the GNU General Public License
17
/// along with Rheolef; if not, write to the Free Software
18
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
/// =========================================================================
21
#include "rheolef/quadrature.h"
22
#include "rheolef/gauss_jacobi.h"
23
using namespace rheolef;
29
* refs: G. Dhatt and G. Touzot,
30
* Une presentation de la methode des elements finis,
31
* Maloine editeur, Paris
38
quadrature_on_geo::init_edge (quadrature_option_type opt)
40
// -------------------------------------------------------------------------
41
// special case : superconvergent patch recovery nodes & weights
42
// -------------------------------------------------------------------------
43
quadrature_option_type::family_type f = opt.get_family();
44
if (f == quadrature_option_type::superconvergent) {
45
f = quadrature_option_type::gauss;
47
// -------------------------------------------------------------------------
48
// special case : Gauss-Lobatto points
49
// e.g. when using special option in riesz_representer
50
// -------------------------------------------------------------------------
51
if (f == quadrature_option_type::gauss_lobatto) {
52
switch (opt.get_order()) {
61
// http://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Lobatto_rules
62
wx(x(Float(0)), Float(1)/Float(6));
63
wx(x(Float(0.5)), Float(4)/Float(6));
64
wx(x(Float(1)), Float(1)/Float(6));
68
// http://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Lobatto_rules
69
wx(x(Float(0)), Float(1)/Float(12));
70
wx(x(0.5-0.5/sqrt(Float(5))), Float(5)/Float(12));
71
wx(x(0.5+0.5/sqrt(Float(5))), Float(5)/Float(12));
72
wx(x(Float(1)), Float(1)/Float(12));
76
// http://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Lobatto_rules
77
wx(x(Float(0)), Float( 9)/Float(180));
78
wx(x(0.5-0.5/sqrt(Float(3)/Float(7))), Float(49)/Float(180));
79
wx(x(Float(0.5)), Float(64)/Float(180));
80
wx(x(0.5+0.5/sqrt(Float(3)/Float(7))), Float(49)/Float(180));
81
wx(x(Float(1)), Float( 9)/Float(180));
84
error_macro ("unsupported Gauss-Lobatto("<<opt.get_order()<<")");
88
// -------------------------------------------------------------------------
89
// default & general case : Gauss points
90
// -------------------------------------------------------------------------
91
assert_macro (f == quadrature_option_type::gauss,
92
"unsupported quadrature family \"" << opt.get_family_name() << "\"");
94
// Gauss-Legendre quadrature formulae
95
// where Legendre = Jacobi(alpha=0,beta=0) polynoms
97
size_type n = n_node_gauss(opt.get_order());
98
vector<Float> zeta(n), omega(n);
99
gauss_jacobi (n, 0, 0, zeta.begin(), omega.begin());
100
for (size_type i = 0; i < n; i++)
101
wx (x((1+zeta[i])/2), omega[i]/2);