pressure_matvec Subroutine

private subroutine pressure_matvec(mesh, flow, bc, x, local_ax)

Uses

  • proc~~pressure_matvec~~UsesGraph proc~pressure_matvec mod_flow_projection::pressure_matvec module~mod_profiler mod_profiler proc~pressure_matvec->module~mod_profiler iso_fortran_env iso_fortran_env module~mod_profiler->iso_fortran_env module~mod_kinds mod_kinds module~mod_profiler->module~mod_kinds mpi_f08 mpi_f08 module~mod_profiler->mpi_f08 module~mod_kinds->iso_fortran_env

Sparse Matrix-Vector multiplication for the Laplacian operator.

This routine uses the pressure_cache to perform efficient off-diagonal products on the MPI-owned partition.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(in) :: flow
type(bc_set_t), intent(in) :: bc
real(kind=rk), intent(in) :: x(:)
real(kind=rk), intent(out) :: local_ax(:)

Calls

proc~~pressure_matvec~~CallsGraph proc~pressure_matvec mod_flow_projection::pressure_matvec proc~ensure_pressure_operator_cache mod_flow_projection::ensure_pressure_operator_cache proc~pressure_matvec->proc~ensure_pressure_operator_cache proc~profiler_start mod_profiler::profiler_start proc~pressure_matvec->proc~profiler_start proc~profiler_stop mod_profiler::profiler_stop proc~pressure_matvec->proc~profiler_stop mpi_allreduce mpi_allreduce proc~ensure_pressure_operator_cache->mpi_allreduce proc~boundary_pressure_type mod_bc::boundary_pressure_type proc~ensure_pressure_operator_cache->proc~boundary_pressure_type proc~face_effective_neighbor mod_bc::face_effective_neighbor proc~ensure_pressure_operator_cache->proc~face_effective_neighbor proc~face_normal_distance mod_flow_projection::face_normal_distance proc~ensure_pressure_operator_cache->proc~face_normal_distance proc~fatal_error mod_kinds::fatal_error proc~ensure_pressure_operator_cache->proc~fatal_error proc~finalize_flow_projection_workspace mod_flow_projection::finalize_flow_projection_workspace proc~ensure_pressure_operator_cache->proc~finalize_flow_projection_workspace proc~patch_type_for_face mod_bc::patch_type_for_face proc~ensure_pressure_operator_cache->proc~patch_type_for_face mpi_wtime mpi_wtime proc~profiler_start->mpi_wtime proc~find_or_create_timer mod_profiler::find_or_create_timer proc~profiler_start->proc~find_or_create_timer proc~profiler_stop->mpi_wtime proc~profiler_stop->proc~find_or_create_timer proc~record_edge mod_profiler::record_edge proc~profiler_stop->proc~record_edge proc~is_periodic_face mod_bc::is_periodic_face proc~face_effective_neighbor->proc~is_periodic_face proc~face_normal_distance->proc~fatal_error proc~face_normal_distance->proc~patch_type_for_face proc~outward_normal mod_flow_projection::outward_normal proc~face_normal_distance->proc~outward_normal proc~is_periodic_face->proc~patch_type_for_face

Called by

proc~~pressure_matvec~~CalledByGraph proc~pressure_matvec mod_flow_projection::pressure_matvec proc~solve_pressure_correction mod_flow_projection::solve_pressure_correction proc~solve_pressure_correction->proc~pressure_matvec proc~advance_projection_step mod_flow_projection::advance_projection_step proc~advance_projection_step->proc~solve_pressure_correction program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~advance_projection_step

Source Code

   subroutine pressure_matvec(mesh, flow, bc, x, local_ax)
      use mod_profiler, only : profiler_start, profiler_stop
      type(mesh_t), intent(in) :: mesh
      type(flow_mpi_t), intent(in) :: flow
      type(bc_set_t), intent(in) :: bc
      real(rk), intent(in) :: x(:)
      real(rk), intent(out) :: local_ax(:)

      integer :: c, lf, nb

      call profiler_start('Pressure_Matvec')
      call ensure_pressure_operator_cache(mesh, flow, bc)

      local_ax = zero

      do c = flow%first_cell, flow%last_cell
         if (c == 1 .and. .not. pressure_cache%has_dirichlet_pressure) then
            local_ax(c) = x(c)
            cycle
         end if

         local_ax(c) = pressure_cache%diag(c) * x(c)

         do lf = 1, mesh%ncell_faces(c)
            nb = pressure_cache%nb(lf, c)
            if (nb <= 0) cycle

            local_ax(c) = local_ax(c) - pressure_cache%coeff(lf, c) * x(nb)
         end do
      end do
      call profiler_stop('Pressure_Matvec')
   end subroutine pressure_matvec