34 REAL (KIND=8),
PRIVATE :: alpha=1.d0, beta=1.d0
280 FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
283 INTEGER,
INTENT(IN) :: m
284 REAL(KIND=8),
DIMENSION(H_mesh%np,6) :: vv
285 REAL(KIND=8),
DIMENSION(:),
POINTER :: r,
z
293 vv(:,1) = alpha*
z*(r**(m-1))*m
294 vv(:,2) = beta *
z*(r**(m-1))*m
295 vv(:,3) = beta *
z*(r**(m-1))*m
296 vv(:,4) =-alpha*
z*(r**(m-1))*m
297 vv(:,5) = alpha*(r**m)
298 vv(:,6) = beta *(r**m)
318 FUNCTION hexact(H_mesh, TYPE, rr, m, mu_H_field, t) RESULT(vv)
321 INTEGER ,
INTENT(IN) :: type
322 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
323 INTEGER ,
INTENT(IN) :: m
324 REAL(KIND=8),
INTENT(IN) ::
t
325 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
326 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
327 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
330 IF (maxval(mu_h_field) /= minval(mu_h_field))
THEN
331 CALL
error_petsc(
' BUG in condlim, mu not constant')
341 vv = alpha*
z*(r**(m-1))*m
342 ELSEIF (
TYPE == 2) then
343 vv = beta *
z*(r**(m-1))*m
344 ELSEIF (
TYPE ==3) then
345 vv = beta *
z*(r**(m-1))*m
346 ELSEIF (
TYPE == 4) then
347 vv =-alpha*
z*(r**(m-1))*m
348 ELSEIF (
TYPE == 5) then
350 ELSEIF (
TYPE == 6) then
353 vv = (vv/muh)*cos(
t)/m**3
362 FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
364 INTEGER ,
INTENT(IN) :: type
365 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
366 INTEGER ,
INTENT(IN) :: m
367 REAL(KIND=8),
INTENT(IN) :: mu_phi,
t
368 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
369 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
378 ELSEIF (
TYPE == 2) then
381 vv = (vv/mu_phi)*cos(
t)/m**3
386 FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
388 INTEGER ,
INTENT(IN) :: type
389 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
390 INTEGER ,
INTENT(IN) :: m
391 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
392 INTEGER ,
INTENT(IN) :: mesh_id
393 REAL(KIND=8),
DIMENSION(6),
OPTIONAL,
INTENT(IN) :: opt_b_ext
398 vv = -sigma*
eexact_gauss(type, rr, m, mu_phi, sigma, mu_h,
t)
403 IF (present(opt_b_ext)) r=opt_b_ext(1)
410 INTEGER,
INTENT(IN) :: type
411 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
412 INTEGER,
INTENT(IN) :: m
413 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
424 ELSEIF (
TYPE == 2) then
426 ELSEIF (
TYPE ==3) then
427 vv = alpha*(-1.d0/(m+2)*r**(m+1))
428 ELSEIF (
TYPE == 4) then
429 vv = beta *(-1.d0/(m+2)*r**(m+1))
430 ELSEIF (
TYPE == 5) then
432 ELSEIF (
TYPE == 6) then
439 r=mu_phi; r=sigma; r=mu_h
444 SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
445 list_mode, hn1, hn, phin1, phin)
448 REAL(KIND=8),
INTENT(OUT):: time
449 REAL(KIND=8),
INTENT(IN) :: dt
450 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
451 REAL(KIND=8),
INTENT(IN) :: mu_phi
452 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
453 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: hn, hn1
454 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: phin, phin1
459 DO i=1,
SIZE(list_mode)
460 hn1(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
461 IF (inputs%nb_dom_phi>0)
THEN
463 phin1(:,k,i) =
phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
471 DO i=1,
SIZE(list_mode)
472 hn(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
473 IF (inputs%nb_dom_phi>0)
THEN
475 phin(:,k,i) =
phiexact(k, phi_mesh%rr, list_mode(i), mu_phi, time)
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
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