From 9be6d01e2c59c0ad59c28513c0c88f3ba60a4c71 Mon Sep 17 00:00:00 2001 From: Oriol Colomes Date: Thu, 9 Dec 2021 20:24:20 +0100 Subject: [PATCH] Fixing Forward Euler test --- results.vtu | Bin 1207 -> 0 bytes src/ODETools/ForwardEuler.jl | 3 +-- src/TransientFETools/TransientFEOperators.jl | 4 +++- .../ForwardEulerHeatEquationTests.jl | 7 ++----- test/TransientFEsTests/runtests.jl | 2 ++ 5 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 results.vtu diff --git a/results.vtu b/results.vtu deleted file mode 100644 index 6a70a188c9905ba97455588f2eeb6635ca4eba93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1207 zcmbVM%}&EG3?4rR*ojAoa)++#Ks%(Hroj*b!4AN6WUUL4+N4U;LEoB3AnDIms?kkE zN>aOy{e6xdGX9D}v;vth!Ch=$^e_VM37_$I7pE#XAL8+-OJ1MvXDkGyvKULpy8F+vm(`X6uDVPh!RpR0S zUaO`MhFW9iUWy~RQE@(3TvJ6SQqrshItv9=SH=g8H15JFMuCtKRW7D+4BQ8eUj#t{ zTBGS#2&N*61&17kgRLqGu?jD1IfqqAnnx4E9am1jLf{F`!BcF-RMv*W?)`zp-XPf( ztKgKhhUxz+%!}qUtSFh1*b&6omiJoEYK;rAex;EZ$t1EpubZ3ow0$d4$JrA@Ju1ns zx~|!h^G1!OAFVhBmwVu7gw-Wydc)*`SlhaXOv*wwP;31w>8Ea%#an0B_#U@gH2+s} qwRbvarGo>#AL)6h=W#iW?({@2=EDq>ukA}tw$4kxLRR? 0.0) + _matdata = (_matdata...,matdata_jacobian(op,t,xh,i,γ[i])) + end end matdata = vcat_matdata(_matdata) assemble_matrix_add!(A,op.assem_t, matdata) diff --git a/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl b/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl index 6cf75a3..759f014 100644 --- a/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl +++ b/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl @@ -48,10 +48,9 @@ a(u,v) = ∇(v)⋅∇(u) b(v,t) = v*f(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,(u,ut),du,v) = ∫( a(du,v) )dΩ jac_t(t,(u,ut),dut,v) = ∫( dut*v )dΩ -#t_Ω = FETerm(res,jac,jac_t,trian,quad) op = TransientFEOperator(res,jac,jac_t,U,V0) t0 = 0.0 @@ -62,8 +61,6 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -using Gridap.Algebra: NewtonRaphsonSolver -nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) ode_solver = ThetaMethod(ls,dt,θ) sol_t = solve(ode_solver,op,uh0,t0,tF) @@ -77,7 +74,7 @@ for (uh_tn, tn) in sol_t global _t_n _t_n += dt e = u(tn) - uh_tn - el2 = sqrt(sum( integrate(l2(e),trian,quad) )) + el2 = sqrt(sum( ∫(l2(e))dΩ )) @test el2 < tol end diff --git a/test/TransientFEsTests/runtests.jl b/test/TransientFEsTests/runtests.jl index 05797ad..aec4392 100644 --- a/test/TransientFEsTests/runtests.jl +++ b/test/TransientFEsTests/runtests.jl @@ -26,4 +26,6 @@ using Test @testset "HeatEquationAutoDiffTests" begin include("HeatEquationAutoDiffTests.jl") end +@testset "ForwardEulerHeatEquationTests" begin include("ForwardEulerHeatEquationTests.jl") end + end # module