Skip to content

Commit

Permalink
Update README.md [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo authored Aug 30, 2024
1 parent 62f8774 commit 8f91f85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ GT.label_boundary_faces!(mesh;physical_name="boundary")
Γd = GT.boundary(mesh;physical_names=["boundary"])
k = 2
V = GT.lagrange_space(Ω,k;dirichlet_boundary=Γd)
uh = GT.zero_field(Float64,V)
uhd = GT.dirichlet_field(Float64,V)
u = GT.analytical_field(sum,Ω)
GT.interpolate_dirichlet!(u,uh)
GT.interpolate_dirichlet!(u,uhd)
= GT.measure(Ω,2*k)
gradient(u) = x->ForwardDiff.gradient(u,x)
(u,x) = GT.call(gradient,u)(x)
a(u,v) = GT.( x->(u,x)(v,x), dΩ)
l(v) = 0
x,A,b = GT.linear_problem(uh,a,l)
x,A,b = GT.linear_problem(uhd,a,l)
x .= A\b
uh = GT.solution_field(uhd,x)
GT.vtk_plot("results",Ω) do plt
GT.plot!(plt,u;label="u")
GT.plot!(plt,uh;label="uh")
Expand Down Expand Up @@ -98,10 +99,9 @@ a((u,p),(v,q)) =
(u(x)+p(x))*(v(x)+q(x))
-u(x)*v(x)-p(x)*q(x), dΓd)
l((v,q)) = GT.(x->u(x)*q(x), dΓd)
uh_qh = GT.zero_field(Float64,VxQ)
x,A,b = GT.linear_problem(uh_qh,a,l)
x,A,b = GT.linear_problem(Float64,VxQ,a,l)
x .= A\b
uh,qh = uh_qh
uh,qh = GT.solution_field(VxQ,x)
GT.vtk_plot("results",Ω) do plt
GT.plot!(plt,u;label="u")
GT.plot!(plt,uh;label="uh")
Expand Down

0 comments on commit 8f91f85

Please sign in to comment.