archimedes.approximation.BasisMatrix¶
- class archimedes.approximation.BasisMatrix(matrix: ndarray, weights: ndarray, nodes: ndarray)¶
A
Basisevaluated at a set of quadrature nodes.Also called a “design matrix” or “generalized Vandermonde matrix”.
The basis matrix is bundled with the matching quadrature weights to provide proper weighted inner product semantics for matrix multiplication. In particular,
Phi.Tgives the adjoint of \(\Phi\) under the weighted inner product: \(\langle \Phi c, r\rangle_w = \langle c, \Phi^\top r\rangle\). That is,Phi.T @ ris not plain matrix multiplication but includes the weights:Phi.T @ r == Phi.matrix.T @ np.diag(Phi.weights) @ r.This definition of the transpose operation
.Tas an adjoint means that the Gram (mass) matrix is implemented asPhi.T @ Phi, and a Galerkin projection of a functionfis implemented asPhi.T @ f(x), wherex = Phi.nodes.- Parameters:
matrix (ndarray) – The design matrix \(\Phi\), shape
(npts, n_basis)– a generalized Vandermonde matrix, \(\Phi_{ni} = \phi_i(x_n)\) for an arbitrary basis \(\{\phi_i\}\).weights (ndarray) – Quadrature weights for the associated inner product, shape
(npts,).nodes (ndarray) – Quadrature nodes at which the basis was evaluated, shape
(npts,).
See also
FunctionSpace.basis_matrixBuilds a
BasisMatrixfor a given basis and quadrature rule.
Methods
replace(**updates)Returns a new object replacing the specified fields with new values.
Attributes
The adjoint \(\Phi^\top\); see the class docstring.
shapematrixweightsnodes- replace(**updates) T¶
Returns a new object replacing the specified fields with new values.
- property T: _BasisMatrixAdjoint¶
The adjoint \(\Phi^\top\); see the class docstring.