https://github.com/juliaapproximation/piecewiseorthogonalpolynomials.jl
A Julia package for piecewise spectral methods such as p-FEM
https://github.com/juliaapproximation/piecewiseorthogonalpolynomials.jl
Last synced: 11 months ago
JSON representation
A Julia package for piecewise spectral methods such as p-FEM
- Host: GitHub
- URL: https://github.com/juliaapproximation/piecewiseorthogonalpolynomials.jl
- Owner: JuliaApproximation
- License: mit
- Created: 2022-03-31T13:46:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T10:53:20.000Z (over 1 year ago)
- Last Synced: 2025-06-09T10:34:10.130Z (about 1 year ago)
- Language: Julia
- Size: 109 KB
- Stars: 7
- Watchers: 8
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PiecewiseOrthogonalPolynomials.jl
A Julia package for piecewise orthogonal polynomials which can be used in p-FEM
We can make piecewise integrated-Legendre bases using the quasi-matrix `ContinuousPolynomial{1}`:
```julia
using PiecewiseOrthogonalPolynomials, Plots
𝐗 = range(-1,1; length=4)
C = ContinuousPolynomial{1}(𝐗)
plot(C[:,Block(1)])
```
```julia
plot(C[:,Block.(2:3)])
```
The mass matrix can be constructed via:
```julia
M = C'C
```
We can also construct the stiffness matrix:
```julia
Δ = weaklaplacian(C)
```
We can truncate as follows:
```julia
N = 10
KR = Block.(Base.OneTo(N))
Mₙ = M[KR,KR]
Δₙ = Δ[KR,KR]
```
We can compute the reverse Cholesky in optimal complexity:
```julia
using MatrixFactorizations
L = reversecholesky(Symmetric(-Δₙ + Mₙ)).L
```