gridap / Gridap.jl

Grid-based approximation of partial differential equations in Julia
MIT License
665 stars 94 forks source link

Error in fine to coarse fields tests with order 0 #1011

Open rpetit opened 1 month ago

rpetit commented 1 month ago

Hi,

I noticed that runing AdaptivityTests/FineToCoarseFieldsTests.jl yields an error when order = 1 is replaced by order = 0 (line 17). The first error is raised by line 36 and reads:

Internal Error: MethodError: get_face_own_dofs(::Gridap.Adaptivity.FineToCoarseRefFE{GenericLagrangianRefFE{L2Conformity, 2}, 2, Gridap.Adaptivity.FineToCoarseDofBasis{Gridap.ReferenceFEs.PointValue{VectorValue{2, Float64}}, LagrangianDofBasis{VectorValue{2, Float64}, Int64}, RefinementRule{ExtrusionPolytope{2}, UnstructuredDiscreteModel{2, 2, Float64, Oriented}}, Vector{Int32}}}, ::L2Conformity) is ambiguous.

Candidates:
  get_face_own_dofs(reffe::Gridap.Adaptivity.FineToCoarseRefFE, conf::Conformity)
    @ Gridap.Adaptivity ~/.julia/packages/Gridap/5nlYf/src/Adaptivity/FineToCoarseReferenceFEs.jl:109
  get_face_own_dofs(reffe::ReferenceFE, conf::L2Conformity)
    @ Gridap.ReferenceFEs ~/.julia/packages/Gridap/5nlYf/src/ReferenceFEs/ReferenceFEInterfaces.jl:123

Possible fix, define
  get_face_own_dofs(::Gridap.Adaptivity.FineToCoarseRefFE, ::L2Conformity)

When order = 1 the function get_face_own_dofs is called in test_reference_fe with arguments FineToCoarseRefFE() and GradConformity(), which does not raise any error. When order = 0, the arguments are FineToCoarseRefFE() and L2Conformity().

Is this something intended or a bug? In the latter case, although I'm not sure how to fix it, I'd be eager to help!

Thanks!

Edit

Adding the definition

ReferenceFEs.get_face_own_dofs(reffe::FineToCoarseRefFE,conf::L2Conformity) = get_face_own_dofs(reffe.reffe,conf)

after Line 109 in Adaptivity/FineToCoarseReferenceFEs.jl seems to work but I'm not sure it's the right way to go.