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