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

How to prevent negative value with Legendre basis? #4267

Closed
sungho91 opened this issue Apr 25, 2024 · 2 comments
Closed

How to prevent negative value with Legendre basis? #4267

sungho91 opened this issue Apr 25, 2024 · 2 comments
Assignees

Comments

@sungho91
Copy link

Hello all,

I have a quick question. I tried to interpolate a certain value (0.5) in L2 space with 1st order initially using coefficient projection within a certain portion of my domain.

I tested two basis functions: positive (Bernstein polynomials) and non-positive (Legendre polynomials) basis.
The figure shows that using Legendre polynomials results in negative values, but Bernstein does not. I thought that even if Legendre has a non-positive portion, when we sum up all the weights, we obtain a positive result. Is there any way to prevent negative values with Legendre?

The reason why I tried to use Legendre is because I found that positive basis functions with strain softening show unreasonable behaviors with high-order, I have to conduct more tests though.

Thanks

Sungho

g1

@v-dobrev
Copy link
Member

For best results, I'd suggest using a mesh that is aligned with the discontinuity in the coefficient, if possible. If not possible to use aligned mesh, using the Bernstein basis (at least for the coefficient "projection" step) is the better option to avoid oscillations. With the Legendre basis, the projection is actually just polynomial interpolation, so it is normal to get oscillations around discontinuities of the coefficient. With the Bernstein basis, the "projection" is actually just approximation (1st order), however it is guaranteed to not produce oscillations.

@v-dobrev
Copy link
Member

Note that the code outside the coefficient projection step can use any basis, just the FE space on which you project the coefficient needs to use Bernstein basis.

@tzanio tzanio self-assigned this May 11, 2024
@tzanio tzanio closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants