core.Nodes module¶
- exception NodesError[source]¶
Bases:
Exception
Exception class to handle error in NodesGenerator class
- class NodesGenerator(node_type='LEGENDRE', quad_type='LOBATTO')[source]¶
Bases:
object
Class that can be used to generate generic distribution of nodes derived from Gauss quadrature rule. Its implementation is fully inspired from a book of W. Gautschi.
- node_type¶
The type of node distribution
- Type:
str
- quad_type¶
The quadrature type
- Type:
str
- evalOrthogPoly(t, alpha, beta)[source]¶
Evaluates the two higher order orthogonal polynomials corresponding to the given (alpha,beta) coefficients.
- Parameters:
t (float or np.1darray) – The point where to evaluate the orthogonal polynomials.
alpha (np.1darray) – The alpha coefficients of the three-term recurrence.
beta (np.1darray) – The beta coefficients of the three-term recurrence.
- Returns:
pi[0] (float or np.1darray) – The second higher order orthogonal polynomial evaluation.
pi[1] (float or np.1darray) – The higher oder orthogonal polynomial evaluation.
- getNodes(num_nodes)[source]¶
Computes a given number of quadrature nodes.
- Parameters:
num_nodes (int) – Number of nodes to compute.
- Returns:
nodes – Nodes located in [-1, 1], in increasing order.
- Return type:
np.1darray
- getOrthogPolyCoefficients(num_coeff)[source]¶
Produces a given number of analytic three-term recurrence coefficients.
- Parameters:
num_coeff (int) – Number of coefficients to compute.
- Returns:
alpha (np.1darray) – The alpha coefficients of the three-term recurrence.
beta (np.1darray) – The beta coefficients of the three-term recurrence.
- getTridiagCoefficients(num_nodes)[source]¶
Computes recurrence coefficients for the tridiagonal Jacobian matrix, taking into account the quadrature type.
- Parameters:
num_nodes (int) – Number of nodes that should be computed from those coefficients.
- Returns:
alpha (np.1darray) – The modified alpha coefficients of the three-term recurrence.
beta (np.1darray) – The modified beta coefficients of the three-term recurrence.