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