Read mapping file in the system/mesh/layout/mapping.txt
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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(extent), | intent(in) | :: | dims | Extent of the domain:imx,jmx,kmx |
subroutine read_interface_map(files, control, bc, dims)
!< Read mapping file in the system/mesh/layout/mapping.txt
implicit none
type(filetype), intent(in) :: files
!< Files' name and handler
type(controltype), intent(in) :: control
!< Control parameters
type(extent), intent(in) :: dims
!< Extent of the domain:imx,jmx,kmx
type(boundarytype), intent(inout) :: bc
!< boundary conditions and fixed values
integer :: ios
integer :: max_call
integer :: i
integer :: b1,b2,f1,f2
integer :: s11,s12,s21,s22
integer :: e11,e12,e21,e22
integer :: switch
integer :: class
!--- initialize indicies --!
max_call = control%total_process*6
ilo(1) = 1 ; ihi(1) = 1
ilo(2) = dims%imx; ihi(2) = dims%imx
ilo(3) = 1 ; ihi(3) = dims%imx
ilo(4) = 1 ; ihi(4) = dims%imx
ilo(5) = 1 ; ihi(5) = dims%imx
ilo(6) = 1 ; ihi(6) = dims%imx
jlo(1) = 1 ; jhi(1) = dims%jmx
jlo(2) = 1 ; jhi(2) = dims%jmx
jlo(3) = 1 ; jhi(3) = 1
jlo(4) = dims%jmx; jhi(4) = dims%jmx
jlo(5) = 1 ; jhi(5) = dims%jmx
jlo(6) = 1 ; jhi(6) = dims%jmx
klo(1) = 1 ; khi(1) = dims%kmx
klo(2) = 1 ; khi(2) = dims%kmx
klo(3) = 1 ; khi(3) = dims%kmx
klo(4) = 1 ; khi(4) = dims%kmx
klo(5) = 1 ; khi(5) = 1
klo(6) = dims%kmx; khi(6) = dims%kmx
bc%otherface(1)=2
bc%otherface(2)=1
bc%otherface(3)=4
bc%otherface(4)=3
bc%otherface(5)=6
bc%otherface(6)=5
bc%dir_switch = 0
!--- end of variable intializaiton --!
!--- reading map file ---!
open(files%MAP_FILE_UNIT, file=files%mapfile, status='old', action='read')
read(files%MAP_FILE_UNIT,*) ! ignore header
do i=1,max_call
read(files%MAP_FILE_UNIT,*, iostat=ios) b1,f1,s11,e11,s12,e12,&
b2,f2,s21,e21,s22,e22,switch,class
if(is_iostat_end(ios)) EXIT
if(b1==control%process_id)then
if(f1==1) then
bc%otherface(1)=f2
jlo(1)=s21
jhi(1)=e21
klo(1)=s22
khi(1)=e22
bc%dir_switch(1)=switch
mpi_class(1)=class
elseif(f1==2) then
bc%otherface(2)=f2
jlo(2)=s21
jhi(2)=e21
klo(2)=s22
khi(2)=e22
bc%dir_switch(2)=switch
mpi_class(2)=class
elseif(f1==3) then
bc%otherface(3)=f2
ilo(3)=s21
ihi(3)=e21
klo(3)=s22
khi(3)=e22
bc%dir_switch(3)=switch
mpi_class(3)=class
elseif(f1==4) then
bc%otherface(4)=f2
ilo(4)=s21
ihi(4)=e21
klo(4)=s22
khi(4)=e22
bc%dir_switch(4)=switch
mpi_class(4)=class
elseif(f1==5) then
bc%otherface(5)=f2
ilo(5)=s21
ihi(5)=e21
jlo(5)=s22
jhi(5)=e22
bc%dir_switch(5)=switch
mpi_class(5)=class
elseif(f1==6) then
bc%otherface(6)=f2
ilo(6)=s21
ihi(6)=e21
jlo(6)=s22
jhi(6)=e22
bc%dir_switch(6)=switch
mpi_class(6)=class
end if
else
continue
end if
end do
close(files%MAP_FILE_UNIT)
call change_map_to_particular_range()
call read_periodic_bc_file(files, control, bc)
end subroutine read_interface_map