1
// Copyright (C) 2003-2006 Anders Logg.
2
// Licensed under the GNU LGPL Version 2.1.
4
// First added: 2005-05-02
5
// Last changed: 2006-07-07
15
/// Contains all numeric constants, such as nodal points and nodal weights,
16
/// needed for the cG(q) method. The order q must be at least 1. Note that
17
/// q refers to the polynomial order and not the order of convergence for
18
/// the method, which is 2q.
20
class cGqMethod : public Method
24
cGqMethod(unsigned int q);
26
/// Evaluate solution at given point
27
real ueval(real x0, real values[], real tau) const;
29
/// Evaluate solution at given point
30
real ueval(real x0, uBlasVector& values, uint offset, real tau) const;
32
/// Evaluate solution at given node (inline optimized)
33
inline real ueval(real x0, real values[], uint i) const
34
{ return ( i == 0 ? x0 : values[i - 1] ); }
36
/// Compute residual at right end-point
37
real residual(real x0, real values[], real f, real k) const;
39
/// Compute residual at right end-point
40
real residual(real x0, uBlasVector& values, uint offset, real f, real k) const;
42
/// Compute new time step based on the given residual
43
real timestep(real r, real tol, real k0, real kmax) const;
45
/// Compute error estimate (modulo stability factor)
46
real error(real k, real r) const;
48
/// Display method data
53
void computeQuadrature();
55
void computeWeights();