33 REAL (KIND=8),
PRIVATE :: alpha=1.d0, beta=1.d0
278 FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
281 INTEGER,
INTENT(IN) :: m
282 REAL(KIND=8),
DIMENSION(H_mesh%np,6) :: vv
283 REAL(KIND=8),
DIMENSION(:),
POINTER :: r,
z
291 vv(:,1) = alpha*
z*(r**(m-1))*m
292 vv(:,2) = beta *
z*(r**(m-1))*m
293 vv(:,3) = beta *
z*(r**(m-1))*m
294 vv(:,4) =-alpha*
z*(r**(m-1))*m
295 vv(:,5) = alpha*(r**m)
296 vv(:,6) = beta *(r**m)
315 FUNCTION hexact(H_mesh, TYPE, rr, m, mu_H_field, t) RESULT(vv)
318 INTEGER ,
INTENT(IN) :: type
319 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
320 INTEGER ,
INTENT(IN) :: m
321 REAL(KIND=8),
INTENT(IN) ::
t
322 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
323 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
324 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
327 IF (maxval(mu_h_field) /= minval(mu_h_field))
THEN
328 CALL
error_petsc(
' BUG in condlim, mu not constant')
338 vv = alpha*
z*(r**(m-1))*m
339 ELSEIF (
TYPE == 2) then
340 vv = beta *
z*(r**(m-1))*m
341 ELSEIF (
TYPE ==3) then
342 vv = beta *
z*(r**(m-1))*m
343 ELSEIF (
TYPE == 4) then
344 vv =-alpha*
z*(r**(m-1))*m
345 ELSEIF (
TYPE == 5) then
347 ELSEIF (
TYPE == 6) then
350 vv = (vv/muh)*cos(
t)/m**3
359 FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
361 INTEGER ,
INTENT(IN) :: type
362 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
363 INTEGER ,
INTENT(IN) :: m
364 REAL(KIND=8),
INTENT(IN) :: mu_phi,
t
365 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
366 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
374 ELSEIF (
TYPE == 2) then
377 vv = (vv/mu_phi)*cos(
t)/m**3
382 FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
384 INTEGER ,
INTENT(IN) :: type
385 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
386 INTEGER ,
INTENT(IN) :: m
387 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
388 INTEGER ,
INTENT(IN) :: mesh_id
389 REAL(KIND=8),
DIMENSION(6),
OPTIONAL,
INTENT(IN) :: opt_b_ext
394 vv = -sigma*
eexact_gauss(type, rr, m, mu_phi, sigma, mu_h,
t)
399 IF (present(opt_b_ext)) x=opt_b_ext(1)
406 INTEGER,
INTENT(IN) :: type
407 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
408 INTEGER,
INTENT(IN) :: m
409 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
420 ELSEIF (
TYPE == 2) then
422 ELSEIF (
TYPE ==3) then
423 vv = alpha*(-1.d0/(m+2)*r**(m+1))
424 ELSEIF (
TYPE == 4) then
425 vv = beta *(-1.d0/(m+2)*r**(m+1))
426 ELSEIF (
TYPE == 5) then
428 ELSEIF (
TYPE == 6) then
435 r=mu_phi; r=sigma; r=mu_h
440 SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
441 list_mode, hn1, hn, phin1, phin)
444 REAL(KIND=8),
INTENT(OUT):: time
445 REAL(KIND=8),
INTENT(IN) :: dt
446 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
447 REAL(KIND=8),
INTENT(IN) :: mu_phi
448 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
449 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: hn, hn1
450 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: phin, phin1
455 DO i=1,
SIZE(list_mode)
456 hn1(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
457 IF (inputs%nb_dom_phi>0)
THEN
459 phin1(:,k,i) =
phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
467 DO i=1,
SIZE(list_mode)
468 hn(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
469 IF (inputs%nb_dom_phi>0)
THEN
471 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