Skip to content

Bug in CSG #79

Description

@pmartorell

Dear @fverdugo ,

I found a bug in CSG with rectangles. In the MWE below the boundary is discontinuous. See the figure of the triangulations.

using Gridap
using GridapEmbedded

x0 = Point(0.2,0.2)
d1 = VectorValue(0.2,0.0)
d2 = VectorValue(0.0,0.6)
geo1 = quadrilateral(;x0=x0,d1=d1,d2=d2)

x0 = Point(0.2,0.4)
d1 = VectorValue(0.6,0.0)
d2 = VectorValue(0.0,0.2)
geo2 = quadrilateral(;x0=x0,d1=d1,d2=d2)
geo = union(geo1,geo2)

domain = (0, 1, 0, 1)
cells = (9,9)
bgmodel = CartesianDiscreteModel(domain,cells)
cutgeo = cut(bgmodel,geo)
Γ = EmbeddedBoundary(cutgeo)
Ω = Triangulation(cutgeo)
Ωbg = Triangulation(bgmodel)

writevtk(Γ,"G")
writevtk(Ω,"O")
writevtk(Ωbg,"Obg")

Screenshot from 2024-04-11 17-34-57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions