gridap / gridap/Gridap.jl

Error when evaluating fine-grid DoFs on coarse FEFunction or FEBasis

Open
#941 2 comments 0 reactions 1 assignee Claimed by @JordiManyer View on GitHub
bug
Dominant language
Julia
Stars
879
Forks
119
Avg merge
6d 3h
Merged PRs (30d)
4

Description

The following MWE:

```julia
using Gridap
using Gridap.ReferenceFEs
reffe=LagrangianRefFE(Float64,QUAD,1)
modelH=CartesianDiscreteModel((0,1,0,1),(1,1))
modelh=refine(modelH,2)
XH = TestFESpace(modelH,reffe)
Xh = TestFESpace(modelh,reffe)
xH = get_fe_basis(XH)
uH = zero(XH)
σh = Gridap.FESpaces.get_fe_dof_basis(Xh)
σh(xH) # Fails
σh(uH) # Fails
```

produces the error below, and I think it should not. I did not take a careful look at the core of Gridap, but it seems there might be a missing `change_domain` ?

```
ERROR:

A CellDof can only be evaluated on a CellField defined on the same Triangulation.

Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] macro expansion
@ ~/git-repos/Gridap.jl/src/Helpers/Macros.jl:47 [inlined]
[3] evaluate!(cache::Nothing, s::Gridap.CellData.CellDof{ReferenceDomain}, f::Gridap.FESpaces.SingleFieldFEFunction{Gridap.CellData.GenericCellField{ReferenceDomain}})
@ Gridap.CellData ~/git-repos/Gridap.jl/src/CellData/CellDofs.jl:108
[4] evaluate
@ ~/git-repos/Gridap.jl/src/Arrays/Maps.jl:87 [inlined]
[5] (::Gridap.CellData.CellDof{ReferenceDomain})(f::Gridap.FESpaces.SingleFieldFEFunction{Gridap.CellData.GenericCellField{ReferenceDomain}})
@ Gridap.CellData ~/git-repos/Gridap.jl/src/CellData/CellDofs.jl:100
[6] top-level scope
@ ~/git-repos/Gridap.jl/mwe.jl:12
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.