Read periodic.md file in the system/mesh/layout/periodic.md
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 |
subroutine read_periodic_bc_file(files, control, bc)
!< Read periodic.md file in the system/mesh/layout/periodic.md
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
integer :: ios
integer :: max_call
integer :: i
integer :: b1, b2
integer :: f1, f2
integer :: class
open(files%PERIODIC_FILE_UNIT, file=files%periodicfile, status='old', action='read')
read(files%PERIODIC_FILE_UNIT,*) !ignore first line (header)
max_call = control%total_process*6
do i=1,max_call
read(files%PERIODIC_FILE_UNIT,*, iostat=ios) b1,b2,f1,f2, class
if(is_iostat_end(ios)) EXIT
if(b1==control%process_id)then
bc%PbcId(f1) = b2
end if
end do
close(files%PERIODIC_FILE_UNIT)
end subroutine read_periodic_bc_file