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

Default quadrature rule for Tets contains negative weight #1022

Open
termi-official opened this issue Jul 12, 2024 · 8 comments
Open

Default quadrature rule for Tets contains negative weight #1022

termi-official opened this issue Jul 12, 2024 · 8 comments

Comments

@termi-official
Copy link
Member

Negative quadrature weights can cause all sorts of issues when integrating functions, which are outside the basis space they are designed for. While such rules can be more efficient on many problems, I do not think that we should provide a problematic rule as the default rule to users, such that users must explicitly make the decision to use a rule with negative weights if they want the additional performance. After a bit googling I think https://portwooddigital.com/2020/07/03/integration-points-with-negative-weight/ explains the issue, which can be really hard to track down.

Hence I would propose that we should provide, as the default, only rules with positive weights to not surprise new users. Furthermore I think it makes sense to spend a few lines on this in the docs.

@KnutAM
Copy link
Member

KnutAM commented Aug 29, 2024

Negative quadrature weights can cause all sorts of issues when integrating functions, which are outside the basis space they are designed for.

Do you here mean the basis space that the quadrature rule is designed for?

While I see that the why is hard to explain. Do you know of any references that report that his is an issue for the tet cases where we have negative weights currently?

The blogpost seems to be more focused on structural elements, and in particular says

These approaches lead to varying degrees of strange results, but are generally harmless because the negative integration weights are not at the ends of the element. However, there could be unexpected results with member loads.

I interpret this as saying that negative weights are only an issue at the end points.

The example deal with plastic hinges and shows what happens when such a hinge is outside the element, leading to a negative integration weight. But I don't understand how the fact that an input error in defining the plastic hinge which gives a negative weight relates to the properties of having negative weights in general.

@termi-official
Copy link
Member Author

Negative quadrature weights can cause all sorts of issues when integrating functions, which are outside the basis space they are designed for.

Do you here mean the basis space that the quadrature rule is designed for?

Yes. E.g. for some of the rules the space is polynomials of order p on the reference geometry.

While I see that the why is hard to explain. Do you know of any references that report that his is an issue for the tet cases where we have negative weights currently?

No reference here at hand, but you can just take any problem with localized nonlinearity and positivity. For example you can center the nonlinearity (e.g. something like exp(-100(x-c)^2)) on the point with the negative weight and obtain entries with the wrong sign in your stiffness matrix.

@KnutAM
Copy link
Member

KnutAM commented Aug 30, 2024

Valid argument!

@termi-official
Copy link
Member Author

I know it is a bit made up, and most of the users won't ever hit such a case. However, I am just worried that, if users hit such a case and are not aware of this issue, then I think it will be insanely difficult for them to track the problem down, because the vast majority of the users come with the expectation that the quadrature rule does the "correct integration".

@KnutAM
Copy link
Member

KnutAM commented Aug 30, 2024

Yes, that was my thought too but sufficient to warrant playing it safe (a ref to motivate in the docs would be nice of course, but apart from that - after trying to get a bit into this, I think moving forward with new defaults should be ok).

Without knowing, I would guess that we sacrifice some accuracy for standard cases by changing to positive order here if measured in the highest exact polynomial order per quadrature point. On the other hand, for non-polynomial functions I'm not sure. But surely there must be results for this in the literature for e.g. rational, exponential, and other functions?

Since people are using Ferrite in so many different ways, favoring safe over fast/accurate default seems reasonable to me in this case. I guess the only place this will commonly affect users is L2 projection on tetrahedrons.

@termi-official
Copy link
Member Author

Without knowing, I would guess that we sacrifice some accuracy for standard cases by changing to positive order here if measured in the highest exact polynomial order per quadrature point. On the other hand, for non-polynomial functions I'm not sure.

I think regarding accurracy there should not be a significant difference. Also note that most of the quadrature rules out there are not designed to integrate full polynomial systems, but slight variations (e.g. Laguerre for \int p(x)exp(-x)dx ,...).

But surely there must be results for this in the literature for e.g. rational, exponential, and other functions?

I was also wondering if we have some rules which can integrate the function found in for e.g. nonlinear geometry exactly.

@fredrikekre
Copy link
Member

I think it is fine to changes this later without call it breaking.

@fredrikekre fredrikekre modified the milestones: v1.0.0, v1.X Sep 17, 2024
@KnutAM
Copy link
Member

KnutAM commented Oct 2, 2024

Reference to motivation why this is bad (to not loose in the Slack-hole): https://www.sciencedirect.com/science/article/pii/S0898122121002820?via%3Dihub

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