| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(type_node_adjacency), | intent(inout) | :: | self | |||
| integer(kind=int32), | intent(in) | :: | num_nodes | |||
| integer(kind=int32), | intent(in) | :: | computation_dimension | |||
| class(holder_sides), | intent(in) | :: | sides(:) | |||
| class(holder_elements), | intent(in) | :: | elements(:) |
subroutine initialize_hybrid_from_mesh(self, num_nodes, computation_dimension, sides, elements) implicit none class(type_node_adjacency), intent(inout) :: self integer(int32), intent(in) :: num_nodes integer(int32), intent(in) :: computation_dimension class(holder_sides), intent(in) :: sides(:) class(holder_elements), intent(in) :: elements(:) integer(int32) :: estimated_nnz, actual_nnz integer(int32), allocatable :: temp_row_indices(:), temp_col_indices(:) self%num_nodes = num_nodes if (self%num_nodes <= 0) return ! 1. 一時COO配列の最大サイズを見積もる estimated_nnz = estimate_max_coo_size(computation_dimension, sides, elements) if (estimated_nnz <= 0) return call allocate_array(temp_row_indices, estimated_nnz) call allocate_array(temp_col_indices, estimated_nnz) ! 2. メッシュから重複を含むCOOリストを生成 call create_coo_from_mesh(computation_dimension, sides, elements, temp_row_indices, temp_col_indices, actual_nnz) ! 3.【COO構築】一時COOリストからユニークなCOOリストを作成 call create_unique_coo(self, temp_row_indices(1:actual_nnz), temp_col_indices(1:actual_nnz)) ! 4.【CSR構築】作成したユニークCOOリストからCSR形式を構築 call build_csr_from_coo(self) call deallocate_array(temp_row_indices) call deallocate_array(temp_col_indices) end subroutine initialize_hybrid_from_mesh