Gridap.jl icon indicating copy to clipboard operation
Gridap.jl copied to clipboard

Error in fine to coarse fields tests with order 0

Open rpetit opened this issue 1 year ago • 1 comments

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.

rpetit avatar Jun 11 '24 09:06 rpetit

Hi @rpetit, the FineToCoarseRefFE is in the process of being completely overhauled. The current implementation probably doesn't really work at all (it was a toy concept). The changes will probably be merged in a month or two.

JordiManyer avatar Aug 09 '24 05:08 JordiManyer

@rpetit the new release has the changes I mentioned. You can now do those things using MacroElements.

JordiManyer avatar Nov 08 '24 06:11 JordiManyer

Hi @JordiManyer. Thanks, will test asap!

rpetit avatar Nov 08 '24 08:11 rpetit