Skip to content

Bug with AdaptiveDiscreteModels #106

Description

@janmodderman

I ran into an AssertionError which I believe to be a bug when an AppendedTriangulation is constructed using a SubCellTriangulation and an AdaptedTriangulation.

The following piece of code reproduces the error:

module debug_embedded_adaptive
using Gridap, Gridap.Adaptivity
using GridapEmbedded

model = CartesianDiscreteModel((-8,8,-8,8,-8,0),(2,2,2))                                                         
model = refine(model,2)
geo = tube(2.0,4.0,x0=VectorValue(0,0,-4.0),v=VectorValue(0,0,1))
cutgeo = cut(model, geo)
Ωᵢ = Interior(cutgeo, PHYSICAL)
end # module

The failing assertion (located in https://github.com/gridap/Gridap.jl/blob/0f2ef80ff010c558514166b03c3b276e4c4c945b/src/Geometry/AppendedTriangulations.jl#L110) requires get_background_model from both triangulations to return the same object, for the SubCellTriangulation this is correctly called and returns an AdaptedDiscreteModel, yet for the AdaptedTriangulation an UnstructuredDiscreteModel or CartesianDiscreteModel is returned, which corresponds to the background model of the AdaptedDiscreteModel (see https://github.com/gridap/Gridap.jl/blob/0f2ef80ff010c558514166b03c3b276e4c4c945b/src/Adaptivity/AdaptedTriangulations.jl#L49).

I'm not sure what the best solution would be here.

Currently, I have a workaround that changes the background model of the AdaptedDiscreteModel in the cut function, which seems to fix things.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions