Prepare the field matrix for calculating field updates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(supercell_type), | intent(inout) | :: | self | |||
integer, | intent(in) | :: | prepare_type | |||
class(pc_type), | intent(in) | :: | pc |
subroutine sc_prepare(self,prepare_type,pc)
use mp, only: mp_abort
implicit none
class(supercell_type), intent(inout) :: self
class(pc_type), intent(in) :: pc
integer, intent(in) :: prepare_type
character (len=40) :: errmesg
!Exit early if we're empty
if(self%is_empty) return
if(.not.self%is_local) return
!Need to decide what method we're using to prepare the
!field matrix
select case(prepare_type)
case(0) !Invert
call self%invert(pc)
case default
write(errmesg,'("ERROR: Invalid prepare_type : ",I0)') prepare_type
call mp_abort(trim(errmesg))
end select
! Now dump the matrix
if (dump_response) call self%dump_to_file
end subroutine sc_prepare