A routine to invert the field matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(supercell_type), | intent(inout) | :: | self | |||
class(pc_type), | intent(in) | :: | pc |
subroutine sc_invert(self, pc)
use job_manage, only: time_message
use fields_arrays, only: time_field_invert, time_field_invert_mpi
use mp, only: get_mp_times
implicit none
class(supercell_type), intent(inout) :: self
class(pc_type), intent(in) :: pc
real :: mp_total, mp_total_after
if(self%is_empty) return
if(.not.self%is_local) return
call time_message(.false.,time_field_invert,' Field Matrix Invert')
call get_mp_times(total_time = mp_total)
!If we have all of the supercell local then use an explictly local
!matrix inversion
!Note could have a variable which forces local inversion
if(self%is_all_local.or.pc%force_local_invert) then
! call self%dump(prefix="orig_")
call self%invert_local
! call self%dump(prefix="inv_")
else
call self%invert_mpi
endif
call time_message(.false.,time_field_invert,' Field Matrix Invert')
call get_mp_times(total_time = mp_total_after)
time_field_invert_mpi = time_field_invert_mpi + (mp_total_after - mp_total)
end subroutine sc_invert