SFEMaNS  version 5.3
Reference documentation for SFEMaNS
condlim_test_27.f90
Go to the documentation of this file.
2  USE my_util
3  USE def_type_mesh
4  USE input_data
5  USE test_27
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 !!$ IMPLICIT NONE
167 !!$ INTEGER , INTENT(IN) :: TYPE
168 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
169 !!$ INTEGER, INTENT(IN) :: m
170 !!$ REAL(KIND=8), INTENT(IN) :: t
171 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
172 !!$
173 !!$ vv(:) = 0.d0
174 !!$ CALL error_petsc('vv_exact: should not be called for this test')
175 !!$ RETURN
176 !!$ END FUNCTION vv_exact
177 
178 !!$ !===Solid velocity imposed when using penalty technique
179 !!$ !===Defined in Fourier space on mode 0 only.
180 !!$ FUNCTION imposed_velocity_by_penalty(rr,t) RESULT(vv)
181 !!$ IMPLICIT NONE
182 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
183 !!$ REAL(KIND=8), INTENT(IN) :: t
184 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
185 !!$
186 !!$ vv=0.d0
187 !!$ RETURN
188 !!$ END FUNCTION imposed_velocity_by_penalty
189 
190 !!$ !===Pressure for boundary conditions in Navier-Stokes.
191 !!$ !===Can be used also to initialize pressure in the subroutine init_velocity_pressure.
192 !!$ !===Use this routine for outflow BCs only.
193 !!$ !===CAUTION: Do not enfore BCs on pressure where normal component
194 !!$ ! of velocity is prescribed.
195 !!$ FUNCTION pp_exact(TYPE,rr,m,t) RESULT (vv)
196 !!$ IMPLICIT NONE
197 !!$ INTEGER , INTENT(IN) :: TYPE
198 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
199 !!$ INTEGER , INTENT(IN) :: m
200 !!$ REAL(KIND=8), INTENT(IN) :: t
201 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
202 !!$
203 !!$ vv=0.d0
204 !!$ CALL error_petsc('pp_exact: should not be called for this test')
205 !!$ RETURN
206 !!$ END FUNCTION pp_exact
207 
208 !!$ !===Temperature for boundary conditions in temperature equation.
209 !!$ FUNCTION temperature_exact(TYPE,rr,m,t) RESULT (vv)
210 !!$ IMPLICIT NONE
211 !!$ INTEGER , INTENT(IN) :: TYPE
212 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
213 !!$ INTEGER , INTENT(IN) :: m
214 !!$ REAL(KIND=8), INTENT(IN) :: t
215 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
216 !!$
217 !!$ vv = 0.d0
218 !!$ CALL error_petsc('temperature_exact: should not be called for this test')
219 !!$ RETURN
220 !!$ END FUNCTION temperature_exact
221 
222 !!$ !===Can be used to initialize level set in the subroutine init_level_set.
223 !!$ FUNCTION level_set_exact(interface_nb,TYPE,rr,m,t) RESULT (vv)
224 !!$ IMPLICIT NONE
225 !!$ INTEGER , INTENT(IN) :: TYPE
226 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
227 !!$ INTEGER , INTENT(IN) :: m, interface_nb
228 !!$ REAL(KIND=8), INTENT(IN) :: t
229 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
230 !!$
231 !!$ vv = 0.d0
232 !!$ CALL error_petsc('level_set_exact: should not be called for this test')
233 !!$ RETURN
234 !!$
235 !!$ END FUNCTION level_set_exact
236 
237 !!$ !===Penalty coefficient (if needed)
238 !!$ !===This coefficient is equal to zero in subdomain
239 !!$ !===where penalty is applied (penalty is zero in solid)
240 !!$ FUNCTION penal_in_real_space(mesh,rr_gauss,angles,nb_angles,nb,ne,time) RESULT(vv)
241 !!$ IMPLICIT NONE
242 !!$ TYPE(mesh_type) :: mesh
243 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr_gauss
244 !!$ REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
245 !!$ INTEGER, INTENT(IN) :: nb_angles
246 !!$ INTEGER, INTENT(IN) :: nb, ne
247 !!$ REAL(KIND=8), INTENT(IN) :: time
248 !!$ REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
249 !!$
250 !!$ vv = 1.d0
251 !!$ CALL error_petsc('penal_in_real_space: should not be called for this test')
252 !!$ RETURN
253 !!$ END FUNCTION penal_in_real_space
254 
255 !!$ !===Extension of the velocity field in the solid.
256 !!$ !===Used when temperature or Maxwell equations are solved.
257 !!$ !===It extends the velocity field on the Navier-Stokes domain to a
258 !!$ !===velocity field on the temperature and the Maxwell domain.
259 !!$ !===It is also used if problem type=mxw and restart velocity
260 !!$ !===is set to true in data (type problem denoted mxx in the code).
261 !!$ FUNCTION extension_velocity(TYPE, H_mesh, mode, t, n_start) RESULT(vv)
262 !!$ IMPLICIT NONE
263 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
264 !!$ INTEGER , INTENT(IN) :: TYPE, n_start
265 !!$ INTEGER, INTENT(IN) :: mode
266 !!$ REAL(KIND=8), INTENT(IN) :: t
267 !!$ REAL(KIND=8), DIMENSION(H_Mesh%np) :: vv
268 !!$
269 !!$ vv = 0.d0
270 !!$ RETURN
271 !!$
272 !!$ END FUNCTION extension_velocity
273 
274  !===============================================================================
275  ! Boundary conditions for Maxwell
276  !===============================================================================
277  !===Velocity used in the induction equation.
278  !===Used only if problem type is mxw and restart velocity is false
279  FUNCTION vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
280  IMPLICIT NONE
281  TYPE(mesh_type), INTENT(IN) :: H_mesh
282  INTEGER, INTENT(IN) :: m
283  REAL(KIND=8), DIMENSION(H_mesh%np,6) :: vv
284  INTEGER :: n
285 
286  vv = 0.d0
287  RETURN
288 
289  !===Dummies variables to avoid warning
290  n=h_mesh%np; n=m
291  !===Dummies variables to avoid warning
292  END FUNCTION vexact
293 
294 !!$ !===Magnetic field and magnetic induction for quasi-static approximation
295 !!$ !===if needed
296 !!$ FUNCTION H_B_quasi_static(char_h_b, rr, m) RESULT(vv)
297 !!$ IMPLICIT NONE
298 !!$ CHARACTER(LEN=1), INTENT(IN) :: char_h_b
299 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
300 !!$ INTEGER, INTENT(IN) :: m
301 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
302 !!$
303 !!$ vv = 0.d0
304 !!$ RETURN
305 !!$ END FUNCTION H_B_quasi_static
306 
307  !===Magnetic field for boundary conditions in the Maxwell equations.
308  FUNCTION hexact(H_mesh,TYPE, rr, m, mu_H_field, t) RESULT(vv)
309  IMPLICIT NONE
310  TYPE(mesh_type), INTENT(IN) :: H_mesh
311  INTEGER , INTENT(IN) :: TYPE
312  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
313  INTEGER , INTENT(IN) :: m
314  REAL(KIND=8), INTENT(IN) :: t
315  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_H_field
316  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
317  INTEGER :: n
318  REAL(KIND=8) :: r
319 
320  vv = 0.d0
321  IF (m==0) THEN
322  IF (type==1) THEN !Bessel functions defined for reals
323  vv = cosh(rr(2,:))
324  DO n = 1, SIZE(rr,2)
325  vv(n) = -bessj1(rr(1,n))*vv(n)
326  END DO
327  ELSE IF (type==5) THEN
328  vv = sinh(rr(2,:))
329  DO n = 1, SIZE(rr,2)
330  vv(n) = bessj0(rr(1,n))*vv(n)
331  END DO
332  ELSE
333  vv = 0.d0
334  END IF
335  ELSE IF (m==mode_mu_t27) THEN
336  IF (type==1) THEN !Bessel functions defined for reals
337  vv = cosh(rr(2,:))*f_test_wtime_t27(rr(1,:),rr(2,:),t)
338  DO n = 1, SIZE(rr,2)
339  vv(n) = -bessj1(rr(1,n))*vv(n)
340  END DO
341  ELSE IF (type==5) THEN
342  vv = sinh(rr(2,:))*f_test_wtime_t27(rr(1,:),rr(2,:),t)
343  DO n = 1, SIZE(rr,2)
344  vv(n) = bessj0(rr(1,n))*vv(n)
345  END DO
346  ELSE
347  vv = 0.d0
348  END IF
349  ELSE
350  vv(:) = 0.d0
351  END IF
352  RETURN
353 
354  !===Dummies variables to avoid warning
355  n=h_mesh%np; r=mu_h_field(1)
356  !===Dummies variables to avoid warning
357  END FUNCTION hexact
358 
359  !===Scalar potential for boundary conditions in the Maxwell equations.
360  FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
361  IMPLICIT NONE
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
367  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: r, z
368  INTEGER :: n
369 
370  IF (m/=0) THEN
371  vv = 0.d0
372  RETURN
373  END IF
374  r = rr(1,:)
375  z = rr(2,:)
376  IF (type==1) THEN !Bessel functions defined for reals
377  DO n = 1, SIZE(rr,2)
378  vv(n) = bessj0(r(n))*cosh(z(n))
379  END DO
380  ELSE
381  vv = 0.d0
382  END IF
383  RETURN
384 
385  !===Dummies variables to avoid warning
386  r=mu_phi; r=t
387  !===Dummies variables to avoid warning
388  END FUNCTION phiexact
389 
390  !===Current in Ohm's law. Curl(H) = sigma(E + uxB) + current
391  FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
392  IMPLICIT NONE
393  INTEGER , INTENT(IN) :: TYPE
394  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
395  INTEGER , INTENT(IN) :: m
396  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_H, t
397  INTEGER , INTENT(IN) :: mesh_id
398  REAL(KIND=8), DIMENSION(6), OPTIONAL,INTENT(IN) :: opt_B_ext
399  REAL(KIND=8) :: vv
400  REAL(KIND=8) :: r, z
401  REAL(KIND=8), DIMENSION(1) :: dummy
402  INTEGER :: n
403 
404  vv=0.d0
405  IF (m/=mode_mu_t27) THEN
406  vv = 0.d0
407  RETURN
408  END IF
409 
410  r = rr(1)
411  z = rr(2)
412  dummy = f_test_wtime_t27(rr(1:1),rr(2:2),t)
413  IF (type==2) THEN
414  vv = -(mode_mu_t27/r)*dummy(1)*bessj0(r)*sinh(z)
415  ELSE IF (type==3) THEN
416  vv = -dfdr_test_wtime_t27(r,z,t)*bessj0(r)*sinh(z)-dfdz_test_wtime_t27(r,z,t)*bessj1(r)*cosh(z)
417  ELSE IF (type==6) THEN
418  vv = -(mode_mu_t27/r)*dummy(1)*bessj1(r)*cosh(z)
419  ELSE
420  vv = 0.d0
421  END IF
422  RETURN
423 
424  !===Dummies variables to avoid warning
425  r=mu_phi; r=sigma; r=mu_h; n=mesh_id
426  IF (PRESENT(opt_b_ext)) r=opt_b_ext(1)
427  !===Dummies variables to avoid warning
428  END FUNCTION jexact_gauss
429 
430  !===Electric field for Neumann BC (cf. doc)
431  FUNCTION eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t) RESULT(vv)
432  IMPLICIT NONE
433  INTEGER, INTENT(IN) :: TYPE
434  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
435  INTEGER, INTENT(IN) :: m
436  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_H, t
437  REAL(KIND=8) :: vv
438  REAL(KIND=8) :: r
439  INTEGER :: n
440 
441  vv = 0.d0
442  CALL error_petsc('Eexact: should not be called for this test')
443 
444  !===Dummies variables to avoid warning
445  r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=t; n=type; n=m
446  !===Dummies variables to avoid warning
447  END FUNCTION eexact_gauss
448 
449  !===Initialization of magnetic field and scalar potential (if present)
450  SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
451  list_mode, hn1, hn, phin1, phin)
452  IMPLICIT NONE
453  TYPE(mesh_type) :: H_mesh, phi_mesh
454  REAL(KIND=8), INTENT(OUT):: time
455  REAL(KIND=8), INTENT(IN) :: dt
456  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_H_field
457  REAL(KIND=8), INTENT(IN) :: mu_phi
458  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
459  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: Hn, Hn1
460  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: phin, phin1
461  REAL(KIND=8) :: r
462  INTEGER :: n
463 
464  hn1 = 0.d0
465  hn = 0.d0
466  phin1 = 0.d0
467  phin = 0.d0
468  time = 0.d0
469  RETURN
470 
471  !===Dummies variables to avoid warning
472  r=h_mesh%rr(1,1); r=phi_mesh%rr(1,1); r=dt; r=mu_h_field(1); r=mu_phi; n=SIZE(list_mode)
473  !===Dummies variables to avoid warning
474  END SUBROUTINE init_maxwell
475 
476  !===Analytical permeability (if needed)
477  !===This function is not needed unless the flag
478  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
479  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
480  FUNCTION mu_bar_in_fourier_space(H_mesh,nb,ne,pts,pts_ids) RESULT(vv)
481  IMPLICIT NONE
482  TYPE(mesh_type), INTENT(IN) :: H_mesh
483  REAL(KIND=8), DIMENSION(ne-nb+1) :: vv
484  INTEGER, INTENT(IN) :: nb, ne
485  REAL(KIND=8),DIMENSION(2,ne-nb+1),OPTIONAL :: pts
486  INTEGER, DIMENSION(ne-nb+1), OPTIONAL :: pts_ids
487 
488  IF( PRESENT(pts) .AND. PRESENT(pts_ids) ) THEN
489  vv=mu_bar_in_fourier_space_anal_t27(h_mesh,nb,ne,pts,pts_ids)
490  ELSE
491  vv=mu_bar_in_fourier_space_anal_t27(h_mesh,nb,ne,pts)
492  END IF
493  RETURN
494  END FUNCTION mu_bar_in_fourier_space
495 
496  !===Analytical mu_in_fourier_space (if needed)
497  !===This function is not needed unless the flag
498  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
499  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
500  FUNCTION grad_mu_bar_in_fourier_space(pt,pt_id) RESULT(vv)
501  IMPLICIT NONE
502  REAL(KIND=8),DIMENSION(2), INTENT(in):: pt
503  INTEGER,DIMENSION(1), INTENT(in) :: pt_id
504  REAL(KIND=8),DIMENSION(2) :: vv
505 
507  RETURN
508  END FUNCTION grad_mu_bar_in_fourier_space
509 
510  !===Analytical permeability, mu in real space (if needed)
511  FUNCTION mu_in_real_space(H_mesh,angles,nb_angles,nb,ne,time) RESULT(vv)
512  IMPLICIT NONE
513  TYPE(mesh_type), INTENT(IN) :: H_mesh
514  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
515  INTEGER, INTENT(IN) :: nb_angles
516  INTEGER, INTENT(IN) :: nb, ne
517  REAL(KIND=8), INTENT(IN) :: time
518  REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
519 
520  vv = mu_in_real_space_anal_t27(h_mesh,angles,nb_angles,nb,ne,time)
521  RETURN
522  END FUNCTION mu_in_real_space
523 
524 END MODULE boundary_test_27
real(kind=8) function, dimension(h_mesh%np, 6), public vexact(m, H_mesh)
Definition: bessel.f90:4
real(kind=8) function dfdz_test_wtime_t27(r, z, t)
Definition: test_27.f90:126
real(kind=8) function, public eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t)
subroutine error_petsc(string)
Definition: my_util.f90:16
real(kind=8) function, dimension(nb_angles, ne-nb+1), public mu_in_real_space(H_mesh, angles, nb_angles, nb, ne, time)
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, public bessj0(x)
Definition: bessel.f90:206
real(kind=8) function dfdr_test_wtime_t27(r, z, t)
Definition: test_27.f90:110
integer, public mode_mu_t27
Definition: test_27.f90:7
real(kind=8) function, dimension(2), public grad_mu_bar_in_fourier_space(pt, pt_id)
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(ne-nb+1) mu_bar_in_fourier_space_anal_t27(H_mesh, nb, ne, pts, pts_ids)
Definition: test_27.f90:13
real(kind=8) function, dimension(ne-nb+1), public mu_bar_in_fourier_space(H_mesh, nb, ne, pts, pts_ids)
real(kind=8) function, dimension(size(rr, 2)), public phiexact(TYPE, rr, m, mu_phi, t)
real(kind=8) function, public bessj1(x)
Definition: bessel.f90:236
real(kind=8) function, dimension(size(r)) f_test_wtime_t27(r, z, t)
Definition: test_27.f90:92
real(kind=8) function, dimension(size(rr, 2)), public hexact(H_mesh, TYPE, rr, m, mu_H_field, t)
real(kind=8) function, dimension(2) grad_mu_bar_in_fourier_space_anal_t27(pt, pt_id)
Definition: test_27.f90:38
real(kind=8) function, dimension(nb_angles, ne-nb+1) mu_in_real_space_anal_t27(H_mesh, angles, nb_angles, nb, ne, time)
Definition: test_27.f90:67