SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
condlim_test_17.f90
Go to the documentation of this file.
2  USE my_util
3  USE def_type_mesh
4  USE input_data
5  USE test_17
6  USE bessel
7 !!$ATTENTION
8 !!$Some subroutines have been commented to avoid warning messages when compiling executable.
9 !!$It can not be done in the module boundary_generic that expects all subroutines to be present.
10 !!$END ATTENTION
11 !!$ PUBLIC :: init_velocity_pressure
12 !!$ PUBLIC :: init_temperature
13 !!$ PUBLIC :: init_level_set
14 !!$ PUBLIC :: source_in_NS_momentum
15 !!$ PUBLIC :: source_in_temperature
16 !!$ PUBLIC :: source_in_level_set
17 !!$ PUBLIC :: vv_exact
18 !!$ PUBLIC :: imposed_velocity_by_penalty
19 !!$ PUBLIC :: pp_exact
20 !!$ PUBLIC :: temperature_exact
21 !!$ PUBLIC :: level_set_exact
22 !!$ PUBLIC :: penal_in_real_space
23 !!$ PUBLIC :: extension_velocity
24  PUBLIC :: vexact
25 !!$ PUBLIC :: H_B_quasi_static
26  PUBLIC :: hexact
27  PUBLIC :: phiexact
28  PUBLIC :: jexact_gauss
29  PUBLIC :: eexact_gauss
30  PUBLIC :: init_maxwell
31  PUBLIC :: mu_bar_in_fourier_space
33 !!$ PUBLIC :: mu_in_real_space
34  PRIVATE
35 
36 CONTAINS
37  !===============================================================================
38  ! Boundary conditions for Navier-Stokes
39  !===============================================================================
40 
41 !!$ !===Initialize velocity, pressure
42 !!$ SUBROUTINE init_velocity_pressure(mesh_f, mesh_c, time, dt, list_mode, &
43 !!$ un_m1, un, pn_m1, pn, phin_m1, phin)
44 !!$ IMPLICIT NONE
45 !!$ TYPE(mesh_type) :: mesh_f, mesh_c
46 !!$ REAL(KIND=8), INTENT(OUT):: time
47 !!$ REAL(KIND=8), INTENT(IN) :: dt
48 !!$ INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
49 !!$ REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: un_m1, un
50 !!$ REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: pn_m1, pn, phin_m1, phin
51 !!$ INTEGER :: mode, i, j
52 !!$ REAL(KIND=8), DIMENSION(mesh_c%np) :: pn_m2
53 !!$
54 !!$ time = 0.d0
55 !!$ DO i= 1, SIZE(list_mode)
56 !!$ mode = list_mode(i)
57 !!$ DO j = 1, 6
58 !!$ !===velocity
59 !!$ un_m1(:,j,i) = vv_exact(j,mesh_f%rr,mode,time-dt)
60 !!$ un (:,j,i) = vv_exact(j,mesh_f%rr,mode,time)
61 !!$ END DO
62 !!$ DO j = 1, 2
63 !!$ !===pressure
64 !!$ pn_m2(:) = pp_exact(j,mesh_c%rr,mode,time-2*dt)
65 !!$ pn_m1 (:,j,i) = pp_exact(j,mesh_c%rr,mode,time-dt)
66 !!$ pn (:,j,i) = pp_exact(j,mesh_c%rr,mode,time)
67 !!$ phin_m1(:,j,i) = pn_m1(:,j,i) - pn_m2(:)
68 !!$ phin (:,j,i) = Pn (:,j,i) - pn_m1(:,j,i)
69 !!$ ENDDO
70 !!$ ENDDO
71 !!$ END SUBROUTINE init_velocity_pressure
72 
73 !!$ !===Initialize temperature
74 !!$ SUBROUTINE init_temperature(mesh, time, dt, list_mode, tempn_m1, tempn)
75 !!$ IMPLICIT NONE
76 !!$ TYPE(mesh_type) :: mesh
77 !!$ REAL(KIND=8), INTENT(OUT):: time
78 !!$ REAL(KIND=8), INTENT(IN) :: dt
79 !!$ INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
80 !!$ REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: tempn_m1, tempn
81 !!$ INTEGER :: mode, i, j
82 !!$
83 !!$ time = 0.d0
84 !!$ DO i= 1, SIZE(list_mode)
85 !!$ mode = list_mode(i)
86 !!$ DO j = 1, 2
87 !!$ tempn_m1(:,j,i) = temperature_exact(j, mesh%rr, mode, time-dt)
88 !!$ tempn (:,j,i) = temperature_exact(j, mesh%rr, mode, time)
89 !!$ ENDDO
90 !!$ ENDDO
91 !!$ END SUBROUTINE init_temperature
92 
93 !!$ !===Initialize level_set
94 !!$ SUBROUTINE init_level_set(vv_mesh, time, &
95 !!$ dt, list_mode, level_set_m1, level_set)
96 !!$ IMPLICIT NONE
97 !!$ TYPE(mesh_type) :: vv_mesh
98 !!$ REAL(KIND=8), INTENT(OUT):: time
99 !!$ REAL(KIND=8), INTENT(IN) :: dt
100 !!$ INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
101 !!$ REAL(KIND=8), DIMENSION(:,:,:,:), INTENT(OUT):: level_set, level_set_m1
102 !!$ INTEGER :: mode, i, j, n
103 !!$
104 !!$ time = 0.d0
105 !!$ DO i= 1, SIZE(list_mode)
106 !!$ mode = list_mode(i)
107 !!$ DO j = 1, 2
108 !!$ !===level_set
109 !!$ DO n = 1, inputs%nb_fluid -1
110 !!$ level_set_m1(n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time-dt)
111 !!$ level_set (n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time)
112 !!$ END DO
113 !!$ END DO
114 !!$ END DO
115 !!$
116 !!$ END SUBROUTINE init_level_set
117 
118 !!$ !===Source in momemtum equation. Always called.
119 !!$ FUNCTION source_in_NS_momentum(TYPE, rr, mode, i, time, Re, ty, opt_density, opt_tempn) RESULT(vv)
120 !!$ IMPLICIT NONE
121 !!$ INTEGER , INTENT(IN) :: TYPE
122 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
123 !!$ INTEGER , INTENT(IN) :: mode, i
124 !!$ REAL(KIND=8), INTENT(IN) :: time
125 !!$ REAL(KIND=8), INTENT(IN) :: Re
126 !!$ CHARACTER(LEN=2), INTENT(IN) :: ty
127 !!$ REAL(KIND=8), DIMENSION(:,:,:), OPTIONAL, INTENT(IN) :: opt_density
128 !!$ REAL(KIND=8), DIMENSION(:,:,:), OPTIONAL, INTENT(IN) :: opt_tempn
129 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
130 !!$
131 !!$ vv = 0.d0
132 !!$ CALL error_petsc('source_in_NS_momentum: should not be called for this test')
133 !!$ RETURN
134 !!$ END FUNCTION source_in_NS_momentum
135 
136 !!$ !===Extra source in temperature equation. Always called.
137 !!$ FUNCTION source_in_temperature(TYPE, rr, m, t)RESULT(vv)
138 !!$ IMPLICIT NONE
139 !!$ INTEGER , INTENT(IN) :: TYPE
140 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
141 !!$ INTEGER , INTENT(IN) :: m
142 !!$ REAL(KIND=8), INTENT(IN) :: t
143 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
144 !!$
145 !!$ vv = 0.d0
146 !!$ CALL error_petsc('source_in_temperature: should not be called for this test')
147 !!$ RETURN
148 !!$ END FUNCTION source_in_temperature
149 
150 !!$ !===Extra source in level set equation. Always called.
151 !!$ FUNCTION source_in_level_set(interface_nb,TYPE, rr, m, t)RESULT(vv)
152 !!$ IMPLICIT NONE
153 !!$ INTEGER , INTENT(IN) :: TYPE
154 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
155 !!$ INTEGER , INTENT(IN) :: m, interface_nb
156 !!$ REAL(KIND=8), INTENT(IN) :: t
157 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
158 !!$
159 !!$ vv=0.d0
160 !!$ CALL error_petsc('sourece_in_temperature: should not be called for this test')
161 !!$ END FUNCTION source_in_level_set
162 
163 !!$ !===Velocity for boundary conditions in Navier-Stokes.
164 !!$ !===Can be used also to initialize velocity in: init_velocity_pressure_temperature
165 !!$ FUNCTION vv_exact(TYPE,rr,m,t) RESULT(vv)
166 !!$
167 !!$ IMPLICIT NONE
168 !!$ INTEGER , INTENT(IN) :: TYPE
169 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
170 !!$ INTEGER, INTENT(IN) :: m
171 !!$ REAL(KIND=8), INTENT(IN) :: t
172 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
173 !!$
174 !!$ vv(:) = 0.d0
175 !!$ CALL error_petsc('vv_exact: should not be called for this test')
176 !!$ RETURN
177 !!$ END FUNCTION vv_exact
178 
179 !!$ !===Solid velocity imposed when using penalty technique
180 !!$ !===Defined in Fourier space on mode 0 only.
181 !!$ FUNCTION imposed_velocity_by_penalty(rr,t) RESULT(vv)
182 !!$ IMPLICIT NONE
183 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
184 !!$ REAL(KIND=8), INTENT(IN) :: t
185 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
186 !!$
187 !!$ vv=0.d0
188 !!$ RETURN
189 !!$ END FUNCTION imposed_velocity_by_penalty
190 
191 !!$ !===Pressure for boundary conditions in Navier-Stokes.
192 !!$ !===Can be used also to initialize pressure in the subroutine init_velocity_pressure.
193 !!$ !===Use this routine for outflow BCs only.
194 !!$ !===CAUTION: Do not enfore BCs on pressure where normal component
195 !!$ ! of velocity is prescribed.
196 !!$ FUNCTION pp_exact(TYPE,rr,m,t) RESULT (vv)
197 !!$ IMPLICIT NONE
198 !!$ INTEGER , INTENT(IN) :: TYPE
199 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
200 !!$ INTEGER , INTENT(IN) :: m
201 !!$ REAL(KIND=8), INTENT(IN) :: t
202 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
203 !!$
204 !!$ vv=0.d0
205 !!$ CALL error_petsc('pp_exact: should not be called for this test')
206 !!$ RETURN
207 !!$ END FUNCTION pp_exact
208 
209 !!$ !===Temperature for boundary conditions in temperature equation.
210 !!$ FUNCTION temperature_exact(TYPE,rr,m,t) RESULT (vv)
211 !!$ IMPLICIT NONE
212 !!$ INTEGER , INTENT(IN) :: TYPE
213 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
214 !!$ INTEGER , INTENT(IN) :: m
215 !!$ REAL(KIND=8), INTENT(IN) :: t
216 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
217 !!$
218 !!$ vv = 0.d0
219 !!$ CALL error_petsc('temperature_exact: should not be called for this test')
220 !!$ RETURN
221 !!$ END FUNCTION temperature_exact
222 
223 !!$ !===Can be used to initialize level set in the subroutine init_level_set.
224 !!$ FUNCTION level_set_exact(interface_nb,TYPE,rr,m,t) RESULT (vv)
225 !!$ IMPLICIT NONE
226 !!$ INTEGER , INTENT(IN) :: TYPE
227 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
228 !!$ INTEGER , INTENT(IN) :: m, interface_nb
229 !!$ REAL(KIND=8), INTENT(IN) :: t
230 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
231 !!$
232 !!$ vv = 0.d0
233 !!$ CALL error_petsc('level_set_exact: should not be called for this test')
234 !!$ RETURN
235 !!$
236 !!$ END FUNCTION level_set_exact
237 
238 !!$ !===Penalty coefficient (if needed)
239 !!$ !===This coefficient is equal to zero in subdomain
240 !!$ !===where penalty is applied (penalty is zero in solid)
241 !!$ FUNCTION penal_in_real_space(mesh,rr_gauss,angles,nb_angles,nb,ne,time) RESULT(vv)
242 !!$ IMPLICIT NONE
243 !!$ TYPE(mesh_type) :: mesh
244 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr_gauss
245 !!$ REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
246 !!$ INTEGER, INTENT(IN) :: nb_angles
247 !!$ INTEGER, INTENT(IN) :: nb, ne
248 !!$ REAL(KIND=8), INTENT(IN) :: time
249 !!$ REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
250 !!$
251 !!$ vv = 1.d0
252 !!$ CALL error_petsc('penal_in_real_space: should not be called for this test')
253 !!$ RETURN
254 !!$ END FUNCTION penal_in_real_space
255 
256 !!$ !===Extension of the velocity field in the solid.
257 !!$ !===Used when temperature or Maxwell equations are solved.
258 !!$ !===It extends the velocity field on the Navier-Stokes domain to a
259 !!$ !===velocity field on the temperature and the Maxwell domain.
260 !!$ !===It is also used if problem type=mxw and restart velocity
261 !!$ !===is set to true in data (type problem denoted mxx in the code).
262 !!$ FUNCTION extension_velocity(TYPE, H_mesh, mode, t, n_start) RESULT(vv)
263 !!$ IMPLICIT NONE
264 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
265 !!$ INTEGER , INTENT(IN) :: TYPE, n_start
266 !!$ INTEGER, INTENT(IN) :: mode
267 !!$ REAL(KIND=8), INTENT(IN) :: t
268 !!$ REAL(KIND=8), DIMENSION(H_Mesh%np) :: vv
269 !!$
270 !!$ vv = 0.d0
271 !!$ RETURN
272 !!$
273 !!$ END FUNCTION extension_velocity
274 
275  !===============================================================================
276  ! Boundary conditions for Maxwell
277  !===============================================================================
278  !===Velocity used in the induction equation.
279  !===Used only if problem type is mxw and restart velocity is false
280  FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
281  IMPLICIT NONE
282  TYPE(mesh_type), INTENT(IN) :: h_mesh
283  INTEGER, INTENT(IN) :: m
284  REAL(KIND=8), DIMENSION(H_mesh%np,6) :: vv
285  INTEGER :: n
286 
287  vv = 0.d0
288  RETURN
289 
290  !===Dummies variables to avoid warning
291  n=h_mesh%np; n=m
292  !===Dummies variables to avoid warning
293  END FUNCTION vexact
294 
295 !!$ !===Magnetic field and magnetic induction for quasi-static approximation
296 !!$ !===if needed
297 !!$ FUNCTION H_B_quasi_static(char_h_b, rr, m) RESULT(vv)
298 !!$ IMPLICIT NONE
299 !!$ CHARACTER(LEN=1), INTENT(IN) :: char_h_b
300 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
301 !!$ INTEGER, INTENT(IN) :: m
302 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
303 !!$
304 !!$ vv = 0.d0
305 !!$ RETURN
306 !!$ END FUNCTION H_B_quasi_static
307 
308  !===Magnetic field for boundary conditions in the Maxwell equations.
309  FUNCTION hexact(H_mesh,TYPE, rr, m, mu_H_field, t) RESULT(vv)
310  IMPLICIT NONE
311  TYPE(mesh_type), INTENT(IN) :: h_mesh
312  INTEGER , INTENT(IN) :: type
313  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
314  INTEGER , INTENT(IN) :: m
315  REAL(KIND=8), INTENT(IN) :: t
316  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_h_field
317  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
318  INTEGER :: n
319  REAL(KIND=8) :: r
320 
321  IF (m/=0) THEN
322  vv(:) = 0.d0
323  RETURN
324  END IF
325  vv = f_test_t17(rr(1,:),rr(2,:))
326  IF (type==1) THEN !Bessel functions defined for reals
327  vv = cosh(rr(2,:))*(1+vv)
328  DO n = 1, SIZE(rr,2)
329  vv(n) = -bessj1(rr(1,n))*vv(n)
330  END DO
331  ELSE IF (type==5) THEN
332  vv = sinh(rr(2,:))*(1+vv)
333  DO n = 1, SIZE(rr,2)
334  vv(n) = bessj0(rr(1,n))*vv(n)
335  END DO
336  ELSE
337  vv = 0.d0
338  END IF
339  RETURN
340 
341  !===Dummies variables to avoid warning
342  n=h_mesh%np; r=mu_h_field(1); r=t
343  !===Dummies variables to avoid warning
344  END FUNCTION hexact
345 
346  !===Scalar potential for boundary conditions in the Maxwell equations.
347  FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
348  IMPLICIT NONE
349  INTEGER , INTENT(IN) :: type
350  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
351  INTEGER , INTENT(IN) :: m
352  REAL(KIND=8), INTENT(IN) :: mu_phi, t
353  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
354  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: r, z
355  INTEGER :: n
356 
357  IF (m/=0) THEN
358  vv = 0.d0
359  RETURN
360  END IF
361  r = rr(1,:)
362  z = rr(2,:)
363  IF (type==1) THEN !Bessel functions defined for reals
364  DO n = 1, SIZE(rr,2)
365  vv(n) = bessj0(r(n))*cosh(z(n))
366  END DO
367  ELSE
368  vv = 0.d0
369  END IF
370  RETURN
371 
372  !===Dummies variables to avoid warning
373  r=mu_phi; r=t
374  !===Dummies variables to avoid warning
375  END FUNCTION phiexact
376 
377  !===Current in Ohm's law. Curl(H) = sigma(E + uxB) + current
378  FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
379  IMPLICIT NONE
380  INTEGER , INTENT(IN) :: type
381  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
382  INTEGER , INTENT(IN) :: m
383  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_h, t
384  INTEGER , INTENT(IN) :: mesh_id
385  REAL(KIND=8), DIMENSION(6), OPTIONAL,INTENT(IN) :: opt_b_ext
386  REAL(KIND=8) :: vv
387  REAL(KIND=8) :: r, z
388  INTEGER :: n
389 
390  IF (m/=0) THEN
391  vv = 0.d0
392  RETURN
393  END IF
394 
395  r = rr(1)
396  z = rr(2)
397  IF (type==3) THEN
398  vv = -dfdz_test_t17(r,z)*bessj1(r)*cosh(z) &
399  -dfdr_test_t17(r,z)*bessj0(r)*sinh(z)
400  ELSE
401  vv = 0.d0
402  END IF
403  RETURN
404 
405  !===Dummies variables to avoid warning
406  r=mu_phi; r=sigma; r=mu_h; r=t; n=mesh_id
407  IF (present(opt_b_ext)) r=opt_b_ext(1)
408  !===Dummies variables to avoid warning
409  END FUNCTION jexact_gauss
410 
411  !===Electric field for Neumann BC (cf. doc)
412  FUNCTION eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t) RESULT(vv)
413  IMPLICIT NONE
414  INTEGER, INTENT(IN) :: type
415  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
416  INTEGER, INTENT(IN) :: m
417  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_h, t
418  REAL(KIND=8) :: vv
419  REAL(KIND=8) :: r
420  INTEGER :: n
421 
422  vv = 0.d0
423  RETURN
424 
425  !===Dummies variables to avoid warning
426  r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=t; n=type; n=m
427  !===Dummies variables to avoid warning
428  END FUNCTION eexact_gauss
429 
430  !===Initialization of magnetic field and scalar potential (if present)
431  SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
432  list_mode, hn1, hn, phin1, phin)
433  IMPLICIT NONE
434  TYPE(mesh_type) :: h_mesh, phi_mesh
435  REAL(KIND=8), INTENT(OUT):: time
436  REAL(KIND=8), INTENT(IN) :: dt
437  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_h_field
438  REAL(KIND=8), INTENT(IN) :: mu_phi
439  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
440  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: hn, hn1
441  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: phin, phin1
442  INTEGER :: i, k
443 
444  time = -dt
445  DO k=1,6
446  DO i=1, SIZE(list_mode)
447  hn1(:,k,i) = hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
448  IF (inputs%nb_dom_phi>0) THEN
449  IF (k<3) THEN
450  phin1(:,k,i) = phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
451  ENDIF
452  END IF
453  ENDDO
454  ENDDO
455 
456  time = time + dt
457  DO k=1,6
458  DO i=1, SIZE(list_mode)
459  hn(:,k,i) = hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
460  IF (inputs%nb_dom_phi>0) THEN
461  IF (k<3) THEN
462  phin(:,k,i) = phiexact(k, phi_mesh%rr, list_mode(i), mu_phi, time)
463  ENDIF
464  END IF
465  ENDDO
466  ENDDO
467  END SUBROUTINE init_maxwell
468 
469  !===Analytical permeability (if needed)
470  !===This function is not needed unless the flag
471  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
472  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
473  FUNCTION mu_bar_in_fourier_space(H_mesh,nb,ne,pts,pts_ids) RESULT(vv)
474  IMPLICIT NONE
475  TYPE(mesh_type), INTENT(IN) :: h_mesh
476  REAL(KIND=8), DIMENSION(ne-nb+1) :: vv
477  INTEGER, INTENT(IN) :: nb, ne
478  REAL(KIND=8),DIMENSION(2,ne-nb+1),OPTIONAL :: pts
479  INTEGER, DIMENSION(ne-nb+1), OPTIONAL :: pts_ids
480 
481  IF( present(pts) .AND. present(pts_ids) ) THEN
482  vv=mu_bar_in_fourier_space_anal_t17(h_mesh,nb,ne,pts,pts_ids)
483  ELSE
484  vv=mu_bar_in_fourier_space_anal_t17(h_mesh,nb,ne)
485  END IF
486  RETURN
487  END FUNCTION mu_bar_in_fourier_space
488 
489  !===Analytical grad_mu_bar_in_fourier_space (if needed)
490  !===This function is not needed unless the flag
491  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
492  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
493  FUNCTION grad_mu_bar_in_fourier_space(pt,pt_id) RESULT(vv)
494  IMPLICIT NONE
495  REAL(KIND=8),DIMENSION(2), INTENT(IN):: pt
496  INTEGER,DIMENSION(1), INTENT(IN) :: pt_id
497  REAL(KIND=8),DIMENSION(2) :: vv
498 
500  RETURN
501  END FUNCTION grad_mu_bar_in_fourier_space
502 
503 !!$ !===Analytical permeability, mu in real space (if needed)
504 !!$ FUNCTION mu_in_real_space(H_mesh,angles,nb_angles,nb,ne,time) RESULT(vv)
505 !!$ IMPLICIT NONE
506 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
507 !!$ REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
508 !!$ INTEGER, INTENT(IN) :: nb_angles
509 !!$ INTEGER, INTENT(IN) :: nb, ne
510 !!$ REAL(KIND=8), INTENT(IN) :: time
511 !!$ REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
512 !!$
513 !!$ vv = 1.d0
514 !!$ CALL error_petsc('mu_in_real_space: should not be called for this test')
515 !!$ RETURN
516 !!$ END FUNCTION mu_in_real_space
517 
518 END MODULE boundary_test_17
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
Definition: doc_intro.h:199
real(kind=8) function, public bessj1(x)
Definition: bessel.f90:235
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, dimension(size(r)) f_test_t17(r, z)
Definition: test_17.f90:11
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, dimension(2) grad_mu_bar_in_fourier_space_anal_t17(pt, pt_id)
Definition: test_17.f90:60
real(kind=8) function, dimension(2), public grad_mu_bar_in_fourier_space(pt, pt_id)
real(kind=8) function, public bessj0(x)
Definition: bessel.f90:205
real(kind=8) function, dimension(ne-nb+1) mu_bar_in_fourier_space_anal_t17(H_mesh, nb, ne, pts, pts_ids)
Definition: test_17.f90:36
real(kind=8) function, public eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t)
real(kind=8) function dfdr_test_t17(r, z)
Definition: test_17.f90:19
real(kind=8) function, dimension(ne-nb+1), public mu_bar_in_fourier_space(H_mesh, nb, ne, pts, pts_ids)
Definition: bessel.f90:4
real(kind=8) function dfdz_test_t17(r, z)
Definition: test_17.f90:27
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
Definition: doc_intro.h:193