SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
condlim_test_23.f90
Go to the documentation of this file.
2  USE my_util
3  USE def_type_mesh
4  USE input_data
5  USE test_23
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 !!$
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, mm
318  INTEGER, DIMENSION(SIZE(rr,2)) :: id
319  REAL(KIND=8) :: r
320 
321  IF (SIZE(rr,2)== h_mesh%np) THEN
322  DO mm = 1, h_mesh%me !id is used to determine on which side of the interface we are
323  id(h_mesh%jj(:,mm)) = h_mesh%i_d(mm) !used for initialization
324  END DO
325  ELSE
326  IF (rr(1,1)<1) THEN !used for boundary condition
327  id = 1
328  ELSE
329  id = 2
330  END IF
331  END IF
332 
333  DO n = 1, SIZE(rr,2)
334  IF (m == 0) THEN
335  IF (type==1) THEN
336  IF(id(n)==1) THEN
337  vv(n) = rr(1,n)
338  ELSE
339  vv(n) = rr(1,n)/(1.d0 + lambda_mu_t23/rr(2,n) )
340  END IF
341  ELSE IF (type==5) THEN
342  vv(n) = -2.d0*rr(2,n)
343  ELSE
344  vv(n) = 0.d0
345  END IF
346  ELSE IF (m == mode_mu_t23) THEN
347  IF (type==1) THEN
348  IF(id(n)==1) THEN
349  vv(n) = rr(1,n)*s_test_t23(rr(1,n),rr(2,n))
350  ELSE
351  vv(n) = rr(1,n)*s_test_t23(rr(1,n),rr(2,n))/(1.d0 + lambda_mu_t23/rr(2,n))
352  END IF
353 
354  ELSE IF (type==5) THEN
355  vv(n) = -2.d0*rr(2,n)*s_test_t23(rr(1,n),rr(2,n))
356  ELSE
357  vv(n) = 0.d0
358  END IF
359  ELSE
360  vv = 0.d0
361  END IF
362  END DO
363  RETURN
364 
365  !===Dummies variables to avoid warning
366  r=mu_h_field(1); r=t
367  !===Dummies variables to avoid warning
368  END FUNCTION hexact
369 
370  !===Scalar potential for boundary conditions in the Maxwell equations.
371  FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
372  IMPLICIT NONE
373  INTEGER , INTENT(IN) :: type
374  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
375  INTEGER , INTENT(IN) :: m
376  REAL(KIND=8), INTENT(IN) :: mu_phi, t
377  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
378  REAL(KIND=8) :: r
379  INTEGER :: n
380 
381  vv=0.d0
382  CALL error_petsc('Phiexact: should not be called for this test')
383  RETURN
384 
385  !===Dummies variables to avoid warning
386  n=type; n=SIZE(rr,1); n=m; 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) :: alpha,beta
401  REAL(KIND=8) :: r, z
402 
403  r = rr(1)
404  z = rr(2)
405  !DCQ: mesh_id gives us now info about what side (domain) we are.
406  IF ((m==0) .AND. (mesh_id==2) .AND. (type==3)) THEN
407  !J_theta
408  beta=lambda_mu_t23/((1.d0 + lambda_mu_t23/z)**2 * z**2)
409  vv=r*beta
410  ELSE IF (m==mode_mu_t23) THEN
411  !J_r
412  IF (type==2) THEN
413  vv = 2.d0*m*z*b_factor_t23*r**2*( (r-1.d0)*(r-2.d0)*(z-0.25)*(z-1.d0) )**3
414  !J_theta
415  ELSE IF (type==3) THEN
416  alpha =6*b_factor_t23*z*( (z-0.25)*(z-1) )**3*( r* (r-1.d0)*(r-2.d0) )**2 &
417  *( r*(r-1)+r*(r-2)+(r-1)*(r-2))
418 
419  IF (mesh_id==1) THEN
420  vv= 3*b_factor_t23*r**4*( (r-1)*(r-2) )**3 *( (z-0.25)*(z-1) )**2&
421  *( 2*z -1 - 0.25) + alpha
422  ELSE
423  beta =lambda_mu_t23/((1.d0 + lambda_mu_t23/z)**2 * z**2)
424 
425  vv= b_factor_t23*r**4*( (r-1.d0)*(r-2.d0) )**3 *( (z-0.25)*(z-1) )**2 &
426  *( 3*(2*z- 1 - 0.25 )/(1.d0+lambda_mu_t23/z) + beta*(z-1)*(z-0.25) ) &
427  + alpha
428  END IF
429  !J_z
430  ELSE IF (type==6) THEN
431 
432  IF (mesh_id==1) THEN
433  vv = m*s_test_t23(r,z)
434  ELSE
435  vv = m*s_test_t23(r,z)/(1.d0+lambda_mu_t23/z)
436  ENDIF
437  ELSE
438  vv = 0.d0
439  END IF
440  ELSE
441  vv = 0.d0
442  END IF
443  RETURN
444 
445  !===Dummies variables to avoid warning
446  r=mu_phi; r=sigma; r=mu_h; r=t
447  IF (present(opt_b_ext)) r=opt_b_ext(1)
448  !===Dummies variables to avoid warning
449  END FUNCTION jexact_gauss
450 
451  !===Electric field for Neumann BC (cf. doc)
452  FUNCTION eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t) RESULT(vv)
453  IMPLICIT NONE
454  INTEGER, INTENT(IN) :: type
455  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
456  INTEGER, INTENT(IN) :: m
457  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_h, t
458  REAL(KIND=8) :: vv
459  REAL(KIND=8) :: r
460  INTEGER :: n
461 
462  vv = 0.d0
463  CALL error_petsc('Eexact: should not be called for this test')
464 
465  !===Dummies variables to avoid warning
466  r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=t; n=type; n=m
467  !===Dummies variables to avoid warning
468  END FUNCTION eexact_gauss
469 
470  !===Initialization of magnetic field and scalar potential (if present)
471  SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
472  list_mode, hn1, hn, phin1, phin)
473  IMPLICIT NONE
474  TYPE(mesh_type) :: h_mesh, phi_mesh
475  REAL(KIND=8), INTENT(OUT):: time
476  REAL(KIND=8), INTENT(IN) :: dt
477  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_h_field
478  REAL(KIND=8), INTENT(IN) :: mu_phi
479  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
480  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: hn, hn1
481  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: phin, phin1
482  REAL(KIND=8) :: r
483  INTEGER :: n
484 
485  hn1 = 0.d0
486  hn = 0.d0
487  phin1 = 0.d0
488  phin = 0.d0
489  time=0.d0
490  RETURN
491 
492  !===Dummies variables to avoid warning
493  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)
494  !===Dummies variables to avoid warning
495  END SUBROUTINE init_maxwell
496 
497  !===Analytical permeability (if needed)
498  !===This function is not needed unless the flag
499  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
500  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
501  FUNCTION mu_bar_in_fourier_space(H_mesh,nb,ne,pts,pts_ids) RESULT(vv)
502  IMPLICIT NONE
503  TYPE(mesh_type), INTENT(IN) :: h_mesh
504  REAL(KIND=8), DIMENSION(ne-nb+1) :: vv
505  INTEGER, INTENT(IN) :: nb, ne
506  REAL(KIND=8),DIMENSION(2,ne-nb+1),OPTIONAL :: pts
507  INTEGER, DIMENSION(ne-nb+1), OPTIONAL :: pts_ids
508 
509  IF( present(pts) .AND. present(pts_ids) ) THEN
510  vv=mu_bar_in_fourier_space_anal_t23(h_mesh,nb,ne,pts,pts_ids)
511  ELSE
512  vv=mu_bar_in_fourier_space_anal_t23(h_mesh,nb,ne,pts)
513  END IF
514  RETURN
515  END FUNCTION mu_bar_in_fourier_space
516 
517  !===Analytical mu_in_fourier_space (if needed)
518  !===This function is not needed unless the flag
519  !=== ===Use FEM Interpolation for magnetic permeability (true/false)
520  !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
521  FUNCTION grad_mu_bar_in_fourier_space(pt,pt_id) RESULT(vv)
522  IMPLICIT NONE
523  REAL(KIND=8),DIMENSION(2), INTENT(in):: pt
524  INTEGER,DIMENSION(1), INTENT(in) :: pt_id
525  REAL(KIND=8),DIMENSION(2) :: vv
526 
528  RETURN
529  END FUNCTION grad_mu_bar_in_fourier_space
530 
531  !===Analytical permeability, mu in real space (if needed)
532  FUNCTION mu_in_real_space(H_mesh,angles,nb_angles,nb,ne,time) RESULT(vv)
533  IMPLICIT NONE
534  TYPE(mesh_type), INTENT(IN) :: h_mesh
535  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
536  INTEGER, INTENT(IN) :: nb_angles
537  INTEGER, INTENT(IN) :: nb, ne
538  REAL(KIND=8), INTENT(IN) :: time
539  REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
540  REAL(KIND=8) :: r
541 
542  vv = mu_in_real_space_anal_t23(h_mesh,angles,nb_angles,nb,ne)
543  RETURN
544 
545  !===Dummies variables to avoid warning
546  r=time
547  !===Dummies variables to avoid warning
548  END FUNCTION mu_in_real_space
549 
550 END MODULE boundary_test_23
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 s_test_t23(r, z)
Definition: test_23.f90:11
real(kind=8) function, dimension(ne-nb+1) mu_bar_in_fourier_space_anal_t23(H_mesh, nb, ne, pts, pts_ids)
Definition: test_23.f90:31
real(kind=8) function, dimension(2) grad_mu_bar_in_fourier_space_anal_t23(pt, pt_id)
Definition: test_23.f90:73
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(nb_angles, ne-nb+1), public mu_in_real_space(H_mesh, angles, nb_angles, nb, ne, time)
real(kind=8) function, dimension(nb_angles, ne-nb+1) mu_in_real_space_anal_t23(H_mesh, angles, nb_angles, nb, ne)
Definition: test_23.f90:105
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)
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