to_reordered_indices Module Subroutine

module subroutine to_reordered_indices(self, indices_original, indices_reordered)

Arguments

Type IntentOptional Attributes Name
class(type_reordering), intent(in) :: self
integer(kind=int32), intent(in) :: indices_original(:)
integer(kind=int32), intent(inout) :: indices_reordered(:)

Called by

proc~~to_reordered_indices~~CalledByGraph proc~to_reordered_indices to_reordered_indices interface~to_reordered_indices type_reordering%to_reordered_indices interface~to_reordered_indices->proc~to_reordered_indices none~to_reordered type_reordering%to_reordered none~to_reordered->interface~to_reordered_indices proc~apply_reordering type_domain%apply_reordering proc~apply_reordering->none~to_reordered proc~initialize_type_bc_thermal_adiabatic initialize_type_bc_thermal_adiabatic proc~initialize_type_bc_thermal_adiabatic->none~to_reordered proc~initialize_type_bc_thermal_dirichlet initialize_type_bc_thermal_dirichlet proc~initialize_type_bc_thermal_dirichlet->none~to_reordered proc~initialize_type_crs type_crs%initialize_type_crs proc~initialize_type_crs->none~to_reordered interface~initialize_type_bc_thermal_adiabatic type_bc_thermal_adiabatic%initialize_type_bc_thermal_adiabatic interface~initialize_type_bc_thermal_adiabatic->proc~initialize_type_bc_thermal_adiabatic interface~initialize_type_bc_thermal_dirichlet type_bc_thermal_dirichlet%initialize_type_bc_thermal_dirichlet interface~initialize_type_bc_thermal_dirichlet->proc~initialize_type_bc_thermal_dirichlet proc~construct_type_thermal_3phase_2d construct_type_thermal_3phase_2d proc~construct_type_thermal_3phase_2d->proc~initialize_type_crs proc~initialize_type_domain type_domain%initialize_type_domain proc~initialize_type_domain->proc~apply_reordering interface~construct_type_thermal_3phase_2d construct_type_thermal_3phase_2d interface~construct_type_thermal_3phase_2d->proc~construct_type_thermal_3phase_2d interface~type_thermal_3phase_2d type_thermal_3phase_2d interface~type_thermal_3phase_2d->interface~construct_type_thermal_3phase_2d

Source Code

    module subroutine to_reordered_indices(self, indices_original, indices_reordered)
        implicit none
        class(type_reordering), intent(in) :: self
        integer(int32), intent(in) :: indices_original(:)
        integer(int32), intent(inout) :: indices_reordered(:)

        integer(int32) :: i

        if (size(indices_original) /= size(indices_reordered)) error stop "Size mismatch"

        if (self%algorithm_name == "none") then
            indices_reordered(:) = indices_original(:)
            return
        end if

        if (.not. self%is_reordered_iperm) error stop "'iperm' not ready. Call 'invert' first."

        do i = 1, size(indices_original)
            indices_reordered(i) = self%iperm(indices_original(i))
        end do

    end subroutine to_reordered_indices