setup_grid Subroutine

public subroutine setup_grid(files, nodes, control, bc, dims)

Read the grid file and initialize the grid

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files

Files' name and handler

type(nodetype), intent(out), dimension(:,:,:), allocatable:: nodes

Grid points

type(controltype), intent(in) :: control

Control parameters

type(boundarytype), intent(inout) :: bc

boundary conditions and fixed values

type(extent), intent(out) :: dims

Extent of the domain:imx,jmx,kmx


Calls

proc~~setup_grid~~CallsGraph proc~setup_grid setup_grid proc~ghost_grid ghost_grid proc~setup_grid->proc~ghost_grid proc~extract_grid_size extract_grid_size proc~setup_grid->proc~extract_grid_size debugcall debugcall proc~setup_grid->debugcall proc~read_interface_map read_interface_map proc~setup_grid->proc~read_interface_map proc~populate_grid_points populate_grid_points proc~setup_grid->proc~populate_grid_points proc~ghost_grid->debugcall proc~extract_grid_size->debugcall proc~change_map_to_particular_range change_map_to_particular_range proc~read_interface_map->proc~change_map_to_particular_range proc~read_periodic_bc_file read_periodic_bc_file proc~read_interface_map->proc~read_periodic_bc_file proc~populate_grid_points->debugcall

Called by

proc~~setup_grid~~CalledByGraph proc~setup_grid setup_grid proc~setup_solver setup_solver proc~setup_solver->proc~setup_grid proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

        subroutine setup_grid(files, nodes, control, bc, dims)
            !< Read the grid file and initialize the grid
            !-----------------------------------------------------------

            implicit none
            type(filetype), intent(in) :: files
            !< Files' name and handler
            type(controltype), intent(in) :: control
            !< Control parameters
            type(boundarytype), intent(inout) :: bc
            !< boundary conditions and fixed values
            type(nodetype), dimension(:,:,:), allocatable, intent(out) :: nodes
            !< Grid points 
            type(extent), intent(out) :: dims
            !< Extent of the domain:imx,jmx,kmx
            
            DebugCall('setup_grid')

            open(files%GRID_FILE_UNIT, file=files%gridfile)

            call extract_grid_size(files%GRID_FILE_UNIT, dims)

            ! allocate memory for storing grid points
            allocate(nodes(-2:dims%imx+3, -2:dims%jmx+3, -2:dims%kmx+3))

            !read interface mapping
            call read_interface_map(files, control, bc, dims)

            ! ghost grid exchange
            call populate_grid_points(files%GRID_FILE_UNIT, nodes, dims)

            close(files%GRID_FILE_UNIT)

            ! populate ghost grid points
            call ghost_grid(nodes, dims)

        
        end subroutine setup_grid