question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

specify quadrature

See original GitHub issue

One of the things arising from the recent investigation into the poor behaviour of elastic modal analysis with ElementTetP1 #75 was the idea of reduced quadrature; e.g. in discussing ElementHex1, Petyt (1990, Introduction to Finite Element Vibration Analysis, Cambridge University Press, §5.8) recommends a rule with one abscissa at the centroid. Reduced quadrature or ‘selective integration’ is also discussed by

although their practical recommendation is for increasing the order of the element as done here in #322.

Currently I don’t see an easy way to experiment with quadrature in scikit-fem. I think though that enabling this would be simple generalization of the constructor for skfem.assembly.Basis.

https://github.com/kinnala/scikit-fem/blob/89f726808f50bf9773f1e2c7d43248ccbd0714a0/skfem/assembly/basis/basis.py#L26

or maybe

https://github.com/kinnala/scikit-fem/blob/89f726808f50bf9773f1e2c7d43248ccbd0714a0/skfem/assembly/basis/interior_basis.py#L35-L40

(and similarly for FacetBasis) so that either one specifies:

  • the actual quadrature rule, i.e. X and W which become attributes of the InteriorBasis, or
  • intorder: int as now, and the rule is computed from skfem.quadrature.get_quadrature, or
  • nothing, also as now, and intorder is computed from self.elem.maxdeg.

A possible further modification is that the type of the rule returned by get_quadrature is Tuple[ndarray, ndarray] from which it is unclear which is weights and which abscissae. Perhaps a quadrature rule might be represented as in quadpy.nsimplex._helpers.NSimplexScheme as an object with attributes weights and points, or more simply as a NamedTuple (or dataclass) with similarly named attributes; given Python’s duck-typing, reference from within skfem.assembly only to attributes weights and points might enable direct use of one of the many schemes from quadpy while only importing it at the top-level user-script in which the basis is instantiated.

I don’t think that this is urgent—I don’t have any immediate plans to use it myself—but it seems like an easy addition and something that should be present in a general finite element library. I think it’s mostly a matter of deciding on the desired syntax.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kinnalacommented, Mar 2, 2020

Nevertheless, I still don’t oppose using these representations in skfem.quadrature. I think it pays off in the long term to be compatible with other packages in the ecosystem.

0reactions
gdmcbaincommented, Mar 2, 2020

I wonder whether multiple inheritance would help here; e.g. deriving MeshTet from MeshSimplex as well as Mesh3D.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quadrature -- from Wolfram MathWorld
The word quadrature is also used to mean squaring: the construction of a square using only compass and straightedge which has the same...
Read more >
Numerical Quadrature
One way to compare quadrature rules is to determine the highest degree poly- nomial that the rule integrates exactly, that is, the degree...
Read more >
Gaussian quadrature - Wikipedia
In numerical analysis, a quadrature rule is an approximation of the definite integral of a function, usually stated as a weighted sum of...
Read more >
Numerical Quadrature
The goal is to determine which points to evaluate and what weights to use so as to maximize performance over a broad class...
Read more >
Quadrature Definition & Meaning - Dictionary.com
the act or process of finding a square equal in area to a given surface, especially a surface bounded by a curve. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found