Skip to content

Commit

Permalink
Change domain bug script
Browse files Browse the repository at this point in the history
  • Loading branch information
zjwegert committed Nov 15, 2024
1 parent 6302c38 commit a272132
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions scripts/Embedded/Bugs/change_domain_bug.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Gridap,GridapTopOpt
using Gridap.Adaptivity, Gridap.Geometry
using GridapEmbedded, GridapEmbedded.LevelSetCutters

n = 10
order = 1
_model = CartesianDiscreteModel((0,1,0,1),(n,n))
base_model = UnstructuredDiscreteModel(_model)
ref_model = refine(base_model, refinement_method = "barycentric")
model = ref_model.model

Ω = Triangulation(model)
= Measure(Ω,2*order)
V_φ = TestFESpace(model,ReferenceFE(lagrangian,Float64,order))
Λ = SkeletonTriangulation(Ω)
= Measure(Λ,2order)

φh = interpolate(x->-cos(4π*x[1])*cos(4π*x[2])-0.2,V_φ)
x_φ = get_free_dof_values(φh)
idx = findall(isapprox(0.0;atol=10^-10),x_φ)
@assert isempty(idx)

Ωs = EmbeddedCollection(model,φh) do cutgeo
Γ = DifferentiableTriangulation(EmbeddedBoundary(cutgeo))
(;
=> Γ,
:dΓ => Measure(Γ,2*order)
)
end

vh = zero(V_φ)

(vh)Ωs.
(vh*vh)Ωs.

0 comments on commit a272132

Please sign in to comment.