Class E_quadrature_rule


Code: embedded/E_quadrature.mpl

An instance of this class represents a quadrature rule for approximate integration of functions on $EX^*$. Essentially, such a rule consists of a list of points $p_i$ in the fundamental domain $F_{16}$, together with weights $w_i\geq 0$. The integral over $F_{16}$ of a function $f$ is approximately $\sum_i w_i f(p_i)$. Thus, the integral over $EX^*$ is $\sum_i\sum_{g\in G}w_if(g.p_i)$. This class also has fields and methods designed to allow us to measure and improve the accuracy of the quadrature rule. Specifically, suppose we have calculated the integrals of some monomials $z_1^iz_2^j$ by some other method. We can then list these monomials in the test_monomials field, and their integrals in the test_integrals field. Various methods will then try to ensure that our quadrature rule gives the correct answer on those monomials.

Field: num_points::integer = 0

Number of evaluation points

Field: points::table

The list of evaluation points. This is represented as a table indexed by natural numbers (starting at 0), and each point is represented as an object of the class E_point defined in the file E_domain.mpl

Field: weights::table

The list of weights, represented as a table indexed by natural numbers.

Field: num_test_monomials::integer = 0
Field: test_monomials::table

The list of test monomials, represented as a table indexed by natural numbers.

Field: test_integrals::table

The list of integrals over $F_{16}$ of test monomials, represented as a table indexed by natural numbers. This can be used if we have calculated the relevant integrals by some other means. If not, this field should be null.

Field: test_monomial_values::table

This is a table T such that T[i,j] is the value of the $i$'th test monomial $m_i$ at the $j$'th evaluation point $p_j$. It should be set using the set_monomial_values method.

Field: test_monomial_diff_values::table

This is a table T such that T[i,j,0] and T[i,j,1] measure the derivatives of $m_i$ at the point $p_j$. In more detail, $p_j$ is stored as an instance of the class E_point, so it comes packaged with two tangent vectors $u_j$ and $v_j$; the entries T[i,j,0] and T[i,j,1] are the derivatives in these directions. If $p_j$ is in the interior of $F_{16}$ then $u_j$ and $v_j$ will form an oriented orthonormal frame. If $p_j$ is on an edge of $F_{16}$ then $u_j$ will be a unit vector pointing along the edge, and $v_j$ will be zero. If $p_j$ is at a corner then both $u_j$ and $v_j$ will be zero.

Field: errors::table
Field: total_square_error = 0
Field: eval_det::RR1

Assuming that the number of test monomials is at least as large as the number $n$ of evaluation points, the set_eval_det method will set the eval_det field to be the determinant of the $n\times n$ matrix of values of the first $n$ test monomials at the evaluation points. Some theory developed in a slightly different context suggests that it is desirable to adjust the evaluation points to make this determinant as large as possible.

Field: eval_det_diff::table

Assuming that the number of test monomials is at least as large as the number $n$ of evaluation points, the set_eval_det_diff method will set the eval_det_diff field to be a table T containing information about how eval_det changes as the evaluation points are moved. In more detail, T[j,0] is the derivative of eval_det if $p_j$ is moved in the direction $u_j$, and T[j,1] is the derivative of eval_det if $p_j$ is moved in the direction $v_j$.

Constructor: `new/E_quadrature_rule`()

Method: clone()::E_quadrature_rule

Returns a cloned copy of this quadrature rule


Method: degrees_of_freedom()::integer

Some of the evaluation points lie in the interior of $F_{16}$ and so have two degrees of freedom to move. Some points may lie on an edge or at a corner, so that they have one or zero degrees of freedom. This methd returns the total number of degrees of freedom for all evaluation points.


Method: choose_random_points(n)::void

This method randomly chooses $n$ evaluation points in the interior of $F_{16}$, and gives them all the same weight.


Method: adjust(t,offset_)::void
Method: adjust_randomly(scale_)::void
Method: add_new_point(x0::[scalar, scalar, scalar, scalar])

Add a new evaluation point with the specified coordinates


Method: set_max_deg(max_deg,grid::E_grid)::void

Set the list of test monomials to be the list of all monomials of total degree less than or equal to the argument max_deg. Also, calculate the corresponding test integrals using the E_grid object supplied as the grid argument. (This may be slow.)


Method: int_z(f)::scalar

Integrate f, which should be an expression involving $z_1$ and $z_2$.


Method: set_monomial_values()::void

Calculate the values and derivatives of all the test monomials at the evaluation points.


Method: solve_weights()::void

Set the weights field to minimize the mean square integration error for all the test monomials, subject to the constraint that all weights should be nonnegative.


Method: weight_list()

Convert the weights table to a list.


Method: sorted_weight_list()

Convert the weights table to a list, and sort it.


Method: set_eval_det()::scalar

Set the eval_det field.


Method: set_eval_det_diff()

Set the eval_det_diff field. This method is quite slow.


Method: increase_eval_det_once(step)

Adjust the evaluation points to increase eval_det. This assumes that eval_det has already been calculated, but not eval_det_diff. It calculates eval_det_diff for the unadjusted points, but does not recalculate it after performing the adjustment.


Method: increase_eval_det(step_,num_steps_)
Method: set_errors()

Calculate all the errors obtained when integrating all the test monomials using this quadrature rule. This assumes that correct values for all the integrals have already been stored in the test_integrals field.


Method: reduce_errors_once(max_step_)

This adjusts the evaluation points and weights to attempt to reduce the integration errors. We have not made much use of this; instead, we have used increase_eval_det repeatedly, followed by solve_weights.


Method: reduce_errors(max_step_,num_steps_)
Method: curvature_error()

If the integration rule is accurate, then the result of this method should be zero, by the Gauss-Bonet Theorem.


Method: log_curvature_error()
Method: stokes_error(ff)

Here ff should be a list $(f_1,f_2)$ of two expressions in $z_1$ and $z_2$. The method returns the approximated integral of $d(f_1\alpha_1+f_2\alpha_2)$, where the forms $\alpha_i$ are defined in embedded/roothalf/forms.mpl. If the integration rule is accurate, then the result should be zero, by Stokes's Theorem. The formulae used are only valid when $a=1/\sqrt{2}$, so the method gives an error in other cases.


Method: max_stokes_error()
Method: log_max_stokes_error()
Method: plot_z()

This generates a plot showing the location of the evaluation points in the $z$-plane.


Method: error_plot()

Generate a plot showing $\log_{10}$ of the relative errors $|Q(m)-\int m|/\|m\|_2$, as $m$ runs through the test monomials.


Method: describe()