Convert the extended domain index to ig, it and ifl
The iex_to routines all need testing!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(supercell_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | iex | |||
integer, | intent(out) | :: | ig | |||
integer, | intent(out) | :: | ic | |||
integer, | intent(out) | :: | it | |||
integer, | intent(out) | :: | ifl |
subroutine sc_iex_to_dims(self,iex,ig,ic,it,ifl)
use theta_grid, only: ntgrid
implicit none
class(supercell_type), intent(in) :: self
integer, intent(in) :: iex
integer, intent(out) :: ig,ic,it,ifl
!Get field index
ifl=1+int((iex-1)/self%nextend)
!Get cell and it index
ic=min(self%ncell,1+int((iex-(ifl-1)*self%nextend-1)/(2*ntgrid)))
it=self%cells(ic)%it_ind
!Get ig index
ig=-ntgrid+iex-(ifl-1)*self%nextend-1-2*ntgrid*(ic-1)
end subroutine sc_iex_to_dims