diff --git a/scripts/Embedded/MWEs/zach_embedded.jl b/scripts/Embedded/MWEs/zach_embedded.jl index e673547f..94e899ee 100644 --- a/scripts/Embedded/MWEs/zach_embedded.jl +++ b/scripts/Embedded/MWEs/zach_embedded.jl @@ -52,21 +52,20 @@ diff_Ωout = DifferentiableTriangulation(Ωout) fh = interpolate(x->x[1]+x[2],V_φ) dΩin = Measure(diff_Ωin,2*order) -j_in(φ) = ∫(fh)dΩin -# j_in(φ) = ∫(cos ∘ fh)dΩin # <- this breaks +j_in(φ) = ∫(cos ∘ fh)dΩin dj_in = gradient(j_in,φh) dj_vec_in = assemble_vector(dj_in,V_φ) norm(dj_vec_in) dΩout = Measure(diff_Ωout,2*order) -j_out(φ) = ∫(fh)dΩout +j_out(φ) = ∫(cos ∘ fh)dΩout dj_out = gradient(j_out,φh) dj_vec_out = -assemble_vector(dj_out,V_φ) norm(dj_vec_out) Γ = EmbeddedBoundary(cutgeo) dΓ = Measure(Γ,2*order) -dj_expected(q) = ∫(-fh*q/(norm ∘ (∇(φh))))dΓ +dj_expected(q) = ∫(-(cos ∘ fh)*q/(norm ∘ (∇(φh))))dΓ dj_exp_vec = assemble_vector(dj_expected,V_φ) norm(dj_exp_vec) diff --git a/scripts/Embedded/differentiable_trians.jl b/scripts/Embedded/differentiable_trians.jl index beb2bd77..e1fe325b 100644 --- a/scripts/Embedded/differentiable_trians.jl +++ b/scripts/Embedded/differentiable_trians.jl @@ -270,3 +270,15 @@ function Geometry.get_glue(ttrian::DifferentiableTriangulation{Dc},val::Val{d}) tface_to_mface_map = ref_cell_map FaceToFaceGlue(tface_to_mface,tface_to_mface_map,nothing) end + +function CellData.change_domain(a::CellField,strian::DifferentiableTriangulation,sds::ReferenceDomain,ttrian::Triangulation,tds::ReferenceDomain) + change_domain(a,strian.trian,sds,ttrian,tds) +end + +function CellData.change_domain(a::CellField,strian::DifferentiableTriangulation,sds::ReferenceDomain,ttrian::DifferentiableTriangulation,tds::ReferenceDomain) + change_domain(a,strian.trian,sds,ttrian.trian,tds) +end + +function CellData.change_domain(a::CellField,strian::Triangulation,sds::ReferenceDomain,ttrian::DifferentiableTriangulation,tds::ReferenceDomain) + change_domain(a,strian,sds,ttrian.trian,tds) +end \ No newline at end of file