58 integer,
parameter :: verb = 2
66 integer,
parameter :: im_type =
ionic_br 67 type(ionicmodel) :: im
75 real(RP),
parameter :: am = 500.0_rp
76 type(cardiomodel) :: cm
85 type(stimulation) :: stim
86 real(RP),
parameter :: stim_time = 3._rp
87 real(RP),
parameter :: stim_time_radius = 1.2_rp
88 real(RP),
parameter :: stim_space_radius = 0.15_rp
99 real(RP),
parameter :: t0 = 0.00_rp
100 real(RP),
parameter :: T = 30.0_rp
101 real(RP),
parameter :: dt = 0.05_rp
103 integer ,
parameter :: NL_meth =
ode_rl3 110 type(ode_solution):: sol
111 type(ode_problem) :: pb
112 type(ode_solver) :: slv
113 type(ode_output) :: out
121 integer,
parameter :: fe_type =
fe_p3_2d 140 integer,
parameter :: pc_type =
pc_jacobi 155 write(*,*)
"ode_monodomain_2d : start" 161 write(*,*)
"================================== MODEL DEFINITION" 165 cm = cardiomodel(vector_field_e_x, am,
le_guyader)
166 if (verb>1)
call print(cm)
170 im = ionicmodel(im_type)
171 if (verb>1)
call print(im)
175 stim = stimulation(f_c3, l=im%Ist*1.2_rp, t0=stim_time, &
176 & rt = stim_time_radius, rx = stim_space_radius)
182 write(*,*)
"================================== SPACE DISCRETISATION" 186 msh = mesh(trim(gmsh_dir)//
"square/square_1.msh",
'gmsh')
189 call set(x_h, fe_type)
194 call monodomain_assemble(m, s, cm, x_h, qd_type, qd_type)
198 cs = s_prefactor(sl_meth, dt)
199 call add(k, m, 1._rp, s, cs)
200 pc = precond(k, pc_type)
201 kry = krylov(
kry_cg, tol=1
e-8_rp, itmax=100)
208 write(*,*)
"================================== TIME DISCRETISATION" 213 & dof = x_h%nbDof, x=x_h%dofCoord, &
215 if (verb>1)
call print(pb)
220 & sl_meth=sl_meth, nl_meth=nl_meth)
221 if (verb>1)
call print(slv)
225 sol = ode_solution(slv, pb)
226 if (verb>1)
call print(sol)
230 out = ode_output(t0, t, im%N)
231 call set(out, verb=2)
232 call set(out, vtn_rec_prd = 1._rp, vtn_plot=.true.)
233 call set(out, act_type=
act_4)
234 call set(out, act_rec=.true., act_plot=.true.)
236 if (verb>1)
call print(out)
242 write(*,*)
"================================== NUMERICAL RESOLUTION" 245 call assemble(out, dt, x_h)
248 call initialcond(sol, pb, slv, t0, im%y0)
251 call solve(sol, slv, pb, t0, t, dt,
kinv, output=out)
253 write(*,*)
"monodomain_2d : end" 261 real(RP),
dimension(Na),
intent(out) :: a
262 real(RP),
dimension(N) ,
intent(out) :: b
263 real(RP),
dimension(3) ,
intent(in) :: x
264 real(RP) ,
intent(in) :: t
265 real(RP),
dimension(N) ,
intent(in) :: y
266 integer ,
intent(in) :: N, Na
272 i_app = stim%I_app(x, t)
276 call im%AB(a, b, i_app, y, n, na)
287 real(RP),
dimension(:),
intent(out) :: yy
288 real(RP),
dimension(:),
intent(in) :: xx
290 call matvecprod(yy, m, xx)
297 real(RP),
dimension(:),
intent(out) :: yy
298 real(RP),
dimension(:),
intent(in) :: xx
300 call matvecprod(yy, s, xx)
309 subroutine kinv(xx, ierr, bb)
310 real(RP),
dimension(:),
intent(inout) :: xx
311 logical ,
intent(out) :: ierr
312 real(RP),
dimension(:),
intent(in) :: bb
314 call solve(xx, kry, bb, k, pc)
subroutine stiffmat(yy, xx)
integer, parameter ode_bdfsbdf3
BDF / SBDF 3.
subroutine, public choral_init(verb)
Initialisation for the CHORAL library
TOP-LEVEL MODULE FOR THE LIBRARY CHORAL
subroutine pde_reaction(a, b, x, t, y, N, Na)
program ode_monodomain_2d
RESOLUTION OF: the monodomain model in cardiac-electrophysiology.
integer, parameter ionic_br
integer, parameter ode_slv_ms
multistep
subroutine kinv(x, bool, b)
Solver for K*x = b.
real(rp) function e(x, v1, v2)
integer, parameter pos_gmsh
integer, parameter pc_jacobi
Jacobi diagonal preconditioning.
subroutine massmat(yy, xx)
integer, parameter ode_pb_sl_nl
SemiLinear ODE coupled with a non-linear ODE system for with .
integer, parameter le_guyader
integer, parameter ode_rl3
Rush Larsen 3.
integer, parameter fe_p3_2d
integer, parameter act_4
bi-quadratic interpolation
integer, parameter quad_gauss_trg_12
integer, parameter kry_cg
CG linear solver.