33 REAL(KIND=8) :: pi=ACOS(-1.d0)
41 un_m1, un, pn_m1, pn, phin_m1, phin)
44 REAL(KIND=8),
INTENT(OUT):: time
45 REAL(KIND=8),
INTENT(IN) :: dt
46 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
47 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: un_m1, un
48 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: pn_m1, pn, phin_m1, phin
50 REAL(KIND=8),
DIMENSION(mesh_c%np) :: pn_m2
53 DO i= 1,
SIZE(list_mode)
57 un_m1(:,j,i) =
vv_exact(j,mesh_f%rr,mode,time-dt)
58 un(:,j,i) =
vv_exact(j,mesh_f%rr,mode,time)
62 pn_m2(:) =
pp_exact(j,mesh_c%rr,mode,time-2*dt)
63 pn_m1(:,j,i) =
pp_exact(j,mesh_c%rr,mode,time-dt)
64 pn(:,j,i) =
pp_exact(j,mesh_c%rr,mode,time)
65 phin_m1(:,j,i) = pn_m1(:,j,i) - pn_m2(:)
66 phin(:,j,i) = pn(:,j,i) - pn_m1(:,j,i)
120 INTEGER ,
INTENT(IN) :: type
121 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
122 INTEGER ,
INTENT(IN) :: mode, i
123 REAL(KIND=8),
INTENT(IN) :: time
124 REAL(KIND=8),
INTENT(IN) :: re
125 CHARACTER(LEN=2),
INTENT(IN) :: ty
126 REAL(KIND=8),
DIMENSION(:,:,:),
OPTIONAL,
INTENT(IN) :: opt_density
127 REAL(KIND=8),
DIMENSION(:,:,:),
OPTIONAL,
INTENT(IN) :: opt_tempn
128 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
131 CHARACTER(LEN=2) :: np
133 IF (present(opt_density)) CALL
error_petsc(
'density should not be present for test 13')
134 IF (present(opt_tempn)) CALL
error_petsc(
'temperature should not be present for test 13')
140 n=type; n=
SIZE(rr,1); n=mode; n=i; r=time; r=re; np=ty
174 INTEGER ,
INTENT(IN) :: type
175 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
176 INTEGER,
INTENT(IN) :: m
177 REAL(KIND=8),
INTENT(IN) ::
t
178 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
179 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: r,
z
192 ELSE IF (type==3)
THEN
193 vv = (r-0.5)*r*sin(2*pi*
z)
221 INTEGER ,
INTENT(IN) :: type
222 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
223 INTEGER ,
INTENT(IN) :: m
224 REAL(KIND=8),
INTENT(IN) ::
t
225 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
233 n=type; n=
SIZE(rr,1); n=m; r=
t
293 INTEGER ,
INTENT(IN) :: type, n_start
294 INTEGER,
INTENT(IN) :: mode
295 REAL(KIND=8),
INTENT(IN) ::
t
296 REAL(KIND=8),
DIMENSION(H_Mesh%np) :: vv
304 n=h_mesh%np; r=
t; n=type; n=mode; n=n_start
337 FUNCTION hexact(H_mesh,TYPE, rr, m, mu_H_field, t) RESULT(vv)
340 INTEGER ,
INTENT(IN) :: type
341 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
342 INTEGER ,
INTENT(IN) :: m
343 REAL(KIND=8),
INTENT(IN) ::
t
344 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
345 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
350 IF (type==5 .OR. type==6)
THEN
351 vv = rr(1,:)*(rr(1,:)-0.5)
358 ELSE IF (type==5)
THEN
367 n=h_mesh%np; r=mu_h_field(1); r=
t
372 FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
374 INTEGER ,
INTENT(IN) :: type
375 REAL(KIND=8),
DIMENSION(:,:),
INTENT(IN) :: rr
376 INTEGER ,
INTENT(IN) :: m
377 REAL(KIND=8),
INTENT(IN) :: mu_phi,
t
378 REAL(KIND=8),
DIMENSION(SIZE(rr,2)) :: vv
383 CALL
error_petsc(
'Phiexact: should not be called for this test')
387 n=type; n=
SIZE(rr,1); n=m; r=mu_phi; r=
t
392 FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) 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, sigma, mu_h,
t
398 INTEGER ,
INTENT(IN) :: mesh_id
399 REAL(KIND=8),
DIMENSION(6),
OPTIONAL,
INTENT(IN) :: opt_b_ext
408 r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=
t; n=type; n=m; n=mesh_id
409 IF (present(opt_b_ext)) r=opt_b_ext(1)
416 INTEGER,
INTENT(IN) :: type
417 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: rr
418 INTEGER,
INTENT(IN) :: m
419 REAL(KIND=8),
INTENT(IN) :: mu_phi, sigma, mu_h,
t
428 r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=
t; n=type; n=m
433 SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
434 list_mode, hn1, hn, phin1, phin)
437 REAL(KIND=8),
INTENT(OUT):: time
438 REAL(KIND=8),
INTENT(IN) :: dt
439 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: mu_h_field
440 REAL(KIND=8),
INTENT(IN) :: mu_phi
441 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
442 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: hn, hn1
443 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT):: phin, phin1
448 DO i=1,
SIZE(list_mode)
449 hn1(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
450 IF (inputs%nb_dom_phi>0)
THEN
452 phin1(:,k,i) =
phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
460 DO i=1,
SIZE(list_mode)
461 hn(:,k,i) =
hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
462 IF (inputs%nb_dom_phi>0)
THEN
464 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
real(kind=8) function, dimension(size(rr, 2)), public source_in_ns_momentum(TYPE, rr, mode, i, time, Re, ty, opt_density, opt_tempn)
real(kind=8) function, dimension(size(rr, 2)), public pp_exact(TYPE, rr, m, t)
real(kind=8) function, dimension(h_mesh%np), public extension_velocity(TYPE, H_mesh, mode, t, n_start)
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(size(rr, 2)), public vv_exact(TYPE, rr, m, t)
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, public init_velocity_pressure(mesh_f, mesh_c, time, dt, list_mode, un_m1, un, pn_m1, pn, phin_m1, phin)
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