gridap / gridap/GridapEmbedded.jl
Bug with AdaptiveDiscreteModels
- Dominant language
- Julia
- Stars
- 50
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.