Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
debugging Forward Euler
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolcg committed Oct 25, 2021
1 parent 0ceabc1 commit 218203d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/TransientFEsTests/ForwardEulerHeatEquationTests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module HeatEquationTests
module ForwardEulerHeatEquationTests

using Gridap
using ForwardDiff
Expand Down Expand Up @@ -30,25 +30,29 @@ model = CartesianDiscreteModel(domain,partition)

order = 2

reffe = ReferenceFE(lagrangian,Float64,order)
V0 = FESpace(
reffe=lagrangian, order=order, valuetype=Float64,
conformity=:H1, model=model, dirichlet_tags="boundary")
model,
reffe,
conformity=:H1,
dirichlet_tags="boundary"
)
U = TransientTrialFESpace(V0,u)

trian = Triangulation(model)
Ω = Triangulation(model)
degree = 2*order
quad = CellQuadrature(trian,degree)
= Measure,degree)

#
a(u,v) = (v)(u)
b(v,t) = v*f(t)

res(t,(u,ut),v) = a(u,v) + ut*v - b(v,t)
res(t,(u,ut),v) = ( a(u,v) + ut*v - b(v,t) )dΩ
jac(t,(u,ut),du,v) = a(du,v)
jac_t(t,(u,ut),dut,v) = dut*v
jac_t(t,(u,ut),dut,v) = ( dut*v )dΩ

t_Ω = FETerm(res,jac,jac_t,trian,quad)
op = TransientFEOperator(U,V0,t_Ω)
#t_Ω = FETerm(res,jac,jac_t,trian,quad)
op = TransientFEOperator(res,jac,jac_t,U,V0)

t0 = 0.0
tF = 1.0
Expand Down

0 comments on commit 218203d

Please sign in to comment.