lagrangian_set_SetFilterSize Subroutine

private impure subroutine lagrangian_set_SetFilterSize(this, l_filter)

Adjusts the filter half size. Note that the block needs to contain enough ghost cells to be able to represent a filter kernel centered on the edge of the domain. Otherwise, an error will be returnned. The larger the filter size, the more ghost cells are required.

Type Bound

lagrangian_set

Arguments

Type IntentOptional Attributes Name
class(lagrangian_set), intent(inout) :: this

Set of Lagrangian objects

real(kind=wp), intent(in) :: l_filter

Filter size


Called by

proc~~lagrangian_set_setfiltersize~~CalledByGraph proc~lagrangian_set_setfiltersize lagrangian_set%lagrangian_set_SetFilterSize proc~marker_set_prepare marker_set%marker_set_Prepare proc~marker_set_prepare->proc~lagrangian_set_setfiltersize proc~particle_set_prepare particle_set%particle_set_Prepare proc~particle_set_prepare->proc~lagrangian_set_setfiltersize proc~solid_set_setfiltersize solid_set%solid_set_SetFilterSize proc~solid_set_setfiltersize->proc~lagrangian_set_setfiltersize proc~grans_obj_preparesolver grans_obj_PrepareSolver proc~grans_obj_preparesolver->proc~marker_set_prepare interface~grans_obj_preparesolver grans_obj%grans_obj_PrepareSolver interface~grans_obj_preparesolver->proc~grans_obj_preparesolver

Source Code

    impure subroutine lagrangian_set_SetFilterSize(this,l_filter)
      !> Adjusts the filter half size.
      ! Note that the block needs to contain enough ghost cells
      ! to be able to represent a filter kernel centered on the
      ! edge of the domain. Otherwise, an error will be returnned.
      ! The larger the filter size, the more ghost cells are required.
      implicit none
      class(lagrangian_set), intent(inout) :: this                             !! Set of Lagrangian objects
      real(wp),              intent(in)    :: l_filter                         !! Filter size
      ! Work variables
      real(wp) :: min_grid_spacing

      this%l_filter=l_filter

      ! Get minimum grid_spacing
      min_grid_spacing=minval(this%block%dx)

      ! Adjust stencil size
      this%stib = 1 + 2*ceiling(l_filter/min_grid_spacing)

      ! Check there are enough ghost cells
      if (this%block%ngc.lt.this%stib/2) call this%parallel%Stop('Insufficient number of ghost cells for filtering.')

      return
    end subroutine lagrangian_set_SetFilterSize