From 0d38d3c6c96488a4acdefb7f58b7a231bd74d247 Mon Sep 17 00:00:00 2001 From: Santiago Badia Date: Mon, 8 Nov 2021 08:04:57 +1100 Subject: [PATCH] some renaming and updated readme --- README.md | 5 ++--- test/TransientFEsTests/AffineFEOperatorsTests.jl | 4 ++-- .../BoundaryHeatEquationTests.jl | 4 ++-- .../TransientFEsTests/ConstantFEOperatorsTests.jl | 4 ++-- test/TransientFEsTests/DGHeatEquationTests.jl | 4 ++-- .../ForwardEulerHeatEquationTests.jl | 4 ++-- .../HeatEquationAutoDiffTests.jl | 4 ++-- test/TransientFEsTests/HeatEquationTests.jl | 4 ++-- test/TransientFEsTests/HeatVectorEquationTests.jl | 8 ++++---- .../StokesEquationAutoDiffTests.jl | 4 ++-- test/TransientFEsTests/StokesEquationTests.jl | 4 ++-- .../Transient2ndOrderFEOperatorsTests.jl | 10 +++++----- .../TransientFEOperatorsTests.jl | 8 ++++---- test/TransientFEsTests/TransientFETests.jl | 15 +++++++-------- test/TransientFEsTests/VectorHeatEquationTests.jl | 4 ++-- 15 files changed, 42 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index f94512e..942874f 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,8 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) -solver = TransientFESolver(odes) -sol_t = solve(solver,op,uh0,t0,tF) +ode_solver = ThetaMethod(ls,dt,θ) +sol_t = solve(ode_solver,op,uh0,t0,tF) for (uh_tn, tn) in sol_t # Here we have the solution uh_tn at tn diff --git a/test/TransientFEsTests/AffineFEOperatorsTests.jl b/test/TransientFEsTests/AffineFEOperatorsTests.jl index 3d36ad8..b68078b 100644 --- a/test/TransientFEsTests/AffineFEOperatorsTests.jl +++ b/test/TransientFEsTests/AffineFEOperatorsTests.jl @@ -54,8 +54,8 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +ode_solver = ThetaMethod(ls,dt,θ) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w*w diff --git a/test/TransientFEsTests/BoundaryHeatEquationTests.jl b/test/TransientFEsTests/BoundaryHeatEquationTests.jl index 70f5749..b5bdc0c 100644 --- a/test/TransientFEsTests/BoundaryHeatEquationTests.jl +++ b/test/TransientFEsTests/BoundaryHeatEquationTests.jl @@ -70,9 +70,9 @@ uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() using Gridap.Algebra: NewtonRaphsonSolver # nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) # Juno.@enter Base.iterate(sol_t) diff --git a/test/TransientFEsTests/ConstantFEOperatorsTests.jl b/test/TransientFEsTests/ConstantFEOperatorsTests.jl index 8ecaf4f..d1a852a 100644 --- a/test/TransientFEsTests/ConstantFEOperatorsTests.jl +++ b/test/TransientFEsTests/ConstantFEOperatorsTests.jl @@ -54,8 +54,8 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +ode_solver = ThetaMethod(ls,dt,θ) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w*w diff --git a/test/TransientFEsTests/DGHeatEquationTests.jl b/test/TransientFEsTests/DGHeatEquationTests.jl index 05eb2c5..05d0b65 100644 --- a/test/TransientFEsTests/DGHeatEquationTests.jl +++ b/test/TransientFEsTests/DGHeatEquationTests.jl @@ -69,9 +69,9 @@ uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() using Gridap.Algebra: NewtonRaphsonSolver -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w*w diff --git a/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl b/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl index e82fb1a..2de154d 100644 --- a/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl +++ b/test/TransientFEsTests/ForwardEulerHeatEquationTests.jl @@ -60,9 +60,9 @@ uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() using Gridap.Algebra: NewtonRaphsonSolver nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w*w diff --git a/test/TransientFEsTests/HeatEquationAutoDiffTests.jl b/test/TransientFEsTests/HeatEquationAutoDiffTests.jl index b4d5313..9fb494c 100644 --- a/test/TransientFEsTests/HeatEquationAutoDiffTests.jl +++ b/test/TransientFEsTests/HeatEquationAutoDiffTests.jl @@ -71,9 +71,9 @@ uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() using Gridap.Algebra: NewtonRaphsonSolver nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) # Juno.@enter Base.iterate(sol_t) diff --git a/test/TransientFEsTests/HeatEquationTests.jl b/test/TransientFEsTests/HeatEquationTests.jl index 992c08a..68d5319 100644 --- a/test/TransientFEsTests/HeatEquationTests.jl +++ b/test/TransientFEsTests/HeatEquationTests.jl @@ -56,9 +56,9 @@ uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() using Gridap.Algebra: NewtonRaphsonSolver nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) # Juno.@enter Base.iterate(sol_t) diff --git a/test/TransientFEsTests/HeatVectorEquationTests.jl b/test/TransientFEsTests/HeatVectorEquationTests.jl index 4262c34..58c213a 100644 --- a/test/TransientFEsTests/HeatVectorEquationTests.jl +++ b/test/TransientFEsTests/HeatVectorEquationTests.jl @@ -57,9 +57,9 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w⋅w @@ -89,14 +89,14 @@ ode_cache = allocate_cache(odeop) vθ = similar(u0) nl_cache = nothing -odes.θ == 0.0 ? dtθ = dt : dtθ = dt*odes.θ +ode_solver.θ == 0.0 ? dtθ = dt : dtθ = dt*ode_solver.θ tθ = t0+dtθ ode_cache = update_cache!(ode_cache,odeop,tθ) using GridapODEs.ODETools: ThetaMethodNonlinearOperator nlop = ThetaMethodNonlinearOperator(odeop,tθ,dtθ,u0,ode_cache,vθ) -nl_cache = solve!(uf,odes.nls,nlop,nl_cache) +nl_cache = solve!(uf,ode_solver.nls,nlop,nl_cache) uf K = nl_cache.A diff --git a/test/TransientFEsTests/StokesEquationAutoDiffTests.jl b/test/TransientFEsTests/StokesEquationAutoDiffTests.jl index 640f039..487d6d6 100644 --- a/test/TransientFEsTests/StokesEquationAutoDiffTests.jl +++ b/test/TransientFEsTests/StokesEquationAutoDiffTests.jl @@ -99,9 +99,9 @@ tF = 1.0 dt = 0.1 ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,xh0,t0,tF) +sol_t = solve(ode_solver,op,xh0,t0,tF) l2(w) = w⋅w diff --git a/test/TransientFEsTests/StokesEquationTests.jl b/test/TransientFEsTests/StokesEquationTests.jl index ddba6ea..b731e71 100644 --- a/test/TransientFEsTests/StokesEquationTests.jl +++ b/test/TransientFEsTests/StokesEquationTests.jl @@ -84,9 +84,9 @@ tF = 1.0 dt = 0.1 ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,xh0,t0,tF) +sol_t = solve(ode_solver,op,xh0,t0,tF) l2(w) = w⋅w diff --git a/test/TransientFEsTests/Transient2ndOrderFEOperatorsTests.jl b/test/TransientFEsTests/Transient2ndOrderFEOperatorsTests.jl index 914e478..6d3e507 100644 --- a/test/TransientFEsTests/Transient2ndOrderFEOperatorsTests.jl +++ b/test/TransientFEsTests/Transient2ndOrderFEOperatorsTests.jl @@ -68,12 +68,12 @@ vh0_const = interpolate_everywhere(v_const(0.0),U0) ah0_const = interpolate_everywhere(a_const(0.0),U0) ls = LUSolver() -odes = Newmark(ls,dt,γ,β) +ode_solver = Newmark(ls,dt,γ,β) -sol_t = solve(odes,op,(uh0,vh0,ah0),t0,tF) -sol_affine_t = solve(odes,op_affine,(uh0,vh0,ah0),t0,tF) -sol_const_t = solve(odes,op_const,(uh0,vh0_const,ah0_const),t0,tF) -sol_const_mat_t = solve(odes,op_const_mat,(uh0,vh0,ah0),t0,tF) +sol_t = solve(ode_solver,op,(uh0,vh0,ah0),t0,tF) +sol_affine_t = solve(ode_solver,op_affine,(uh0,vh0,ah0),t0,tF) +sol_const_t = solve(ode_solver,op_const,(uh0,vh0_const,ah0_const),t0,tF) +sol_const_mat_t = solve(ode_solver,op_const_mat,(uh0,vh0,ah0),t0,tF) l2(w) = w*w diff --git a/test/TransientFEsTests/TransientFEOperatorsTests.jl b/test/TransientFEsTests/TransientFEOperatorsTests.jl index 062aa18..9483657 100644 --- a/test/TransientFEsTests/TransientFEOperatorsTests.jl +++ b/test/TransientFEsTests/TransientFEOperatorsTests.jl @@ -60,9 +60,9 @@ U0 = U(0.0) uh0 = interpolate_everywhere(u(0.0),U0) ls = LUSolver() -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) l2(w) = w*w @@ -91,14 +91,14 @@ nl_cache = nothing # tf = t0+dt -odes.θ == 0.0 ? dtθ = dt : dtθ = dt*odes.θ +ode_solver.θ == 0.0 ? dtθ = dt : dtθ = dt*ode_solver.θ tθ = t0+dtθ ode_cache = update_cache!(ode_cache,odeop,tθ) using GridapODEs.ODETools: ThetaMethodNonlinearOperator nlop = ThetaMethodNonlinearOperator(odeop,tθ,dtθ,u0,ode_cache,vθ) -nl_cache = solve!(uf,odes.nls,nlop,nl_cache) +nl_cache = solve!(uf,ode_solver.nls,nlop,nl_cache) K = nl_cache.A h = nl_cache.b diff --git a/test/TransientFEsTests/TransientFETests.jl b/test/TransientFEsTests/TransientFETests.jl index 779d03a..fb1a66e 100644 --- a/test/TransientFEsTests/TransientFETests.jl +++ b/test/TransientFEsTests/TransientFETests.jl @@ -112,16 +112,15 @@ tol = 1.0 maxiters = 20 using Gridap.Algebra: NewtonRaphsonSolver nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(nls,dt,1.0) -@test test_transient_fe_solver(odes,op,uh0,t0,tF) +ode_solver = ThetaMethod(nls,dt,1.0) +@test test_transient_fe_solver(ode_solver,op,uh0,t0,tF) residual!(r,op,0.1,(uh,uh),cache) jacobian!(J,op,1.0,(uh,uh10),1,1.0,cache) jacobian!(J,op,1.0,(uh,uh10),2,10.0,cache) u0 = get_free_dof_values(uh0) -odes -solver = odes +solver = ode_solver t0 = 0.0 ode_cache = allocate_cache(odeop) cache = nothing @@ -194,7 +193,7 @@ Gridap.Algebra.nlsolve(df,x;linsolve=linsolve!,nls.kwargs...) using Gridap.FESpaces: get_algebraic_operator odeop = get_algebraic_operator(op) -sol_ode_t = solve(odes,odeop,u0,t0,tF) +sol_ode_t = solve(ode_solver,odeop,u0,t0,tF) test_ode_solution(sol_ode_t) _t_n = t0 @@ -205,8 +204,8 @@ for (u_n, t_n) in sol_ode_t @test all(u_n .≈ t_n) end -odes = ThetaMethod(nls,dt,θ) -sol_ode_t = solve(odes,odeop,u0,t0,tF) +ode_solver = ThetaMethod(nls,dt,θ) +sol_ode_t = solve(ode_solver,odeop,u0,t0,tF) test_ode_solution(sol_ode_t) _t_n = t0 un, tn = Base.iterate(sol_ode_t) @@ -217,7 +216,7 @@ for (u_n, t_n) in sol_ode_t @test all(u_n .≈ t_n) end -sol_t = solve(odes,op,uh0,t0,tF) +sol_t = solve(ode_solver,op,uh0,t0,tF) @test test_transient_fe_solution(sol_t) _t_n = 0.0 diff --git a/test/TransientFEsTests/VectorHeatEquationTests.jl b/test/TransientFEsTests/VectorHeatEquationTests.jl index 9bf2892..7dc2660 100644 --- a/test/TransientFEsTests/VectorHeatEquationTests.jl +++ b/test/TransientFEsTests/VectorHeatEquationTests.jl @@ -67,9 +67,9 @@ xh0 = interpolate_everywhere([uh0,uh0],X0) ls = LUSolver() # using Gridap.Algebra: NewtonRaphsonSolver # nls = NLSolver(ls;show_trace=true,method=:newton) #linesearch=BackTracking()) -odes = ThetaMethod(ls,dt,θ) +ode_solver = ThetaMethod(ls,dt,θ) -sol_t = solve(odes,op,xh0,t0,tF) +sol_t = solve(ode_solver,op,xh0,t0,tF) l2(w) = w⋅w