Public Member Functions | |
QGaussOneOverR (const unsigned int n, const unsigned int vertex_index, const bool factor_out_singular_weight=false) | |
template<> | |
QGaussOneOverR (const unsigned int n, const unsigned int index, const bool flag) |
Gauss Quadrature Formula with weighting function. This formula can be used to to integrate
on the reference element
, where
is a smooth function without singularities, and
is the distance from the point
to the vertex
, given at construction time by specifying its index. Notice that this distance is evaluated in the reference element.
This quadrature formula is obtained from two QGauss quadrature formulas, upon transforming them into polar coordinate system centered at the singularity, and then again into another reference element. This allows for the singularity to be cancelled by part of the Jacobian of the transformation, which contains . In practice the reference element is transformed into a triangle by collapsing one of the sides adjacent to the singularity. The Jacobian of this transformation contains
, which is removed before scaling the original quadrature, and this process is repeated for the next half element.
Upon construction it is possible to specify wether we want the singularity removed, or not. In other words, this quadrature can be used to integrate , or simply
, with the
factor already included in the quadrature weights.
QGaussOneOverR< dim >::QGaussOneOverR | ( | const unsigned int | n, | |
const unsigned int | vertex_index, | |||
const bool | factor_out_singular_weight = false | |||
) |
The constructor takes three arguments: the order of the Gauss formula, the index of the vertex where the singularity is located, and whether we include the weighting singular function inside the quadrature, or we leave it in the user function to be integrated.
Traditionally, quadrature formulas include their weighting function, and the last argument is set to false by default. There are cases, however, where this is undesirable (for example when you only know that your singularity has the same order of 1/R, but cannot be written exactly in this way).
In other words, you can use this function in either of the following way, obtaining the same result:
QGaussOneOverR singular_quad(order, vertex_id, false); // This will produce the integral of f(x)/R for(unsigned int i=0; i<singular_quad.size(); ++i) integral += f(singular_quad.point(i))*singular_quad.weight(i); // And the same here QGaussOneOverR singular_quad_noR(order, vertex_id, true); // This also will produce the integral of f(x)/R, but 1/R has to // be specified. for(unsigned int i=0; i<singular_quad.size(); ++i) { double R = (singular_quad_noR.point(i)-cell->vertex(vertex_id)).norm(); integral += f(singular_quad_noR.point(i))*singular_quad_noR.weight(i)/R; }
QGaussOneOverR< 2 >::QGaussOneOverR | ( | const unsigned int | n, | |
const unsigned int | index, | |||
const bool | flag | |||
) | [inline] |