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

Bug: Operations on empty FESpaces #1085

Closed
JordiManyer opened this issue Feb 25, 2025 · 0 comments · Fixed by #1070
Closed

Bug: Operations on empty FESpaces #1085

JordiManyer opened this issue Feb 25, 2025 · 0 comments · Fixed by #1070
Assignees
Labels
bug Something isn't working

Comments

@JordiManyer
Copy link
Member

JordiManyer commented Feb 25, 2025

When evaluating the gradient of an FEFunction defined on an empty FESpace, en error occurs.

The error can be avoided by doing the change of domain first then doing the gradient, i.e the change of domain and the gradient do not commute. It has to do with how extend works for different kinds of arrays.

using Gridap
using Gridap.CellData, Gridap.FESpaces, Gridap.Arrays, Gridap.Geometry
using Gridap.ReferenceFEs, Gridap.TensorValues

model = CartesianDiscreteModel((0,1,0,1),(3,3))

Ω = Triangulation(model)
Ωe = Triangulation(model,Int[])

dΩ = Measure(Ω,2)
dΩe = Measure(Ωe,2)

reffe = ReferenceFE(lagrangian,Float64,1)
V = FESpace(Ωe,reffe)
uh = zero(V)

Π(u) = change_domain(u,Ω,DomainStyle(u))
x = get_cell_points(Ω)

uh(x) # OK
(uh)(x) # ERROR - Equivalent to Π(∇(uh))(x)
(Π(uh))(x) # OK
@JordiManyer JordiManyer added the bug Something isn't working label Feb 25, 2025
@JordiManyer JordiManyer self-assigned this Feb 25, 2025
JordiManyer added a commit that referenced this issue Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant