46 integer,
intent(in) :: method
61 integer,
intent(out) :: n_FY, n_Y
62 integer,
intent(in) :: method
73 call quit(
"ode_NL_DC_mod: memSize_ode_NL_DC: uncorrect method")
85 integer ,
intent(in) :: method
89 if (pb%Na/=0)
call quit(
"ode_NL_DC_mod: create_ode_NL_DC:& 101 integer ,
intent(in) :: meth
102 real(RP) ,
intent(in) :: t0, dt
112 call quit(
"ode_NL_DC_mod: init_NL_DC: wrong method")
122 real(RP) ,
intent(in) :: t0
124 real(RP),
dimension(0) :: ay
130 associate( y=>sol%Y, by=>sol%BY, x=>pb%X)
135 y(:,2,ii) = y(:,1,ii)
137 call pb%AB( ay, by(:,1,ii), &
138 & x(:,ii), t0, y(:,1,ii), n, 0 )
148 type(ode_solution),
intent(inout) :: sol
149 type(ode_problem) ,
intent(in) :: pb
150 real(RP) ,
intent(in) :: t0, dt
153 real(RP),
dimension(0) :: ay
157 associate( y=>sol%Y, fy=>sol%BY, x=>pb%X)
163 y(:,2,ii) = y(:,1,ii)
168 call pb%AB( ay, fy(:,1,ii), &
169 & x(:,ii), t0, y(:,2,ii), n, 0 )
172 y(:,5,ii) = y(:,2,ii) + dt*fy(:,1,ii)
175 call pb%AB( ay, fy(:,2,ii), &
176 & x(:,ii), t0+dt, y(:,5,ii), n, 0 )
179 fy(:,3,ii) = fy(:,2,ii)
182 y(:,6,ii) = 0.5_rp*(fy(:,2,ii)-fy(:,1,ii))
194 & meth, out, check_overflow)
195 type(ode_solution),
intent(inout) :: sol
196 type(ode_problem) ,
intent(in) :: pb
197 real(RP) ,
intent(in) :: t0, T, dt
198 integer ,
intent(in) :: meth
199 procedure(ode_output_proc) :: out
200 logical ,
intent(in) :: check_overflow
204 logical :: exit_comp, b
207 &
"ode_NL_DC_mod: solve" 210 & name_ode_method(meth)
213 if (.NOT.b)
call quit(
"ode_NL_DC_mod: solve_ode_NL_DC:& 216 if (pb%Na/=0)
call quit(
"ode_NL_DC_mod: solve_ode_NL_DC:& 217 & Na muste be ezero")
225 ns = int( (t-t0) / dt)
232 tn = t0 +
re(jj-1)*dt
235 call out(tn, sol, exit_comp)
238 &
"ode_NL_DC_mod: solve& 239 & time = ", tn,
': EXIT_COMPp' 260 subroutine nl_dc_2(sol, dt, t, pb)
261 type(ode_solution),
intent(inout) :: sol
262 real(RP) ,
intent(in) :: dt, t
263 type(ode_problem) ,
intent(in) :: pb
266 real(RP),
dimension(pb%N) :: y0, F0, y1, F1
267 real(RP),
dimension(0) :: ay
271 associate( y=>sol%Y, fy=>sol%BY, x=>pb%X)
278 y0 = y(:,2,ii) + dt*fy(:,1,ii)
281 call pb%AB(ay, f0, x(:,ii), t+dt, y0, n, 0 )
284 y1 = y0 + dt*y(:,3,ii)
285 call pb%AB(ay, f1, x(:,ii), t+dt, y1, n, 0 )
288 y1 = y(:,3,ii) + f1 - 0.5_rp*( f0 + fy(:,1,ii) )
291 y(:,1,ii) = y0 + dt*y1
308 subroutine nl_dc_3(sol, dt, t, pb)
309 type(ode_solution),
intent(inout) :: sol
310 real(RP) ,
intent(in) :: dt, t
311 type(ode_problem) ,
intent(in) :: pb
313 real(RP),
dimension(pb%N) :: y0, y1, F0, F1
314 real(RP),
dimension(pb%N) :: F2, y2
315 real(RP),
dimension(0) :: ay
316 real(RP),
parameter :: C1_6 = 1.0_rp/6.0_rp
318 real(RP) :: t1, t2, dt_inv
325 associate( y=>sol%Y, fy=>sol%BY, x=>pb%X)
335 y0 = y(:,5,ii) + dt*fy(:,2,ii)
338 call pb%AB(ay, f0, x(:,ii), t2, y0, n, 0 )
341 y1 = y0 + dt*y(:,6,ii)
342 call pb%AB(ay, f1, x(:,ii), t2, y1, n, 0 )
345 y1 = y(:,6,ii) + f1 - (f0 + fy(:,2,ii))*0.5_rp
351 y2 = y(:,5,ii) + y(:,6,ii)*dt + y(:,4,ii)*dt**2
352 call pb%AB(ay, f2, x(:,ii), t1, y2, n, 0 )
357 y2 = f0 - 2.0_rp*fy(:,2,ii) + fy(:,1,ii)
362 y2 = y2 - ( y1 - 2.0_rp*y(:,6,ii) + y(:,3,ii) ) * 0.5_rp
366 y2 = y2 + f2 - fy(:,3,ii)
369 y2 = y(:,4,ii) + y2 * dt_inv
372 y(:,1,ii) = y(:,5,ii) + dt*y(:,6,ii) + dt**2*y2
373 y(:,2,ii) = y(:,5,ii)
374 y(:,3,ii) = y(:,6,ii)
379 fy(:,1,ii) = fy(:,2,ii)
integer, parameter ode_dc_3
Deferred corrections 3.
Type ode_solution: data structure to solve ODE/PDE problems.
subroutine init_dc_3(sol, pb, t0, dt)
DERIVED TYPE ode_problem: definition of ODE/PDE problems
subroutine memsize_ode_nl_dc(n_Y, n_FY, method)
required sizes to allocate memory
logical function, public check_ode_method_nl_dc(method)
is 'method' a DC method for NL problems ?
subroutine nl_dc_2(sol, dt, t, pb)
DC order 2.
subroutine init_nl_dc(sol, pb, meth, t0, dt)
integer, parameter ode_dc_2
Deferred corrections 2.
conversion integers or rational to real
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
OPENMP OPERATIONS ON 1-DIMENSIONAL REAL ARRAYS
subroutine, public solve_ode_nl_dc(sol, pb, t0, T, dt, meth, out, check_overflow)
solve : DC with constant time step
subroutine nl_dc_3(sol, dt, t, pb)
DC order 3.
DERIVED TYPE ode_solution: data straucture to solve ODEs
ALGEBRAIC OPERATIONS ON SETS
BOTTOM LEVEL MODULE FOR ODEs
integer choral_verb
Verbosity level.
x = x + b*y // OR // z = x + b*y
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
Type ode_problem: definition of ODE/PDE problems.
DEFERRED CORRECTION SOLVERS FOR NON LINEAR ODEs
DERIVED TYPE krylov: for the resolution of linear systems
subroutine init_dc_2(sol, pb, t0)
subroutine, public create_ode_nl_dc_sol(sol, pb, method)
Create the solution data structure.