compute_ghost_cell_centroid Subroutine

private subroutine compute_ghost_cell_centroid(cells, nodes)

Compute cell center of all cell including ghost cells

Arguments

Type IntentOptional AttributesName
type(celltype), intent(out), dimension(-2:imx+2,-2:jmx+2,-2:kmx+2):: cells

Cell center quanties: volume and coordiantes of cell center

type(nodetype), intent(in), dimension(-2:imx+3,-2:jmx+3,-2:kmx+3):: nodes

Grid points


Called by

proc~~compute_ghost_cell_centroid~~CalledByGraph proc~compute_ghost_cell_centroid compute_ghost_cell_centroid proc~setup_geometry setup_geometry proc~setup_geometry->proc~compute_ghost_cell_centroid proc~setup_solver setup_solver proc~setup_solver->proc~setup_geometry proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents


Source Code

        subroutine compute_ghost_cell_centroid(cells, nodes)
          !< Compute cell center of all cell including ghost cells
          implicit none
          type(celltype), dimension(-2:imx+2,-2:jmx+2,-2:kmx+2), intent(out) :: cells
          !< Cell center quanties: volume and coordiantes of cell center
          type(nodetype), dimension(-2:imx+3,-2:jmx+3,-2:kmx+3), intent(in)  :: nodes
          !< Grid points
          integer :: i,j,k

          do k = -2, kmx+2
            do j = -2, jmx+2
              do i = -2, imx+2
                cells(i,j,k)%centerx = 0.125 *( nodes(i  ,j  ,k  )%x &
                                              + nodes(i+1,j  ,k  )%x &
                                              + nodes(i+1,j+1,k  )%x &
                                              + nodes(i+1,j+1,k+1)%x &
                                              + nodes(i+1,j  ,k+1)%x &
                                              + nodes(i  ,j+1,k  )%x &
                                              + nodes(i  ,j+1,k+1)%x &
                                              + nodes(i  ,j  ,k+1)%x &
                                              )

                cells(i,j,k)%centery = 0.125 *( nodes(i  ,j  ,k  )%y &
                                              + nodes(i+1,j  ,k  )%y &
                                              + nodes(i+1,j+1,k  )%y &
                                              + nodes(i+1,j+1,k+1)%y &
                                              + nodes(i+1,j  ,k+1)%y &
                                              + nodes(i  ,j+1,k  )%y &
                                              + nodes(i  ,j+1,k+1)%y &
                                              + nodes(i  ,j  ,k+1)%y &
                                              )

                cells(i,j,k)%centerz = 0.125 *( nodes(i  ,j  ,k  )%z  &
                                              + nodes(i+1,j  ,k  )%z  &
                                              + nodes(i+1,j+1,k  )%z  &
                                              + nodes(i+1,j+1,k+1)%z  &
                                              + nodes(i+1,j  ,k+1)%z  &
                                              + nodes(i  ,j+1,k  )%z  &
                                              + nodes(i  ,j+1,k+1)%z  &
                                              + nodes(i  ,j  ,k+1)%z  &
                                              )
              end do
            end do
          end do

        end subroutine compute_ghost_cell_centroid