Skip to content

Commit

Permalink
IsolatedVol changes + MWEs
Browse files Browse the repository at this point in the history
  • Loading branch information
zjwegert committed Feb 11, 2025
1 parent a045a24 commit b4234f2
Show file tree
Hide file tree
Showing 26 changed files with 127,618 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ fsolid(x) = min(f0(x,l*(1+_e),b*(1+_e)),f0(x,w*(1+_e),a*(1+_e)))
fholes((x,y),q,r) = max(f1((x,y),q,r),f1((x-1/q,y),q,r))
φf(x) = min(max(fin(x),fholes(x,25,0.2)),fsolid(x))
# φf(x) = min(max(fin(x),fholes(x,22,0.6)),fsolid(x))
φh = interpolate(φf,V_φ)
# φh = interpolate(φf,V_φ)

_φf2(x) = max(φf(x),-(max(2/0.2*abs(x[1]-0.319),2/0.2*abs(x[2]-0.3))-1))
φf2(x) = min(_φf2(x),sqrt((x[1]-0.35)^2+(x[2]-0.26)^2)-0.025)
φh = interpolate(φf2,V_φ)

φh_nondesign = interpolate(fsolid,V_φ)

Expand All @@ -75,6 +79,14 @@ dΓf_N = Measure(Γf_N,degree)
Ω_act_s = Triangulation(cutgeo,ACTIVE)
Ω_act_f = Triangulation(cutgeo,ACTIVE_OUT)
Γi = SkeletonTriangulation(cutgeo_facets,ACTIVE_OUT)

bgcell_to_inoutcut = compute_bgcell_to_inoutcut(cutgeo,get_geometry(cutgeo))
# cell_to_color_fluid, _ = GridapTopOpt.tag_isolated_volumes(model,bgcell_to_inoutcut;groups=((GridapTopOpt.CUT,OUT),IN))
# cell_to_color_solid, _ = GridapTopOpt.tag_isolated_volumes(model,bgcell_to_inoutcut;groups=((GridapTopOpt.CUT,IN),OUT))

cell_to_color_fluid, _ = GridapTopOpt.tag_isolated_volumes(model,bgcell_to_inoutcut;groups=(OUT,(GridapTopOpt.CUT,IN)))
cell_to_color_solid, _ = GridapTopOpt.tag_isolated_volumes(model,bgcell_to_inoutcut;groups=(IN,(GridapTopOpt.CUT,OUT)))

(;
:Ωs => Ωs,
:dΩs => Measure(Ωs,degree),
Expand All @@ -92,11 +104,22 @@ dΓf_N = Measure(Γf_N,degree)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
:bgcell_to_inoutcut => bgcell_to_inoutcut,
:cell_to_color_fluid => cell_to_color_fluid,
:cell_to_color_solid => cell_to_color_solid
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["φh"=>φh,"ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f],
celldata=[
"inoutcut"=>Ω.bgcell_to_inoutcut,
"volumes fluid"=>Ω.cell_to_color_fluid,
"volumes solid"=>Ω.cell_to_color_solid
])
writevtk.Ωs,path*"Omega_s_initial")
writevtk.Ωf,path*"Omega_f_initial")
error()

# Setup spaces
uin(x) = VectorValue(16x[2]*(H-x[2]),0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ dΓf_N = Measure(Γf_N,degree)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ function main(ranks)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ function main(ranks)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
return

# Setup spaces
uin(x) = VectorValue(x[2],0.0,0.0)
Expand Down Expand Up @@ -350,7 +351,7 @@ function main(ranks)
end

with_mpi() do distribute
ncpus = 96
ncpus = 8
ranks = distribute(LinearIndices((ncpus,)))
petsc_options = "-ksp_converged_reason -ksp_error_if_not_converged true"
GridapPETSc.with(;args=split(petsc_options)) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ function main(ranks,mesh_partition)
fholes((x,y,z),q,r) = max(f1((x,y,z),q,r),f1((x-1/q,y,z),q,r))
lsf(x) = min(max(fin(x),fholes(x,5,0.5)),fsolid(x))
φh = interpolate(lsf,V_φ)
writevtk(get_triangulation(φh),path*"initial_lsf",cellfields=["φh"=>φh])

= get_free_dof_values(φh)
map(local_views(_φ)) do φ
idx = findall(isapprox(0.0;atol=eps()),φ)
if !isempty(idx)
i_am_main(ranks) && println(" Correcting level values at $(length(idx)) nodes")
end
φ[idx] .+= 100*eps(eltype(φ))
end
consistent!(_φ) |> wait

φh_nondesign = interpolate(fsolid,V_φ)

Expand Down Expand Up @@ -166,11 +177,12 @@ function main(ranks,mesh_partition)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
return

# Setup spaces
uin(x) = VectorValue(x[2],0.0,0.0)
Expand Down Expand Up @@ -239,7 +251,8 @@ function main(ranks,mesh_partition)
# n_Γ = -(_n ∘ ∇(φ))
return (a_Ω(u,v) + b_Ω(v,p) + b_Ω(u,q) + v_ψ(p,q))Ω.dΩf +
(a_Γ(u,v,n_Γ) + b_Γ(v,p,n_Γ) + b_Γ(u,q,n_Γ))Ω.+
(ju(u,v) + 0mean(φ))Ω.dΓg - (jp(p,q) + 0mean(φ))Ω.dΓi
(ju(u,v))Ω.dΓg - (jp(p,q))Ω.dΓi
# ∫(ju(u,v) + 0mean(φ))Ω.dΓg - ∫(jp(p,q) + 0mean(φ))Ω.dΓi
end

l_fluid((),(v,q),φ) = (0q)Ω.dΩf
Expand All @@ -264,7 +277,8 @@ function main(ranks,mesh_partition)

function a_solid(((u,p),),d,s,φ)
return (a_s_Ω(d,s))Ω.dΩs +
(j_s_k(d,s) + 0mean(φ) + 0*jump(p*p))Ω.dΓg +
# ∫(j_s_k(d,s) + 0mean(φ) + 0*jump(p*p))Ω.dΓg +
(j_s_k(d,s))Ω.dΓg +
(v_s_ψ(d,s))Ω.dΩs
end
function l_solid(((u,p),),s,φ)
Expand Down Expand Up @@ -360,6 +374,7 @@ function main(ranks,mesh_partition)
end
consistent!(_φ) |> wait
reinit!(ls_evo,φh)
return "First Iteration done!"
end
it = get_history(optimiser).niter; uh,ph,dh = get_state(pcf)
writevtk(Ω_act,path*"Omega_act_$it",
Expand All @@ -371,7 +386,7 @@ function main(ranks,mesh_partition)
end

with_mpi() do distribute
mesh_partition = (4,8,8)
mesh_partition = (2,2,2)
ranks = distribute(LinearIndices((prod(mesh_partition),)))
petsc_options = "-ksp_converged_reason -ksp_error_if_not_converged true"
GridapPETSc.with(;args=split(petsc_options)) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ function main(ranks)
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ function main_cutfem(data,params;R=0.1,c=(0.5,0.2))
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
# writevtk(Ω.Γg,path*"Gamma_g")
Expand Down Expand Up @@ -326,8 +326,8 @@ function main_cutfem_p1p0(data,params;R=0.1,c=(0.5,0.2))
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function main_cutfem(data,params;R=0.1,c=(0.5,0.2))
:Fi => Fi,
:dFi => Measure(Fi,degree),
:n_Fi => get_normal_vector(Fi),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ function main_cutfem(ranks,params;R=0.1,c=(0.5,0.2))
:Γi => Γi,
:dΓi => Measure(Γi,degree),
:n_Γi => get_normal_vector(Γi),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
# writevtk(Ω.Γg,path*"Gamma_g")
# writevtk(Ω.Γi,path*"Gamma_i")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function main_cutfem(data,params;R=0.1,c=(0.5,0.2))
:dΓ => Measure(Γ,degree),
:Ω_act_f => Ω_act_f,
:dΩ_act_f => Measure(Ω_act_f,degree),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ dΓf_N = Measure(Γf_N,degree)
:Λ_f => Λ_f,
:dΛ_f => Measure(Λ_f,degree),
:n_Λ_f => get_normal_vector(Λ_f),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask_without_cuts(cutgeo,["Gamma_f_D"];IN_is=OUT)
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ dΓf_N = Measure(Γf_N,degree)
:Λ_f => Λ_f,
:dΛ_f => Measure(Λ_f,degree),
:n_Λ_f => get_normal_vector(Λ_f),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT),
# :ψ_f => GridapTopOpt.get_isolated_volumes_mask_without_cuts(cutgeo,["Gamma_f_D"];IN_is=OUT)
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN))),
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ function main(ranks)
:dΩ_act_s => Measure(Ω_act_s,degree),
:Ω_act_f => Ω_act_f,
:dΩ_act_f => Measure(Ω_act_f,degree),
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:ψ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:ψ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["ψ_s"=>Ω.ψ_s,"ψ_f"=>Ω.ψ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ dΓf_N = Measure(Γf_N,degree)
:n_Γg => get_normal_vector(Γg),
=> Γ,
:dΓ => Measure(Γ,degree),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["χ_s"=>Ω.χ_s,"χ_f"=>Ω.χ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ dΓf_N = Measure(Γf_N,degree)
:n_Γg => get_normal_vector(Γg),
=> Γ,
:dΓ => Measure(Γ,degree),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["χ_s"=>Ω.χ_s,"χ_f"=>Ω.χ_f])
Expand Down
4 changes: 2 additions & 2 deletions scripts/Embedded/Examples/deprecated/3D_Evolution_Solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ function main(ranks)
:n_Γg => get_normal_vector(Γg),
=> Γ,
:dΓ => Measure(Γ,degree),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/Embedded/Examples/deprecated/DiffusionTagging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ op = AffineFEOperator(A,B,Ξ,Ψ)
ψbar(ψ) = 1/2 + 1/2*tanh(kw*-kt*ψ_inf))

cellfields = ["ψ"=>ψh,"ψbar"=>ψbar (ψh),
"ξ"=>GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)]
"ξ"=>GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))]

writevtk(get_triangulation(model),path*"psih_bg",cellfields=cellfields)
writevtk(Ωf,path*"psih_physical",cellfields=cellfields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ dΓf_N = Measure(Γf_N,degree)
:dΓ => Measure(Γ,degree),
:Ω_act_s => Triangulation(cutgeo,ACTIVE),
:Ω_act_f => Triangulation(cutgeo,ACTIVE_OUT),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["χ_s"=>Ω.χ_s,"χ_f"=>Ω.χ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ function main()
:n_Γg => get_normal_vector(Γg),
=> Γ,
:dΓ => Measure(Γ,degree),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["χ_s"=>Ω.χ_s,"χ_f"=>Ω.χ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ dΓf_N = Measure(Γf_N,degree)
:n_Γg => get_normal_vector(Γg),
=> Γ,
:dΓ => Measure(Γ,degree),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end
writevtk(get_triangulation(φh),path*"initial_islands",cellfields=["χ_s"=>Ω.χ_s,"χ_f"=>Ω.χ_f])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ dΓf_N = Measure(Γf_N,degree)
:n_Γ => get_normal_vector.trian),
:Ω_act_s => Triangulation(cutgeo,ACTIVE),
:Ω_act_f => Triangulation(cutgeo,ACTIVE_OUT),
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];IN_is=IN),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];IN_is=OUT)
:χ_s => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_s_D"];groups=(IN,(GridapTopOpt.CUT,OUT))),
:χ_f => GridapTopOpt.get_isolated_volumes_mask(cutgeo,["Gamma_f_D"];groups=(OUT,(GridapTopOpt.CUT,IN)))
)
end

Expand Down
Loading

0 comments on commit b4234f2

Please sign in to comment.