op_obj_div Function

private impure function op_obj_div(this, name, in1, in2, in3) result(out)

Computes the divergence of a vector (in1,in2,in3). This function takes in1,in2,in3 cell-centered (stag=0) and returns the divergence on cell centers (stag=0)

Type Bound

op_obj

Arguments

Type IntentOptional Attributes Name
class(op_obj), intent(in) :: this

Differential operators utility

character(len=*), intent(in) :: name

Name to give this variable

type(eulerian_obj_r), intent(in) :: in1

Component in 1-dir

type(eulerian_obj_r), intent(in) :: in2

Component in 2-dir

type(eulerian_obj_r), intent(in) :: in3

Component in 3-dir

Return Value type(eulerian_obj_r)

Result


Calls

proc~~op_obj_div~~CallsGraph proc~op_obj_div op_obj%op_obj_div proc~eulerian_obj_init eulerian_obj_base%eulerian_obj_Init proc~op_obj_div->proc~eulerian_obj_init

Called by

proc~~op_obj_div~~CalledByGraph proc~op_obj_div op_obj%op_obj_div proc~marker_set_computesolidvolfrac marker_set%marker_set_ComputeSolidVolFrac proc~marker_set_computesolidvolfrac->proc~op_obj_div

Source Code

    impure function op_obj_div(this,name,in1,in2,in3) result(out)
      !> Computes the divergence of a vector (in1,in2,in3).
      ! This function takes in1,in2,in3 cell-centered (stag=0)
      ! and returns the divergence on cell centers (stag=0)
      class(op_obj),        intent(in) :: this                                 !! Differential operators utility
      character(len=*),     intent(in) :: name                                 !! Name to give this variable
      type(eulerian_obj_r), intent(in) :: in1                                  !! Component in 1-dir
      type(eulerian_obj_r), intent(in) :: in2                                  !! Component in 2-dir
      type(eulerian_obj_r), intent(in) :: in3                                  !! Component in 3-dir
      type(eulerian_obj_r)             :: out                                  !! Result
      ! Work variables
      integer :: i,j,k,n,m

      call out%Initialize(name,this%block,this%parallel, 0 )

      associate (lo => this%block%lo, hi => this%block%hi )
        do k=lo(3),hi(3)
          do j=lo(2),hi(2)
            do i=lo(1),hi(1)
              do n=-this%st+1,this%st
                do m=-this%st,this%st-1
                  out%cell(i,j,k) = out%cell(i,j,k)                               &
                    + this%c_d1dx1(n,i)*this%c_intrp1m(m,i+n)*in1%cell(i+n+m,j,k) &
                    + this%c_d1dx2(n,j)*this%c_intrp2m(m,j+n)*in2%cell(i,j+n+m,k) &
                    + this%c_d1dx3(n,k)*this%c_intrp3m(m,k+n)*in3%cell(i,j,k+n+m)
                end do
              end do
            end do
          end do
        end do
      end associate

      return
    end function op_obj_div