Skip to content

Moment based reffes - Implementation of scalar Bernstein basis in barycentric coordinates. #1104

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

Open
wants to merge 24 commits into
base: moment-based-reffes
Choose a base branch
from

Conversation

Antoinemarteau
Copy link
Contributor

@Antoinemarteau Antoinemarteau commented May 1, 2025

The new BernsteinBasisOnSimplex implements the Bernstein polynomials in barycentric coordinates in any dimension and order, relative to the coordinates of the reference simplex or of a given simplex. The simplex is assumed polytopal (first geometric order). Gradient and Hessian are supported.

I also renamed UniformPolyBases to CartProdPolyBasis, and removed polynomial order from the polynomial basis structs parameters, following discussions with Jordi and Santiago.

ATM, it is not possible to define a basis relative to a D-simplex in a domain of dimension > D, this could be done by adding another dimension type parameter, I don't know if this would be useful.

and 1D Monomial basis optimization
de Casteljau indices and iteration needed to be computed and unrolled at compile
time
To really optimise this, the tuple of orders should be added in the type
parameters of the UniformPolyBases and CompWiseTensorPolyBases, in order
to avoid creating the Val(Kd) at runtime and associated runtime dispatch
into _evaluate_1d! (but this seems overkill for most usages)
renamed _ps_filter and _qs_filter to _ph_filter and _qh_filter
respectively, "h" for Homogeneous.
A dof basis \Sigma is a set of dofs \sigma, and a dof is in
V* = {\sigma: V -> R}, not in V** = { p: V* -> R}.
Removed the maximum order K from template parameters of PolynomialBasis
to simplify the type signature,
added the corresponding field to all concrete subtypes,
passed the order by Val to [...]_nd! functions to avoid allocations and
runtime dispatch in them (at each evaluation point)
added _get_static_parameters(::PolynomialBasis) to let each basis choose
their static parameter (Val(K), nothing, others...)
unfortunately _evaluate_nd! and friend do not specialize properly
when unpacking a tuple of Val in evaluate!

The parameters could also be put in cache, but then return_cache is not
independant of the polynomial order anymore (currently it is thanks to
_setsize! in evaluate!)
Copy link

codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 99.69325% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.04%. Comparing base (c158861) to head (f9fccc9).

Files with missing lines Patch % Lines
src/Polynomials/BernsteinBases.jl 99.50% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           moment-based-reffes    #1104      +/-   ##
=======================================================
+ Coverage                85.92%   86.04%   +0.12%     
=======================================================
  Files                      211      211              
  Lines                    24347    24568     +221     
=======================================================
+ Hits                     20920    21140     +220     
- Misses                    3427     3428       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Fixed test coverage, fixed singular simplex detection, simplified
bernstein_term_id, updated NEWS.md.
@Antoinemarteau Antoinemarteau marked this pull request as ready for review May 2, 2025 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant