14 temp_mesh, tempn_m1, tempn, chmp_vit, vol_heat_capacity, &
15 temp_diffusivity, my_par_cc, temp_list_dirichlet_sides, temp_per)
32 REAL(KIND=8) :: time, dt
33 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
38 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(INOUT) :: tempn_m1, tempn
39 INTEGER,
DIMENSION(:),
INTENT(IN) :: temp_list_dirichlet_sides
40 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: vol_heat_capacity, temp_diffusivity
41 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(IN) :: chmp_vit
42 LOGICAL,
SAVE :: once = .true.
43 INTEGER,
SAVE :: m_max_c
44 INTEGER,
DIMENSION(:),
POINTER,
SAVE :: temp_js_d
45 INTEGER,
SAVE :: my_petscworld_rank
46 REAL(KIND=8),
SAVE :: mass0, hmoy
50 INTEGER,
POINTER,
DIMENSION(:) :: temp_1_ifrom
51 INTEGER :: i, m, n, l, index
54 REAL(KIND=8),
DIMENSION(temp_mesh%np) :: ff
55 REAL(KIND=8),
DIMENSION(temp_mesh%np, 2) :: tempn_p1
56 REAL(KIND=8),
DIMENSION(temp_mesh%gauss%l_G*temp_mesh%me,2, SIZE(list_mode)) :: ff_conv
57 REAL(KIND=8) ::tps, tps_tot, tps_cumul
58 REAL(KIND=8) :: one, zero, three
59 DATA zero, one, three/0.d0,1.d0,3.d0/
60 REAL(KIND=8),
DIMENSION(2,temp_mesh%gauss%l_G*temp_mesh%me) :: rr_gauss
61 INTEGER,
DIMENSION(temp_mesh%gauss%n_w) :: j_loc
63 #include "petsc/finclude/petsc.h"
64 petscerrorcode :: ierr
65 mpi_comm,
DIMENSION(:),
POINTER :: comm_one_d
66 mat,
DIMENSION(:),
POINTER,
SAVE :: temp_mat
67 vec,
SAVE :: cb_1, cb_2, cx_1, cx_1_ghost
68 ksp,
DIMENSION(:),
POINTER,
SAVE :: temp_ksp
75 CALL mpi_comm_rank(petsc_comm_world,my_petscworld_rank,code)
80 CALL veccreateghost(comm_one_d(1), n, &
81 petsc_determine,
SIZE(temp_1_ifrom), temp_1_ifrom, cx_1, ierr)
82 CALL vecghostgetlocalform(cx_1, cx_1_ghost, ierr)
83 CALL vecduplicate(cx_1, cb_1, ierr)
84 CALL vecduplicate(cx_1, cb_2, ierr)
88 m_max_c =
SIZE(list_mode)
97 DO m = 1, temp_mesh%dom_me
98 hmoy = hmoy + sqrt(sum(temp_mesh%gauss%rj(:,m)))/2
100 hmoy = hmoy/temp_mesh%dom_me
105 CALL
mass_tot(comm_one_d(1),temp_mesh, tempn(:,1,i), mass0)
111 ALLOCATE(temp_mat(m_max_c),temp_ksp(m_max_c))
119 1.5/dt, zero, mode, temp_mat(i))
121 IF (temp_per%n_bord/=0)
THEN
127 CALL
init_solver(my_par_cc,temp_ksp(i),temp_mat(i),comm_one_d(1),&
128 solver=my_par_cc%solver,precond=my_par_cc%precond)
137 CALL
smb_ugradc_gauss_fft_par(comm_one_d(2),temp_mesh,list_mode,vol_heat_capacity,chmp_vit,2*tempn-tempn_m1,ff_conv)
138 tps =
user_time() - tps; tps_cumul=tps_cumul+tps
142 DO m = 1, temp_mesh%me
143 j_loc = temp_mesh%jj(:,m)
144 DO l = 1, temp_mesh%gauss%l_G
146 rr_gauss(1,index) = sum(temp_mesh%rr(1,j_loc)*temp_mesh%gauss%ww(:,l))
147 rr_gauss(2,index) = sum(temp_mesh%rr(2,j_loc)*temp_mesh%gauss%ww(:,l))
155 ff = (2/dt)*tempn(:,1,i) - (1/(2*dt))*tempn_m1(:,1,i)
156 CALL
qs_00_gauss(temp_mesh, temp_1_la, vol_heat_capacity, ff, &
159 ff = (2/dt)*tempn(:,2,i) - (1/(2*dt))*tempn_m1(:,2,i)
160 CALL
qs_00_gauss(temp_mesh, temp_1_la, vol_heat_capacity, ff, &
164 IF (temp_per%n_bord/=0)
THEN
165 CALL
periodic_rhs_petsc(temp_per%n_bord, temp_per%list, temp_per%perlist, cb_1, temp_1_la)
166 CALL
periodic_rhs_petsc(temp_per%n_bord, temp_per%list, temp_per%perlist, cb_2, temp_1_la)
175 tps =
user_time() - tps; tps_cumul=tps_cumul+tps
182 CALL
solver(temp_ksp(i),cb_1,cx_1,reinit=.false.,
verbose=my_par_cc%verbose)
183 CALL vecghostupdatebegin(cx_1,insert_values,scatter_forward,ierr)
184 CALL vecghostupdateend(cx_1,insert_values,scatter_forward,ierr)
185 CALL
extract(cx_1_ghost,1,1,temp_1_la,tempn_p1(:,1))
188 CALL
solver(temp_ksp(i),cb_2,cx_1,reinit=.false.,
verbose=my_par_cc%verbose)
189 CALL vecghostupdatebegin(cx_1,insert_values,scatter_forward,ierr)
190 CALL vecghostupdateend(cx_1,insert_values,scatter_forward,ierr)
191 CALL
extract(cx_1_ghost,1,1,temp_1_la,tempn_p1(:,2))
192 tps =
user_time() - tps; tps_cumul=tps_cumul+tps
206 tempn_m1(:,:,i) = tempn(:,:,i)
207 tempn(:,:,i) = tempn_p1
222 tps =
user_time() - tps; tps_cumul=tps_cumul+tps
242 INTEGER,
DIMENSION(:),
INTENT(IN) :: list_mode
243 REAL(KIND=8),
DIMENSION(:),
INTENT(IN) :: heat_capa_in
244 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(IN) :: v_in, c_in
245 REAL(KIND=8),
DIMENSION(:,:,:),
INTENT(OUT) :: c_out
246 REAL(KIND=8),
DIMENSION(mesh%gauss%l_G*mesh%me,6,SIZE(list_mode)) :: gradc, w
247 REAL(KIND=8),
DIMENSION(mesh%gauss%l_G*mesh%me,2,SIZE(list_mode)) :: div, cgauss, cint
248 INTEGER,
DIMENSION(mesh%gauss%n_w) :: j_loc
249 REAL(KIND=8),
DIMENSION(mesh%gauss%k_d,mesh%gauss%n_w) :: dw_loc
250 INTEGER :: m, l , i, mode, index, k
251 REAL(KIND=8),
DIMENSION(mesh%gauss%n_w,6) :: vs
252 REAL(KIND=8),
DIMENSION(mesh%gauss%n_w,2) :: cs
253 INTEGER,
DIMENSION(:,:),
POINTER :: jj
254 INTEGER,
POINTER :: me
255 REAL(KIND=8) :: ray, tps
256 REAL(KIND=8),
DIMENSION(3) :: temps
257 INTEGER :: code, m_max_pad, bloc_size, nb_procs
258 #include "petsc/finclude/petsc.h"
259 mpi_comm :: communicator
266 DO i = 1,
SIZE(list_mode)
269 DO m = 1, mesh%dom_me
272 vs(:,k) = v_in(j_loc,k,i)
275 cs(:,k) = c_in(j_loc,k,i)
282 ray = sum(mesh%rr(1,j_loc)*ww(:,l))
285 w(index,1,i) = sum(vs(:,1)*ww(:,l))
286 w(index,3,i) = sum(vs(:,3)*ww(:,l))
287 w(index,5,i) = sum(vs(:,5)*ww(:,l))
289 w(index,2,i) = sum(vs(:,2)*ww(:,l))
290 w(index,4,i) = sum(vs(:,4)*ww(:,l))
291 w(index,6,i) = sum(vs(:,6)*ww(:,l))
293 div(index,1,i) = sum(vs(:,1)*dw_loc(1,:)) + sum(vs(:,1)*ww(:,l))/ray &
294 + (mode/ray)*sum(vs(:,4)*ww(:,l)) + sum(vs(:,5)*dw_loc(2,:))
295 div(index,2,i) = sum(vs(:,2)*dw_loc(1,:)) + sum(vs(:,2)*ww(:,l))/ray &
296 - (mode/ray)*sum(vs(:,3)*ww(:,l)) + sum(vs(:,6)*dw_loc(2,:))
300 gradc(index,1,i) = sum(cs(:,1)*dw_loc(1,:))
301 gradc(index,2,i) = sum(cs(:,2)*dw_loc(1,:))
302 gradc(index,3,i) = mode/ray*sum(cs(:,2)*ww(:,l))
303 gradc(index,4,i) = -mode/ray*sum(cs(:,1)*ww(:,l))
304 gradc(index,5,i) = sum(cs(:,1)*dw_loc(2,:))
305 gradc(index,6,i) = sum(cs(:,2)*dw_loc(2,:))
307 gradc(index,:,i) = heat_capa_in(m) * gradc(index,:,i)
309 cgauss(index,1,i) = sum(cs(:,1)*ww(:,l))
310 cgauss(index,2,i) = sum(cs(:,2)*ww(:,l))
312 cgauss(index,:,i) = heat_capa_in(m) * cgauss(index,:,i)
323 CALL mpi_comm_size(communicator, nb_procs, code)
324 bloc_size =
SIZE(gradc,1)/nb_procs+1
325 m_max_pad = 3*
SIZE(list_mode)*nb_procs/2
327 bloc_size =
SIZE(div,1)/nb_procs+1
328 CALL
fft_par_prod_dcl(communicator, div, cgauss, cint, nb_procs, bloc_size, m_max_pad, temps)
344 REAL(KIND=8),
DIMENSION(:) ,
INTENT(IN) :: tempn
345 REAL(KIND=8) ,
INTENT(OUT) :: reslt
346 REAL(KIND=8) :: r_loc, r_out
347 INTEGER :: m, l , i , ni, code
348 INTEGER,
DIMENSION(mesh%gauss%n_w) :: j_loc
350 #include "petsc/finclude/petsc.h"
351 mpi_comm :: communicator
354 DO m = 1, mesh%dom_me
356 DO l = 1, mesh%gauss%l_G
358 DO ni = 1, mesh%gauss%n_w; i = j_loc(ni)
359 ray = ray + mesh%rr(1,i)*mesh%gauss%ww(ni,l)
362 r_loc = r_loc + sum(tempn(j_loc(:))*mesh%gauss%ww(:,l))*ray*mesh%gauss%rj(l,m)
367 CALL mpi_allreduce(r_loc,r_out,1,mpi_double_precision, mpi_sum, communicator, code)
subroutine qs_00_gauss(mesh, LA, heat_capa, ff, ff_gauss, vect)
subroutine, public fft_par_dot_prod_dcl(communicator, V1_in, V2_in, c_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine, public create_my_ghost(mesh, LA, ifrom)
subroutine dirichlet_rhs(js_D, bs_D, b)
subroutine, public fft_par_prod_dcl(communicator, c1_in, c2_in, c_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine init_solver(my_par, my_ksp, matrix, communicator, solver, precond, opt_re_init)
subroutine dirichlet_nodes_parallel(mesh, list_dirichlet_sides, js_d)
subroutine solver(my_ksp, b, x, reinit, verbose)
subroutine dirichlet_m_parallel(matrix, glob_js_D)
subroutine qs_diff_mass_scal_m_variant(mesh, LA, heat_capa, visco, mass, stab, mode, matrix)
real(kind=8) function, dimension(size(rr, 2)), public temperature_exact(TYPE, rr, m, t)
real(kind=8) function, dimension(size(rr, 2)), public source_in_temperature(TYPE, rr, m, t)
subroutine, public three_level_temperature(comm_one_d, time, temp_1_LA, dt, list_mode, temp_mesh, tempn_m1, tempn, chmp_vit, vol_heat_capacity, temp_diffusivity, my_par_cc, temp_list_dirichlet_sides, temp_per)
real(kind=8) function user_time()
subroutine, public periodic_rhs_petsc(n_bord, list, perlist, v_rhs, LA)
subroutine mass_tot(communicator, mesh, tempn, RESLT)
subroutine, public periodic_matrix_petsc(n_bord, list, perlist, matrix, LA)
subroutine, public extract(xghost, ks, ke, LA, phi)
subroutine create_local_petsc_matrix(communicator, LA, matrix, clean)
subroutine smb_ugradc_gauss_fft_par(communicator, mesh, list_mode, V_in, c_in, nb_procs, c_out)