34 REAL (KIND=8),
PRIVATE :: alpha=1.d0, beta=1.d0
279 FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
282 INTEGER,
INTENT(IN) :: m
283 REAL(KIND=8),
DIMENSION(H_mesh%np,6) :: vv
284 REAL(KIND=8),
DIMENSION(:),
POINTER :: r,
z
292 vv(:,1) = alpha*
z*(r**(m-1))*m
293 vv(:,2) = beta *
z*(r**(m-1))*m
294 vv(:,3) = beta *
z*(r**(m-1))*m
295 vv(:,4) =-alpha*
z*(r**(m-1))*m
296 vv(:,5) = alpha*(r**m)
297 vv(:,6) = beta *(r**m)
316 FUNCTION hexact(H_mesh,TYPE, rr, m, mu_H_field, t) RESULT(vv)
319 INTEGER ,
INTENT(IN) :: type
320 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
321 INTEGER ,
INTENT(IN) :: m
322 REAL(KIND=8),
INTENT(IN) ::
t
323 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
324 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
325 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
328 IF (maxval(mu_h_field) /= minval(mu_h_field))
THEN
329 CALL
error_petsc(
' BUG in condlim, mu not constant')
339 vv = alpha*
z*(r**(m-1))*m
340 ELSEIF (
TYPE == 2) then
341 vv = beta *
z*(r**(m-1))*m
342 ELSEIF (
TYPE ==3) then
343 vv = beta *
z*(r**(m-1))*m
344 ELSEIF (
TYPE == 4) then
345 vv =-alpha*
z*(r**(m-1))*m
346 ELSEIF (
TYPE == 5) then
348 ELSEIF (
TYPE == 6) then
351 vv = (vv/muh)*cos(
t)/m**3
360 FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
362 INTEGER ,
INTENT(IN) :: type
363 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
364 INTEGER ,
INTENT(IN) :: m
365 REAL(KIND=8),
INTENT(IN) :: mu_phi,
t
366 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
371 CALL
error_petsc(
'Phiexact: should not be called for this test')
375 n=type; n=m; r=rr(1,1); r=mu_phi; r=
t
380 FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
382 INTEGER ,
INTENT(IN) :: type
383 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
384 INTEGER ,
INTENT(IN) :: m
385 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
386 INTEGER ,
INTENT(IN) :: mesh_id
387 REAL(KIND=8),
DIMENSION(6),
OPTIONAL,
INTENT(IN) :: opt_b_ext
392 vv = -sigma*
eexact_gauss(type, rr, m, mu_phi, sigma, mu_h,
t)
397 IF (present(opt_b_ext)) r=opt_b_ext(1)
404 INTEGER,
INTENT(IN) :: type
405 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
406 INTEGER,
INTENT(IN) :: m
407 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
418 ELSEIF (
TYPE == 2) then
420 ELSEIF (
TYPE ==3) then
421 vv = alpha*(-1.d0/(m+2)*r**(m+1))
422 ELSEIF (
TYPE == 4) then
423 vv = beta *(-1.d0/(m+2)*r**(m+1))
424 ELSEIF (
TYPE == 5) then
426 ELSEIF (
TYPE == 6) then
433 r=mu_phi; r=sigma; r=mu_h
438 SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
439 list_mode, hn1, hn, phin1, phin)
442 REAL(KIND=8),
INTENT(OUT):: time
443 REAL(KIND=8),
INTENT(IN) :: dt
444 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
445 REAL(KIND=8),
INTENT(IN) :: mu_phi
446 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
447 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: hn, hn1
448 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: phin, phin1
453 DO i=1,
SIZE(list_mode)
454 hn1(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
455 IF (inputs%nb_dom_phi>0)
THEN
457 phin1(:,k,i) =
phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
465 DO i=1,
SIZE(list_mode)
466 hn(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
467 IF (inputs%nb_dom_phi>0)
THEN
469 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