276 FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
279 INTEGER,
INTENT(IN) :: m
280 REAL(KIND=8),
DIMENSION(H_mesh%np,6) :: vv
305 FUNCTION hexact(H_mesh, TYPE, rr, m, mu_H_field, t) RESULT(vv)
308 INTEGER ,
INTENT(IN) :: type
309 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
310 INTEGER ,
INTENT(IN) :: m
311 REAL(KIND=8),
INTENT(IN) ::
t
312 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
313 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
314 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
315 REAL(KIND=8) :: aa=0.5d0, bb=1.d0, mu, mu0=1.d0, &
316 capa,capb, capc, capd
317 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) ::
theta, rho
324 IF (
SIZE(rr,2)==0)
RETURN
325 IF (
SIZE(rr,2)/=h_mesh%np)
THEN
331 mu = maxval(mu_h_field)
335 rho = sqrt(r**2+
z**2)
337 capa = -9*mu*mu0/((2*mu+mu0)*(mu+2*mu0) - 2*(mu-mu0)**2*(aa/bb)**3)
338 capd = (2*mu+mu0)*(mu-mu0)*((bb/aa)**3-1.d0)/((2*mu+mu0)*(mu+2*mu0) - 2*(mu-mu0)**2*(aa/bb)**3)
339 capc = (1.d0 - mu0/mu)*capa/3
340 capb = (2.d0 + mu0/mu)*capa/3
343 IF (rho(n) .LE. aa)
THEN
346 ELSE IF(type==5)
THEN
353 vv(n) = 3*capc*(aa/rho(n))**3*cos(
theta(n))*sin(
theta(n))
354 ELSE IF(type==5)
THEN
355 vv(n) = -capb + capc*(aa/rho(n))**3*(3.d0*cos(
theta(n))**2-1.d0)
362 DO ms = 1, h_mesh%mes
363 DO ns = 1, h_mesh%gauss%n_ws
364 n = h_mesh%jjs(ns,ms)
365 IF (h_mesh%i_d(h_mesh%neighs(ms)) == 1)
THEN
368 ELSE IF(type==5)
THEN
375 vv(n) = 3*capc*(aa/rho(n))**3*cos(
theta(n))*sin(
theta(n))
376 ELSE IF(type==5)
THEN
377 vv(n) = -capb + capc*(aa/rho(n))**3*(3.d0*cos(
theta(n))**2-1.d0)
392 FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
394 INTEGER ,
INTENT(IN) :: type
395 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
396 INTEGER ,
INTENT(IN) :: m
397 REAL(KIND=8),
INTENT(IN) :: mu_phi,
t
398 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
399 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z,
theta, rho
401 REAL(KIND=8) :: a=0.5d0, b=1.d0, mu, mu0=1.d0, &
410 mu = maxval(inputs%mu_H)
413 rho = sqrt(r**2+
z**2)
416 IF (rho(n).LE.1.d-10)
THEN
419 theta(n) = atan2(r(n),
z(n))
423 capa = -9*mu*mu0/((2*mu+mu0)*(mu+2*mu0) - 2*(mu-mu0)**2*(a/b)**3)
424 capd = (2*mu+mu0)*(mu-mu0)*((b/a)**3-1.d0)/((2*mu+mu0)*(mu+2*mu0) - 2*(mu-mu0)**2*(a/b)**3)
428 IF (type==1 .AND. rho(n).LE. (a+1.d-1))
THEN
429 vv(n) = -capa*rho(n)*cos(
theta(n))
430 ELSE IF (type==1 .AND. rho(n) .GE. (b-1.d-1))
THEN
431 vv(n) = (rho(n)*cos(
theta(n)) - capd*cos(
theta(n))*a**3/rho(n)**2)
444 FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
446 INTEGER ,
INTENT(IN) :: type
447 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
448 INTEGER ,
INTENT(IN) :: m
449 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
450 INTEGER ,
INTENT(IN) :: mesh_id
451 REAL(KIND=8),
DIMENSION(6),
OPTIONAL,
INTENT(IN) :: opt_b_ext
460 r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=
t; n=type; n=m; n=mesh_id
461 IF (present(opt_b_ext)) r=opt_b_ext(1)
468 INTEGER,
INTENT(IN) :: type
469 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
470 INTEGER,
INTENT(IN) :: m
471 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
480 r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=
t; n=type; n=m
485 SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
486 list_mode, hn1, hn, phin1, phin)
489 REAL(KIND=8),
INTENT(OUT):: time
490 REAL(KIND=8),
INTENT(IN) :: dt
491 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
492 REAL(KIND=8),
INTENT(IN) :: mu_phi
493 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
494 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: hn, hn1
495 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: phin, phin1
507 r=h_mesh%rr(1,1); r=phi_mesh%rr(1,1); r=dt; r=mu_h_field(1); r=mu_phi; n=
SIZE(list_mode)
section doc_intro_frame_work_num_app Numerical approximation subsection doc_intro_fram_work_num_app_Fourier_FEM Fourier Finite element representation The SFEMaNS code uses a hybrid Fourier Finite element formulation The Fourier decomposition allows to approximate the problem’s solutions for each Fourier mode modulo nonlinear terms that are made explicit The variables are then approximated on a meridian section of the domain with a finite element method The numerical approximation of a function f $f f is written in the following generic t
section doc_intro_frame_work_num_app Numerical approximation subsection doc_intro_fram_work_num_app_Fourier_FEM Fourier Finite element representation The SFEMaNS code uses a hybrid Fourier Finite element formulation The Fourier decomposition allows to approximate the problem’s solutions for each Fourier mode modulo nonlinear terms that are made explicit The variables are then approximated on a meridian section of the domain with a finite element method The numerical approximation of a function f $f f is written in the following generic theta
subroutine, public init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, list_mode, Hn1, Hn, phin1, phin)
real(kind=8) function, public jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext)
real(kind=8) function, dimension(h_mesh%np, 6), public vexact(m, H_mesh)
real(kind=8) function, dimension(size(rr, 2)), public phiexact(TYPE, rr, m, mu_phi, t)
real(kind=8) function, public eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t)
subroutine error_petsc(string)
real(kind=8) function, dimension(size(rr, 2)), public hexact(H_mesh, TYPE, rr, m, mu_H_field, t)
section doc_intro_frame_work_num_app Numerical approximation subsection doc_intro_fram_work_num_app_Fourier_FEM Fourier Finite element representation The SFEMaNS code uses a hybrid Fourier Finite element formulation The Fourier decomposition allows to approximate the problem’s solutions for each Fourier mode modulo nonlinear terms that are made explicit The variables are then approximated on a meridian section of the domain with a finite element method The numerical approximation of a function f $f f is written in the following generic z