Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment based reffes: refactoring and extension of Gridap.Polynomials #1072

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
38954cb
remove duplicate
Antoinemarteau Dec 2, 2024
cef8af6
Merge branch 'master' of github.com:gridap/Gridap.jl into moment-base…
Antoinemarteau Dec 9, 2024
92864b3
Merge branch 'moment-based-reffes' of github.com:Antoinemarteau/Grida…
Antoinemarteau Dec 9, 2024
adeeee2
Implemented a generic 1d polynomial evaluation API
Antoinemarteau Dec 10, 2024
aed4682
renamed this _s_filter
Antoinemarteau Dec 11, 2024
cfe722f
generic TensorPolynomialBasis
Antoinemarteau Dec 11, 2024
6aa5a25
WIP BernsteinBases 1D / TensorPolynomialBasis
Antoinemarteau Dec 12, 2024
04e4b20
More consistent namings
Antoinemarteau Dec 12, 2024
fb94e22
revert typo and minor fix
Antoinemarteau Dec 13, 2024
29d5cfd
test and fix BernsteinBases
Antoinemarteau Dec 13, 2024
1e9431b
Passed poly order by Type in low-level evals
Antoinemarteau Dec 13, 2024
d3bfb70
added consistency check for term TensorPolyBase constructor
Antoinemarteau Dec 15, 2024
3bddd5b
Wip Q and P factorization
Antoinemarteau Dec 16, 2024
4b5bde9
Generic return_cache implem for all PolynomialBasis'
Antoinemarteau Dec 18, 2024
c7a4bf1
rename _s_filter and clarify its definition
Antoinemarteau Dec 18, 2024
427b079
clean factorised Q[Curl]Grad code
Antoinemarteau Dec 18, 2024
69c42c1
PCurlGrad factorization
Antoinemarteau Dec 18, 2024
a8e7629
clean Polynomials folder
Antoinemarteau Dec 19, 2024
7e13829
evaluate! factorisations, NedelecPrebasis and ModalC0Basis uniformiza…
Antoinemarteau Dec 19, 2024
e979450
remove the temporary useless cache and associated copies
Antoinemarteau Dec 20, 2024
2a000af
cleaned PolynomialInterfaces
Antoinemarteau Dec 20, 2024
6241cc1
add again LegendreBasesTests (former JacobiBasesTests)
Antoinemarteau Dec 20, 2024
0c0562b
further Polynomials doc and code cleaning
Antoinemarteau Dec 20, 2024
ba4b33c
various Polynomials improvements
Antoinemarteau Jan 3, 2025
f7a6ad0
WIP Polynomials doc, added UML diagrams
Antoinemarteau Jan 3, 2025
1d3a571
revert import mistake and fix MonomialBasis name conflict
Antoinemarteau Jan 3, 2025
6c821e8
marked broken tests broken
Antoinemarteau Jan 3, 2025
2a66eb2
Merge branch 'moment-based-reffes' of github.com:gridap/Gridap.jl int…
Antoinemarteau Jan 3, 2025
494e181
better Polynomials docstrings
Antoinemarteau Jan 3, 2025
a48c09b
minor
Antoinemarteau Jan 3, 2025
15fee11
minor
Antoinemarteau Jan 3, 2025
5c40100
fix UniformPolyBases test coverage
Antoinemarteau Jan 6, 2025
6d8ec25
fix CompWiseTensorPolyBases test coverage and Hessian
Antoinemarteau Jan 6, 2025
d2e94ac
fix PolynomialInterfaces test coverage and isHierarchical
Antoinemarteau Jan 6, 2025
6ecc309
fix ModalC0Bases coverage tests and 1 bug
Antoinemarteau Jan 6, 2025
9555fe9
fix P[Curl]Grad coverage and API for 1D + isHierarchical cov
Antoinemarteau Jan 6, 2025
6b07a81
fix Bernstein test coverage
Antoinemarteau Jan 6, 2025
439ea2e
Chebyshev test coverage and method ambiguities
Antoinemarteau Jan 6, 2025
038cc88
postbone Jacobi
Antoinemarteau Jan 6, 2025
a351aa3
minor coverage fix
Antoinemarteau Jan 6, 2025
1971ea5
optimize and test Bernstein
Antoinemarteau Jan 7, 2025
b8203fc
better public name display in module docstrings
Antoinemarteau Jan 7, 2025
facb8eb
better errors in wrong PolyBasis construction
Antoinemarteau Jan 8, 2025
10bab17
wrote Gridap.Polynomials' docstring
Antoinemarteau Jan 8, 2025
5eaf076
change Int64 to Int where possible, fix dispatch test
Antoinemarteau Jan 8, 2025
f398696
documentation of Gridap.Polynomials
Antoinemarteau Jan 8, 2025
e34f229
cleaning serendipity filter defs and doc
Antoinemarteau Jan 10, 2025
7ab7341
make ModalC0 compatible with all basis parametrised by Polynomial
Antoinemarteau Jan 10, 2025
57af29c
fix test on julia 1.8
Antoinemarteau Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added AMR-related methods `mark` and `estimate` to `Adaptivity` module. Implemented Dorfler marking strategy. Since PR[#1063](https://github.com/gridap/Gridap.jl/pull/1063).

- Documentation and refactoring of Gridap.Polynomials. Since PR[#TODO](https://github.com/gridap/Gridap.jl/pull/#TODO).
- Two new families of polynomial bases in addition to `Monomial`, `Legendre` (former `Jacobi`) and `ModalC0`: `Chebyshev` and `Bernstein`
- `MonomialBasis` and `Q[Curl]GradMonomialBasis` have been generalized to `Legendre`, `Chebyshev` and `Bernstein` using the new `UniformPolyBasis` and `CompWiseTensorPolyBasis` respectively.
- `PCurlGradMonomialBasis` has been generalized to `Legendre` and `Chebyshev` using the new `RaviartThomasPolyBasis`.
- New aliases and high level constructor for `UniformPolyBasis` (former MonomialBasis): `MonomialBasis`, `LegendreBasis`, `ChebyshevBasis` and `BernsteinBasis`.
- New high level constructors for Nedelec and Raviart-Thomas polynomial bases:
- Nedelec on simplex `PGradBasis(PT<:Polynomial, Val(D), order)`
- Nedelec on n-cubes `QGradBasis(PT<:Polynomial, Val(D), order)`
- Raviart on simplex `PCurlGradBasis(PT<:Polynomial, Val(D), order)`
- Raviart on n-cubes `QCurlGradBasis(PT<:Polynomial, Val(D), order)`

### Changed

- Low level optimisations to reduce allocations. `AffineMap` renamed to `AffineField`. New `AffineMap <: Map`, doing the same as `AffineField` without struct allocation. New `ConstantMap <: Map`, doing the same as `ConstantField` without struct allocation. Since PR[#1043](https://github.com/gridap/Gridap.jl/pull/1043).
- `ConstantFESpaces` can now be built on triangulations. Since PR[#1069](https://github.com/gridap/Gridap.jl/pull/1069)

- Existing Jacobi polynomial bases/spaces were renamed to Legendre (which they were).
- `Monomial` is now subtype of the new abstract type`Polynomial <: Field`
- `MonomialBasis` is now an alias for `UniformPolyBasis{...,Monomial}`
- All polynomial bases are now subtypes of the new abstract type `PolynomialBasis <: AbstractVector{<:Polynomial}`
- `get_order(b::(Q/P)[Curl]Grad...)`, now returns the order of the basis, +1 than the order parameter passed to the constructor.
- `NedelecPreBasisOnSimplex` is renamed `NedelecPolyBasisOnSimplex`
- `JacobiPolynomial` is renamed `Legendre` and subtypes `Polynomial`
- `JacobiPolynomialBasis` is renamed `LegendreBasis`
- `ModalC0BasisFunction` is renamed `ModalC0` and subtypes `Polynomial`

### Deprecated

- `num_terms(f::AbstractVector{<:Field})` in favor of `length(f::PolynomialBasis)`
- `MonomialBasis{D}(args...)` in favor of `MonomialBasis(Val(D), args...)`
- `[P/Q][Curl]GradMonomialBasis{D}(args...)` in favor of `[...]GradBasis(Monomial, Val(D), args...)`
- `NedelecPreBasisOnSimplex{D}(args...)` in favor of `NedelecPolyBasisOnSimplex(Val(D), args...)`
- `JacobiPolynomialBasis{D}(args...)` in favor of `LegendreBasis(Val(D), args...)`

## [0.18.8] - 2024-12-2

### Added
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
Kroki = "b3565e16-c1f2-4fe9-b4ab-221c88942068"

[compat]
Documenter = "1.0"
85 changes: 85 additions & 0 deletions docs/generate_diagrams.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using Kroki

macro export_kroki(name, str)
return quote
write("src/assets/"*string($name)*".svg", render($str, "svg"))
end
end

# Plantuml uml diagrams syntax: https://plantuml.com/class-diagram#49b7759afaffc066

@export_kroki :poly_1 plantuml"""
@startuml
skinparam groupInheritance 2
hide empty members

together {
abstract Field
abstract Polynomial {
+isHierarchical
}
}
Field <|-left- Polynomial

together {
struct Monomial
struct Legendre
struct Chebyshev
struct ModalC0
struct Bernstein
}

Polynomial <|-- Monomial
Polynomial <|-- Legendre
Polynomial <|-- Chebyshev
Polynomial <|-- ModalC0
Polynomial <|-- Bernstein

@enduml
"""

@export_kroki :poly_2 plantuml"""
@startuml
skinparam groupInheritance 2
hide empty members

together {
abstract "AbstractArray{<:Polynomial}" as a1
abstract PolynomialBasis {
+get_order
+return_type
}
}
a1 <|-left- PolynomialBasis

together {
struct UniformPolyBasis {
+get_exponents
+get_orders
}
struct CompWiseTensorPolyBasis
struct RaviartThomasPolyBasis
struct NedelecPolyBasisOnSimplex
struct ModalC0Basis {
+get_orders
}
}

PolynomialBasis <|-- UniformPolyBasis
PolynomialBasis <|-- CompWiseTensorPolyBasis
PolynomialBasis <|-- RaviartThomasPolyBasis
PolynomialBasis <|-- NedelecPolyBasisOnSimplex
PolynomialBasis <|-- ModalC0Basis

object "(<:Polynomial)Basis" as m1
object "QGrad[<:Polynomial]Basis\nQCurlGrad[<:Polynomial]Basis" as m2
object "PCurlGrad[<:Polynomial]Basis" as m4
object "PGradMonomialBasis" as m5
UniformPolyBasis <-down- m1
CompWiseTensorPolyBasis <-down- m2
RaviartThomasPolyBasis <-down- m4
NedelecPolyBasisOnSimplex <-down- m5

@enduml
"""

3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ pages = [
makedocs(
sitename = "Gridap.jl",
format = Documenter.HTML(
size_threshold=nothing
size_threshold=nothing,
size_threshold_warn=300 * 2^10 # 300KiB
),
modules = [Gridap],
pages = pages,
Expand Down
Loading
Loading