initialize_type_controls Subroutine

private subroutine initialize_type_controls(self, input)

Type Bound

type_controls

Arguments

Type IntentOptional Attributes Name
class(type_controls), intent(inout) :: self
class(type_input), intent(in) :: input

Calls

proc~~initialize_type_controls~~CallsGraph proc~initialize_type_controls type_controls%initialize_type_controls interface~deallocate_array deallocate_array proc~initialize_type_controls->interface~deallocate_array proc~get_active_region_info type_vtk%get_active_region_info proc~initialize_type_controls->proc~get_active_region_info proc~initialize_openmp initialize_openmp proc~initialize_type_controls->proc~initialize_openmp proc~deallocate_rank1_int32 deallocate_rank1_int32 interface~deallocate_array->proc~deallocate_rank1_int32 proc~deallocate_rank1_int64 deallocate_rank1_int64 interface~deallocate_array->proc~deallocate_rank1_int64 proc~deallocate_rank1_int8 deallocate_rank1_int8 interface~deallocate_array->proc~deallocate_rank1_int8 proc~deallocate_rank1_logical1 deallocate_rank1_logical1 interface~deallocate_array->proc~deallocate_rank1_logical1 proc~deallocate_rank1_logical4 deallocate_rank1_logical4 interface~deallocate_array->proc~deallocate_rank1_logical4 proc~deallocate_rank1_logical8 deallocate_rank1_logical8 interface~deallocate_array->proc~deallocate_rank1_logical8 proc~deallocate_rank1_real128 deallocate_rank1_real128 interface~deallocate_array->proc~deallocate_rank1_real128 proc~deallocate_rank1_real32 deallocate_rank1_real32 interface~deallocate_array->proc~deallocate_rank1_real32 proc~deallocate_rank1_real64 deallocate_rank1_real64 interface~deallocate_array->proc~deallocate_rank1_real64 proc~deallocate_rank2_int32 deallocate_rank2_int32 interface~deallocate_array->proc~deallocate_rank2_int32 proc~deallocate_rank2_int64 deallocate_rank2_int64 interface~deallocate_array->proc~deallocate_rank2_int64 proc~deallocate_rank2_int8 deallocate_rank2_int8 interface~deallocate_array->proc~deallocate_rank2_int8 proc~deallocate_rank2_logical1 deallocate_rank2_logical1 interface~deallocate_array->proc~deallocate_rank2_logical1 proc~deallocate_rank2_logical4 deallocate_rank2_logical4 interface~deallocate_array->proc~deallocate_rank2_logical4 proc~deallocate_rank2_logical8 deallocate_rank2_logical8 interface~deallocate_array->proc~deallocate_rank2_logical8 proc~deallocate_rank2_real128 deallocate_rank2_real128 interface~deallocate_array->proc~deallocate_rank2_real128 proc~deallocate_rank2_real32 deallocate_rank2_real32 interface~deallocate_array->proc~deallocate_rank2_real32 proc~deallocate_rank2_real64 deallocate_rank2_real64 interface~deallocate_array->proc~deallocate_rank2_real64 interface~unique unique proc~get_active_region_info->interface~unique proc~unique_int16 unique_int16 interface~unique->proc~unique_int16 proc~unique_int32 unique_int32 interface~unique->proc~unique_int32 proc~unique_int64 unique_int64 interface~unique->proc~unique_int64 proc~unique_int8 unique_int8 interface~unique->proc~unique_int8 proc~error_message error_message proc~deallocate_rank1_int32->proc~error_message proc~deallocate_rank1_int64->proc~error_message proc~deallocate_rank1_int8->proc~error_message proc~deallocate_rank1_logical1->proc~error_message proc~deallocate_rank1_logical4->proc~error_message proc~deallocate_rank1_logical8->proc~error_message proc~deallocate_rank1_real128->proc~error_message proc~deallocate_rank1_real32->proc~error_message proc~deallocate_rank1_real64->proc~error_message proc~deallocate_rank2_int32->proc~error_message proc~deallocate_rank2_int64->proc~error_message proc~deallocate_rank2_int8->proc~error_message proc~deallocate_rank2_logical1->proc~error_message proc~deallocate_rank2_logical4->proc~error_message proc~deallocate_rank2_logical8->proc~error_message proc~deallocate_rank2_real128->proc~error_message proc~deallocate_rank2_real32->proc~error_message proc~deallocate_rank2_real64->proc~error_message log_error log_error proc~error_message->log_error interface~allocate_array allocate_array proc~unique_int16->interface~allocate_array sort sort proc~unique_int16->sort proc~unique_int32->interface~allocate_array proc~unique_int32->sort proc~unique_int64->interface~allocate_array proc~unique_int64->sort proc~unique_int8->interface~allocate_array proc~unique_int8->sort proc~allocate_rank1_int16 allocate_rank1_int16 interface~allocate_array->proc~allocate_rank1_int16 proc~allocate_rank1_int32 allocate_rank1_int32 interface~allocate_array->proc~allocate_rank1_int32 proc~allocate_rank1_int64 allocate_rank1_int64 interface~allocate_array->proc~allocate_rank1_int64 proc~allocate_rank1_int8 allocate_rank1_int8 interface~allocate_array->proc~allocate_rank1_int8 proc~allocate_rank1_logical1 allocate_rank1_logical1 interface~allocate_array->proc~allocate_rank1_logical1 proc~allocate_rank1_logical4 allocate_rank1_logical4 interface~allocate_array->proc~allocate_rank1_logical4 proc~allocate_rank1_logical8 allocate_rank1_logical8 interface~allocate_array->proc~allocate_rank1_logical8 proc~allocate_rank1_real128 allocate_rank1_real128 interface~allocate_array->proc~allocate_rank1_real128 proc~allocate_rank1_real32 allocate_rank1_real32 interface~allocate_array->proc~allocate_rank1_real32 proc~allocate_rank1_real64 allocate_rank1_real64 interface~allocate_array->proc~allocate_rank1_real64 proc~allocate_rank2_int16 allocate_rank2_int16 interface~allocate_array->proc~allocate_rank2_int16 proc~allocate_rank2_int32 allocate_rank2_int32 interface~allocate_array->proc~allocate_rank2_int32 proc~allocate_rank2_int64 allocate_rank2_int64 interface~allocate_array->proc~allocate_rank2_int64 proc~allocate_rank2_int8 allocate_rank2_int8 interface~allocate_array->proc~allocate_rank2_int8 proc~allocate_rank2_logical1 allocate_rank2_logical1 interface~allocate_array->proc~allocate_rank2_logical1 proc~allocate_rank2_logical4 allocate_rank2_logical4 interface~allocate_array->proc~allocate_rank2_logical4 proc~allocate_rank2_logical8 allocate_rank2_logical8 interface~allocate_array->proc~allocate_rank2_logical8 proc~allocate_rank2_real128 allocate_rank2_real128 interface~allocate_array->proc~allocate_rank2_real128 proc~allocate_rank2_real32 allocate_rank2_real32 interface~allocate_array->proc~allocate_rank2_real32 proc~allocate_rank2_real64 allocate_rank2_real64 interface~allocate_array->proc~allocate_rank2_real64 proc~allocate_rank1_int16->proc~error_message proc~allocate_rank1_int32->proc~error_message proc~allocate_rank1_int64->proc~error_message proc~allocate_rank1_int8->proc~error_message proc~allocate_rank1_logical1->proc~error_message proc~allocate_rank1_logical4->proc~error_message proc~allocate_rank1_logical8->proc~error_message proc~allocate_rank1_real128->proc~error_message proc~allocate_rank1_real32->proc~error_message proc~allocate_rank1_real64->proc~error_message proc~allocate_rank2_int16->proc~error_message proc~allocate_rank2_int32->proc~error_message proc~allocate_rank2_int64->proc~error_message proc~allocate_rank2_int8->proc~error_message proc~allocate_rank2_logical1->proc~error_message proc~allocate_rank2_logical4->proc~error_message proc~allocate_rank2_logical8->proc~error_message proc~allocate_rank2_real128->proc~error_message proc~allocate_rank2_real32->proc~error_message proc~allocate_rank2_real64->proc~error_message

Source Code

    subroutine initialize_type_controls(self, input)
        implicit none
        class(type_controls), intent(inout) :: self
        class(type_input), intent(in) :: input

        integer(int32), allocatable :: unique_material_ids(:)
        integer(int32) :: ierr
        integer(int32) :: i, num_unique_regions, max_region_id
        integer(int32) :: current_material_id

        ierr = 0
        ! アクティブなマテリアル領域の情報を取得
        call input%geometry%vtk%get_active_region_info(unique_material_ids, ierr)
        if (ierr /= 0) return
        if (.not. allocated(unique_material_ids) .or. size(unique_material_ids) == 0) then
            ierr = -1 ! エラーコード
            print *, "Error: No active material regions found."
            stop 1
        end if

        num_unique_regions = size(unique_material_ids)
        max_region_id = maxval(unique_material_ids)

        ! 全体的な計算フラグを設定し、配列を割り当てて初期化
        if (input%basic%analysis_controls%calculate_thermal) then
            self%calculate_thermal = .true.
            allocate (self%thermal(max_region_id))
            self%thermal = .false. ! 配列全体を .false. で初期化
        else
            self%calculate_thermal = .false.
        end if

        if (input%basic%analysis_controls%calculate_hydraulic) then
            self%calculate_hydraulic = .true.
            allocate (self%hydraulic(max_region_id))
            self%hydraulic = .false.
        else
            self%calculate_hydraulic = .false.
        end if

        if (input%basic%analysis_controls%calculate_mechanical) then
            self%calculate_mechanical = .true.
            allocate (self%mechanical(max_region_id))
            self%mechanical = .false.
        else
            self%calculate_mechanical = .false.
        end if

        ! アクティブな各マテリアル領域に対してフラグを立てる
        do i = 1, num_unique_regions
            current_material_id = unique_material_ids(i)
            if (self%calculate_thermal) then
                ! materials配列の添え字として実際の材料IDを使用
                self%thermal(current_material_id) = input%basic%materials(i)%calculate_thermal
            end if

            if (self%calculate_hydraulic) then
                ! materials配列の添え字として実際の材料IDを使用
                self%hydraulic(current_material_id) = input%basic%materials(i)%calculate_hydraulic
            end if

            if (self%calculate_mechanical) then
                ! materials配列の添え字として実際の材料IDを使用
                self%mechanical(current_material_id) = input%basic%materials(i)%calculate_mechanical
            end if
        end do

        ! print *,

        ! coupling_modeの設定
        self%coupling_mode = input%basic%analysis_controls%coupling_mode

        ! call self%time%initialize(input)
        ! call self%iteration%initialize(input)

        call initialize_openmp(input)

        call deallocate_array(unique_material_ids)

    end subroutine initialize_type_controls