Skip to content

Commit

Permalink
Merge pull request #1072 from Antoinemarteau/moment-based-reffes
Browse files Browse the repository at this point in the history
Moment based reffes: refactoring and extension of Gridap.Polynomials
  • Loading branch information
JordiManyer authored Jan 13, 2025
2 parents f4c35ea + 57af29c commit 4ed24bf
Show file tree
Hide file tree
Showing 78 changed files with 3,894 additions and 3,719 deletions.
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

0 comments on commit 4ed24bf

Please sign in to comment.