Replies: 1 comment 1 reply
-
rhs = linf.assemble(basis, phi=basis.with_element(ElementTriP0()).interpolate(indicator)) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gdmcbain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say τ is
ElementTriRT0
and φ isElementTriP0
and I want to define the linear form (φ, div τ). How do I interpolate the scalar coefficient φ onto the common quadrature points?Motivation: Thinking about the (weak) gradient of a piecewise-constant function like an indicator function over in #821 on Friday, I suggested :
My thinking was that a weak definition of σ = grad φ would be (σ, τ) = (grad φ, τ) for all τ and integrating the right-hand side by parts would give (grad φ, τ) = (n φ, τ)∂Ω − (φ, div τ).
Then to begin with I thought I'd make my life easier by considering only the indicator function of an internal subdomain so that φ would vanish on ∂Ω and I'd only have to solve (σ, τ) = − (φ, div τ).
The LHS is a vector-mass matrix, but what about the RHS?
I had a quick go at this with:
but of course this raises
This (viz., have a scalar coefficient in a vectorial form) seems like an obvious kind of thing to want to do; am I overlooking something simple?
Beta Was this translation helpful? Give feedback.
All reactions