Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_reordering), | intent(inout) | :: | self | |||
type(holder_elements), | intent(in) | :: | elements(:) |
module subroutine rcm_reorder_method(self, elements) implicit none class(type_reordering), intent(inout) :: self type(holder_elements), intent(in) :: elements(:) type(type_node_adjacency) :: local_node_adj integer(int32) :: n_nodes, i, r_count, start_node, istat integer(int32), allocatable :: degree(:), R(:), Q(:) logical, allocatable :: visited(:) call build_node_adjacency_from_elements(elements, local_node_adj) n_nodes = local_node_adj%get_num_nodes() self%num_nodes = n_nodes if (n_nodes == 0) return call allocate_array(degree, length=n_nodes) do i = 1, n_nodes degree(i) = local_node_adj%get_degree(i) end do call allocate_array(R, length=n_nodes) call allocate_array(Q, length=n_nodes) call allocate_array(visited, length=n_nodes) visited = .false. r_count = 0 do while (r_count < n_nodes) call find_start_node(n_nodes, degree, visited, start_node, istat) if (istat /= 0) then call error_message(931, c_opt="RCM Reordering") end if call execute_cm_ordering(start_node, local_node_adj, degree, visited, Q, R, r_count) end do if (allocated(self%perm)) call deallocate_array(self%perm) call allocate_array(self%perm, length=n_nodes) do i = 1, n_nodes self%perm(i) = R(n_nodes - i + 1) end do self%is_reordered_perm = .true. self%is_reordered_iperm = .false. call deallocate_array(degree) call deallocate_array(R) call deallocate_array(Q) call deallocate_array(visited) end subroutine rcm_reorder_method