From ab772fd1712d3d3bf1c21ad97884297f95aa9c0b Mon Sep 17 00:00:00 2001 From: Mauro Rodriguez Date: Sat, 21 Dec 2024 15:58:16 -0600 Subject: [PATCH] ran the MFC format command for PR --- src/common/m_variables_conversion.fpp | 10 +- src/post_process/m_start_up.f90 | 22 +- src/pre_process/include/3dHardcodedIC.fpp | 30 +-- src/pre_process/m_assign_variables.fpp | 6 +- src/pre_process/m_patches.fpp | 8 +- src/simulation/m_boundary_conditions.fpp | 264 +++++++++++----------- src/simulation/m_data_output.fpp | 4 +- src/simulation/m_hyperelastic.fpp | 6 +- src/simulation/m_rhs.fpp | 4 +- 9 files changed, 177 insertions(+), 177 deletions(-) diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index 03d2f3c00..67fa44ec8 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -1044,11 +1044,11 @@ contains #ifdef MFC_POST_PROCESS if (hyperelasticity) then - ! to save von Mises stress instead of elastic internal energy - qK_prim_vf(xiend+1)%sf(j, k, l) = sqrt((3_wp/2_wp)* (qK_prim_vf(strxb)%sf(j, k, l)**2_wp + & - 2_wp*qK_prim_vf(strxb+1)%sf(j, k, l)**2_wp + qK_prim_vf(strxb+2)%sf(j, k, l)**2_wp + & - 2_wp*qK_prim_vf(strxb+3)%sf(j, k, l)**2_wp + 2_wp*qK_prim_vf(strxb+4)%sf(j, k, l)**2_wp + & - qK_prim_vf(strxe)%sf(j, k, l)**2_wp) ) + ! to save von Mises stress instead of elastic internal energy + qK_prim_vf(xiend + 1)%sf(j, k, l) = sqrt((3_wp/2_wp)*(qK_prim_vf(strxb)%sf(j, k, l)**2_wp + & + 2_wp*qK_prim_vf(strxb + 1)%sf(j, k, l)**2_wp + qK_prim_vf(strxb + 2)%sf(j, k, l)**2_wp + & + 2_wp*qK_prim_vf(strxb + 3)%sf(j, k, l)**2_wp + 2_wp*qK_prim_vf(strxb + 4)%sf(j, k, l)**2_wp + & + qK_prim_vf(strxe)%sf(j, k, l)**2_wp)) end if #endif diff --git a/src/post_process/m_start_up.f90 b/src/post_process/m_start_up.f90 index 1e9e36a4d..2672f8f89 100644 --- a/src/post_process/m_start_up.f90 +++ b/src/post_process/m_start_up.f90 @@ -369,7 +369,7 @@ subroutine s_save_data(t_step, varname, pres, c, H) ! Adding the elastic shear stresses to the formatted database file ----- if (elasticity) then if (prim_vars_wrt) then - do i = 1, stress_idx%end - stress_idx%beg + 1 + do i = 1, stress_idx%end - stress_idx%beg + 1 q_sf = q_prim_vf(i - 1 + stress_idx%beg)%sf( & -offset_x%beg:m + offset_x%end, & -offset_y%beg:n + offset_y%end, & @@ -378,12 +378,12 @@ subroutine s_save_data(t_step, varname, pres, c, H) call s_write_variable_to_formatted_database_file(varname, t_step) varname(:) = ' ' - end do + end do end if end if if (hyperelasticity) then if (prim_vars_wrt) then - do i = 1, xiend - xibeg + 1 + do i = 1, xiend - xibeg + 1 q_sf = q_prim_vf(i - 1 + xibeg)%sf( & -offset_x%beg:m + offset_x%end, & -offset_y%beg:n + offset_y%end, & @@ -392,16 +392,16 @@ subroutine s_save_data(t_step, varname, pres, c, H) call s_write_variable_to_formatted_database_file(varname, t_step) varname(:) = ' ' - end do + end do - q_sf = q_prim_vf(xiend+1)%sf( & - -offset_x%beg:m + offset_x%end, & - -offset_y%beg:n + offset_y%end, & - -offset_z%beg:p + offset_z%end) + q_sf = q_prim_vf(xiend + 1)%sf( & + -offset_x%beg:m + offset_x%end, & + -offset_y%beg:n + offset_y%end, & + -offset_z%beg:p + offset_z%end) - write (varname, '(A,I0)') 'vonMises' - call s_write_variable_to_formatted_database_file(varname, t_step) - varname(:) = ' ' + write (varname, '(A,I0)') 'vonMises' + call s_write_variable_to_formatted_database_file(varname, t_step) + varname(:) = ' ' end if end if diff --git a/src/pre_process/include/3dHardcodedIC.fpp b/src/pre_process/include/3dHardcodedIC.fpp index ace0d4628..39dd99266 100644 --- a/src/pre_process/include/3dHardcodedIC.fpp +++ b/src/pre_process/include/3dHardcodedIC.fpp @@ -59,37 +59,37 @@ q_prim_vf(advxb)%sf(i, j, k) = patch_icpp(1)%alpha(1) q_prim_vf(advxe)%sf(i, j, k) = patch_icpp(1)%alpha(2) end if - + case (302) ! (3D lung geometry in X direction - axisym, with smoothing) - lam = 200.E-06_wp + lam = 200.e-06_wp amp = patch_icpp(patch_id)%a2 h = 0.125_wp*amp - + intH = amp/2._wp*(sin(2._wp*pi*y_cc(j)/lam + pi/2._wp) + sin(2._wp*pi*z_cc(k)/lam + pi/2._wp)) - - alph = patch_icpp(2)%alpha(1) + (patch_icpp(1)%alpha(1)-patch_icpp(2)%alpha(1))/(h)*(x_cc(i)-(intH-h/2._wp)) - + + alph = patch_icpp(2)%alpha(1) + (patch_icpp(1)%alpha(1) - patch_icpp(2)%alpha(1))/(h)*(x_cc(i) - (intH - h/2._wp)) + if (x_cc(i) > intH + h/2) then - + q_prim_vf(advxb)%sf(i, j, k) = patch_icpp(1)%alpha(1) q_prim_vf(advxe)%sf(i, j, k) = patch_icpp(1)%alpha(2) q_prim_vf(contxb)%sf(i, j, k) = patch_icpp(1)%alpha_rho(1) q_prim_vf(contxe)%sf(i, j, k) = patch_icpp(1)%alpha_rho(2) q_prim_vf(E_idx)%sf(i, j, k) = patch_icpp(1)%pres - - else if ((x_cc(i) .le. intH + h/2) .and. (x_cc(i) .ge. intH - h/2._wp)) then - + + else if ((x_cc(i) <= intH + h/2) .and. (x_cc(i) >= intH - h/2._wp)) then + q_prim_vf(advxb)%sf(i, j, k) = alph !0.5 q_prim_vf(advxe)%sf(i, j, k) = 1._wp - alph !0.5 q_prim_vf(contxb)%sf(i, j, k) = patch_icpp(1)%alpha_rho(1)/patch_icpp(1)%alpha(1)*alph!0.5 - q_prim_vf(contxe)%sf(i, j, k) = patch_icpp(2)%alpha_rho(2)/patch_icpp(2)%alpha(2)*(1-alph)!0.5 + q_prim_vf(contxe)%sf(i, j, k) = patch_icpp(2)%alpha_rho(2)/patch_icpp(2)%alpha(2)*(1 - alph)!0.5 q_prim_vf(E_idx)%sf(i, j, k) = patch_icpp(1)%pres - + end if - + case (303) ! pre_stress for hyperelasticity, bubble in material - R0ref = 30E-6_wp ! equilibrium radius + R0ref = 30e-6_wp ! equilibrium radius Rinit = patch_icpp(3)%radius ! initial radius x_bcen = patch_icpp(3)%x_centroid y_bcen = patch_icpp(3)%y_centroid @@ -101,7 +101,7 @@ phi = atan2(y_ccs, x_ccs) theta = atan2(sqrt(x_ccs**2._wp + y_ccs**2._wp), z_ccs) !spherical coord, assuming Rmax=1 - xi_sph = (rcoord**3._wp - R0ref**3._wp + Rinit**3._wp)**(1._wp/3._wp) + xi_sph = (rcoord**3._wp - R0ref**3._wp + Rinit**3._wp)**(1._wp/3._wp) xi_cart(1) = xi_sph*sin(theta)*cos(phi) xi_cart(2) = xi_sph*sin(theta)*sin(phi) xi_cart(3) = xi_sph*cos(theta) diff --git a/src/pre_process/m_assign_variables.fpp b/src/pre_process/m_assign_variables.fpp index 3f993a8a0..c2d748b3a 100644 --- a/src/pre_process/m_assign_variables.fpp +++ b/src/pre_process/m_assign_variables.fpp @@ -498,10 +498,10 @@ contains if (hyperelasticity .and. .not. pre_stress) then xi_cart(1) = x_cc(j) if (p > 0) then - xi_cart(2) = y_cc(k) - xi_cart(3) = z_cc(l) + xi_cart(2) = y_cc(k) + xi_cart(3) = z_cc(l) elseif (n > 0) then - xi_cart(2) = y_cc(k) + xi_cart(2) = y_cc(k) end if ! assigning the reference map to the q_prim vector field diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index b41114758..89be2d847 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -1527,8 +1527,8 @@ contains if (x_cc(i) - x_centroid >= 0 & .and. & - r - as(2)*Ps(2) - as(3)*Ps(3) - as(4)*Ps(4) - as(5)*Ps(5) - as(6)*Ps(6) & - - as(7)*Ps(7) - as(8)*Ps(8) - as(9)*Ps(9) <= radius .and. & + r - as(2)*Ps(2) - as(3)*Ps(3) - as(4)*Ps(4) - as(5)*Ps(5) - as(6)*Ps(6) & + - as(7)*Ps(7) - as(8)*Ps(8) - as(9)*Ps(9) <= radius .and. & patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, 0))) & then call s_assign_patch_primitive_variables(patch_id, i, j, 0, & @@ -1536,8 +1536,8 @@ contains elseif (x_cc(i) - x_centroid < 0 & .and. & - r - as(2)*Ps(2) + as(3)*Ps(3) - as(4)*Ps(4) + as(5)*Ps(5) - as(6)*Ps(6) & - + as(7)*Ps(7) - as(8)*Ps(8) + as(9)*Ps(9) <= radius & + r - as(2)*Ps(2) + as(3)*Ps(3) - as(4)*Ps(4) + as(5)*Ps(5) - as(6)*Ps(6) & + + as(7)*Ps(7) - as(8)*Ps(8) + as(9)*Ps(9) <= radius & .and. & patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, 0))) & then diff --git a/src/simulation/m_boundary_conditions.fpp b/src/simulation/m_boundary_conditions.fpp index d579b15c8..fb4dae0bb 100644 --- a/src/simulation/m_boundary_conditions.fpp +++ b/src/simulation/m_boundary_conditions.fpp @@ -228,38 +228,38 @@ contains if (bc_loc == -1) then !bc_x%beg - !$acc parallel loop collapse(4) gang vector default(present) - do i = 1, sys_size - do l = 0, p - do k = 0, n - do j = 1, buff_size - q_prim_vf(i)%sf(-j, k, l) = & - q_prim_vf(i)%sf(0, k, l) + !$acc parallel loop collapse(4) gang vector default(present) + do i = 1, sys_size + do l = 0, p + do k = 0, n + do j = 1, buff_size + q_prim_vf(i)%sf(-j, k, l) = & + q_prim_vf(i)%sf(0, k, l) + end do end do - end do - end do - end do + end do + end do + + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = 0, p + do k = 0, n + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum - dx(-q) + end do + q_prim_vf(i)%sf(-j, k, l) = & + q_prim_vf(i)%sf(0, k, l) - bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = 0, p - do k = 0, n - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum - dx(-q) - end do - q_prim_vf(i)%sf(-j, k, l) = & - q_prim_vf(i)%sf(0, k, l) - bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if - else !< bc_x%end !$acc parallel loop collapse(4) gang vector default(present) @@ -269,30 +269,30 @@ contains do j = 1, buff_size q_prim_vf(i)%sf(m + j, k, l) = & q_prim_vf(i)%sf(m, k, l) - end do + end do end do end do end do - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = 0, p - do k = 0, n - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum + dx(m + q) - end do - q_prim_vf(i)%sf(m + j, k, l) = & - q_prim_vf(i)%sf(m, k, l) + bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = 0, p + do k = 0, n + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum + dx(m + q) + end do + q_prim_vf(i)%sf(m + j, k, l) = & + q_prim_vf(i)%sf(m, k, l) + bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if end if !< y-direction ========================================================= @@ -307,30 +307,30 @@ contains do l = -buff_size, m + buff_size q_prim_vf(i)%sf(l, -j, k) = & q_prim_vf(i)%sf(l, 0, k) - end do + end do end do end do end do - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = -buff_size, m + buff_size - do k = 0, p - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum - dy(-q) - end do - q_prim_vf(i)%sf(l, -j, k) = & - q_prim_vf(i)%sf(l, 0, k) - bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = -buff_size, m + buff_size + do k = 0, p + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum - dy(-q) + end do + q_prim_vf(i)%sf(l, -j, k) = & + q_prim_vf(i)%sf(l, 0, k) - bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if else !< bc_y%end @@ -346,26 +346,26 @@ contains end do end do - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = -buff_size, m + buff_size - do k = 0, p - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum + dy(n + q) - end do - q_prim_vf(i)%sf(l, n + j, k) = & - q_prim_vf(i)%sf(l, n, k) + bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if - + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = -buff_size, m + buff_size + do k = 0, p + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum + dy(n + q) + end do + q_prim_vf(i)%sf(l, n + j, k) = & + q_prim_vf(i)%sf(l, n, k) + bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if + end if !< z-direction ========================================================= @@ -380,31 +380,31 @@ contains do k = -buff_size, m + buff_size q_prim_vf(i)%sf(k, l, -j) = & q_prim_vf(i)%sf(k, l, 0) - end do + end do end do end do end do - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = -buff_size, n + buff_size - do k = -buff_size, m + buff_size - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum - dx(-q) - end do - q_prim_vf(i)%sf(k, l, -j) = & - q_prim_vf(i)%sf(k, l, 0) - bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if - else !< bc_z%end + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = -buff_size, n + buff_size + do k = -buff_size, m + buff_size + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum - dx(-q) + end do + q_prim_vf(i)%sf(k, l, -j) = & + q_prim_vf(i)%sf(k, l, 0) - bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if + else !< bc_z%end !$acc parallel loop collapse(4) gang vector default(present) do i = 1, sys_size @@ -413,31 +413,31 @@ contains do k = -buff_size, m + buff_size q_prim_vf(i)%sf(k, l, p + j) = & q_prim_vf(i)%sf(k, l, p) - end do + end do end do end do end do - if (hyperelasticity) then - !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) - do j = 1, buff_size - do l = -buff_size, n + buff_size - do k = -buff_size, m + buff_size - do i = xibeg, xiend - bc_sum = 0_wp - !$acc loop seq - do q = 1, j - bc_sum = bc_sum + dz(p + q) - end do - q_prim_vf(i)%sf(k, l, p + j) = & - q_prim_vf(i)%sf(k, l, p) + bc_sum - end do - end do - end do - end do - !$acc end parallel loop - end if - + if (hyperelasticity) then + !$acc parallel loop collapse(4) gang vector default(present), private(bc_sum) + do j = 1, buff_size + do l = -buff_size, n + buff_size + do k = -buff_size, m + buff_size + do i = xibeg, xiend + bc_sum = 0_wp + !$acc loop seq + do q = 1, j + bc_sum = bc_sum + dz(p + q) + end do + q_prim_vf(i)%sf(k, l, p + j) = & + q_prim_vf(i)%sf(k, l, p) + bc_sum + end do + end do + end do + end do + !$acc end parallel loop + end if + end if end if diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 49ae6923c..f5579e3e2 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -322,7 +322,7 @@ contains !$acc end kernels end if #endif - + ! Determining global stability criteria extrema at current time-step if (num_procs > 1) then call s_mpi_reduce_stability_criteria_extrema(icfl_max_loc, & @@ -338,7 +338,7 @@ contains if (viscous) vcfl_max_glb = vcfl_max_loc if (viscous) Rc_min_glb = Rc_min_loc end if - + ! Determining the stability criteria extrema over all the time-steps if (icfl_max_glb > icfl_max) icfl_max = icfl_max_glb diff --git a/src/simulation/m_hyperelastic.fpp b/src/simulation/m_hyperelastic.fpp index fb1a2bd0f..bbd7028c4 100644 --- a/src/simulation/m_hyperelastic.fpp +++ b/src/simulation/m_hyperelastic.fpp @@ -112,9 +112,9 @@ contains !$acc parallel loop collapse(3) gang vector default(present) private(alpha_K, alpha_rho_K, & !$acc rho, gamma, pi_inf, qv, G, Re, tensora, tensorb) - do l = 0, p-2 - do k = 0, n-2 - do j = 2, m-2 + do l = 0, p - 2 + do k = 0, n - 2 + do j = 2, m - 2 !$acc loop seq do i = 1, num_fluids alpha_rho_k(i) = q_cons_vf(i)%sf(j, k, l) diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index 8a746c14e..f0dd58316 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -675,9 +675,9 @@ contains call nvtxEndRange call nvtxStartRange("RHS-ELASTIC") - if (hyperelasticity) then + if (hyperelasticity) then call s_hyperelastic_rmt_stress_update(q_cons_qp%vf, q_prim_qp%vf) - call s_populate_variables_buffers(q_prim_qp%vf, pb, mv) + call s_populate_variables_buffers(q_prim_qp%vf, pb, mv) end if call nvtxEndRange