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.

Coefficient defined on quadrature points in the form definition

See original GitHub issue

I have a the coefficient function that does not belong to the same finite element space as v, but is defined for each quadrature point.

@LinearForm
def loading(v, w):
    return dot(w["sig0"], sym(grad(v)))

Is it possible?

Background In linear elasticity, sometimes the stress - strain is given by

sigma = Hooke @ eps + sig0

where sig0 is the initial stress tensor, possibly heterogeneous (different value for each Gauss point). This can be used for instance to model thermal stress.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
gdmcbaincommented, Feb 19, 2021

If you pass v to the .interpolate method of its basis, you’ll get a DiscreteField which has a .grad attribute.

1reaction
kinnalacommented, Feb 19, 2021

I wonder if there is a more “local” way to do this without doing a global solve (like LocalSolver in FEniCS)…

Unfortunately, no. I think the “correct” way to do this would be to return here a list of local stiffness matrices: https://github.com/kinnala/scikit-fem/blob/91a276ab2e7e8eda8a01b40a97d1c25d0e939ece/skfem/assembly/form/bilinear_form.py#L101

And then use np.linalg.solve or similar which supports solving multiple dense systems at one go. I can try implementing it in few days if you want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Quadrature Point - an overview | ScienceDirect Topics
In this method, nodes and their associated materials points get displaced during the deformation of the domain. Throughout the problem nodes on the...
Read more >
Numerical Quadrature
For a function of one independent variable, the basic idea of a quadrature rule is to replace the definite integral by a sum...
Read more >
LECTURE 16 GAUSS QUADRATURE • In general for Newton ...
Recall that Newton Cotes integration points only integrates an degree polynomial exactly depending on being odd or even. • For Gauss-Legendre integration, we ......
Read more >
Numerical integration: Gaussian quadrature rules
Any (non-composite) quadrature rule can be written in the form ... In general, 2n parameters could potentially define a polynomial of degree up...
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