boundary_adiabatic.F90 Source File


This file depends on

sourcefile~~boundary_adiabatic.f90~~EfferentGraph sourcefile~boundary_adiabatic.f90 boundary_adiabatic.F90 sourcefile~boundary_interface.f90 boundary_interface.F90 sourcefile~boundary_adiabatic.f90->sourcefile~boundary_interface.f90 sourcefile~core.f90 core.F90 sourcefile~boundary_interface.f90->sourcefile~core.f90 sourcefile~domain.f90 domain.F90 sourcefile~boundary_interface.f90->sourcefile~domain.f90 sourcefile~input.f90 input.F90 sourcefile~boundary_interface.f90->sourcefile~input.f90 sourcefile~matrix.f90 matrix.F90 sourcefile~boundary_interface.f90->sourcefile~matrix.f90 sourcefile~allocate.f90 allocate.F90 sourcefile~core.f90->sourcefile~allocate.f90 sourcefile~check_range.f90 check_range.F90 sourcefile~core.f90->sourcefile~check_range.f90 sourcefile~deallocate.f90 deallocate.F90 sourcefile~core.f90->sourcefile~deallocate.f90 sourcefile~error.f90 error.F90 sourcefile~core.f90->sourcefile~error.f90 sourcefile~fortran_utils.f90 fortran_utils.F90 sourcefile~core.f90->sourcefile~fortran_utils.f90 sourcefile~string_utils.f90 string_utils.F90 sourcefile~core.f90->sourcefile~string_utils.f90 sourcefile~types.f90 types.F90 sourcefile~core.f90->sourcefile~types.f90 sourcefile~unique.f90 unique.F90 sourcefile~core.f90->sourcefile~unique.f90 sourcefile~vtk.f90 vtk.F90 sourcefile~core.f90->sourcefile~vtk.f90 sourcefile~vtk_constants.f90 vtk_constants.F90 sourcefile~core.f90->sourcefile~vtk_constants.f90 sourcefile~adjacency.f90 adjacency.F90 sourcefile~domain.f90->sourcefile~adjacency.f90 sourcefile~domain_manager.f90 domain_manager.F90 sourcefile~domain.f90->sourcefile~domain_manager.f90 sourcefile~element.f90 element.F90 sourcefile~domain.f90->sourcefile~element.f90 sourcefile~element_factory.f90 element_factory.F90 sourcefile~domain.f90->sourcefile~element_factory.f90 sourcefile~multicoloring.f90 multicoloring.F90 sourcefile~domain.f90->sourcefile~multicoloring.f90 sourcefile~reordering.f90 reordering.F90 sourcefile~domain.f90->sourcefile~reordering.f90 sourcefile~side.f90 side.F90 sourcefile~domain.f90->sourcefile~side.f90 sourcefile~side_factory.f90 side_factory.F90 sourcefile~domain.f90->sourcefile~side_factory.f90 sourcefile~input_interface.f90 input_interface.F90 sourcefile~input.f90->sourcefile~input_interface.f90 sourcefile~matrix_base.f90 matrix_base.F90 sourcefile~matrix.f90->sourcefile~matrix_base.f90 sourcefile~matrix_coo.f90 matrix_coo.F90 sourcefile~matrix.f90->sourcefile~matrix_coo.f90 sourcefile~matrix_crs.f90 matrix_crs.F90 sourcefile~matrix.f90->sourcefile~matrix_crs.f90 sourcefile~matrix_dense.f90 matrix_dense.F90 sourcefile~matrix.f90->sourcefile~matrix_dense.f90 sourcefile~adjacency_element.f90 adjacency_element.F90 sourcefile~adjacency.f90->sourcefile~adjacency_element.f90 sourcefile~adjacency_node.f90 adjacency_node.F90 sourcefile~adjacency.f90->sourcefile~adjacency_node.f90 sourcefile~allocate.f90->sourcefile~error.f90 sourcefile~deallocate.f90->sourcefile~error.f90 sourcefile~domain_manager.f90->sourcefile~core.f90 sourcefile~domain_manager.f90->sourcefile~input.f90 sourcefile~domain_manager.f90->sourcefile~adjacency.f90 sourcefile~domain_manager.f90->sourcefile~element.f90 sourcefile~domain_manager.f90->sourcefile~element_factory.f90 sourcefile~domain_manager.f90->sourcefile~multicoloring.f90 sourcefile~domain_manager.f90->sourcefile~reordering.f90 sourcefile~domain_manager.f90->sourcefile~side.f90 sourcefile~domain_manager.f90->sourcefile~side_factory.f90 sourcefile~element.f90->sourcefile~core.f90 sourcefile~element.f90->sourcefile~input.f90 sourcefile~element_factory.f90->sourcefile~core.f90 sourcefile~element_factory.f90->sourcefile~input.f90 sourcefile~element_factory.f90->sourcefile~element.f90 sourcefile~memory_stats_wrapper.f90 memory_stats_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~memory_stats_wrapper.f90 sourcefile~signal_flag_wrapper.f90 signal_flag_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~signal_flag_wrapper.f90 sourcefile~system_info_wrapper.f90 system_info_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~system_info_wrapper.f90 sourcefile~input_interface.f90->sourcefile~core.f90 sourcefile~project_settings.f90 project_settings.F90 sourcefile~input_interface.f90->sourcefile~project_settings.f90 sourcefile~matrix_base.f90->sourcefile~domain.f90 sourcefile~matrix_coo.f90->sourcefile~core.f90 sourcefile~matrix_coo.f90->sourcefile~domain.f90 sourcefile~matrix_coo.f90->sourcefile~matrix_base.f90 sourcefile~matrix_crs.f90->sourcefile~core.f90 sourcefile~matrix_crs.f90->sourcefile~domain.f90 sourcefile~matrix_crs.f90->sourcefile~matrix_base.f90 sourcefile~matrix_crs.f90->sourcefile~matrix_coo.f90 sourcefile~matrix_dense.f90->sourcefile~core.f90 sourcefile~matrix_dense.f90->sourcefile~domain.f90 sourcefile~matrix_dense.f90->sourcefile~matrix_base.f90 sourcefile~multicoloring.f90->sourcefile~core.f90 sourcefile~multicoloring.f90->sourcefile~adjacency_element.f90 sourcefile~reordering.f90->sourcefile~core.f90 sourcefile~reordering.f90->sourcefile~element.f90 sourcefile~reordering.f90->sourcefile~adjacency_node.f90 sourcefile~side.f90->sourcefile~core.f90 sourcefile~side.f90->sourcefile~input.f90 sourcefile~side_factory.f90->sourcefile~core.f90 sourcefile~side_factory.f90->sourcefile~input.f90 sourcefile~side_factory.f90->sourcefile~side.f90 sourcefile~string_utils.f90->sourcefile~allocate.f90 sourcefile~array.f90 array.F90 sourcefile~types.f90->sourcefile~array.f90 sourcefile~gauss.f90 gauss.F90 sourcefile~types.f90->sourcefile~gauss.f90 sourcefile~pointer.f90 pointer.F90 sourcefile~types.f90->sourcefile~pointer.f90 sourcefile~variable.f90 variable.F90 sourcefile~types.f90->sourcefile~variable.f90 sourcefile~vector.f90 vector.F90 sourcefile~types.f90->sourcefile~vector.f90 sourcefile~unique.f90->sourcefile~allocate.f90 sourcefile~vtk.f90->sourcefile~allocate.f90 sourcefile~vtk.f90->sourcefile~deallocate.f90 sourcefile~vtk.f90->sourcefile~unique.f90 sourcefile~vtk.f90->sourcefile~vtk_constants.f90 sourcefile~vtk.f90->sourcefile~array.f90 sourcefile~vtk_wrapper.f90 vtk_wrapper.F90 sourcefile~vtk.f90->sourcefile~vtk_wrapper.f90 sourcefile~vtu_wrapper.f90 vtu_wrapper.F90 sourcefile~vtk.f90->sourcefile~vtu_wrapper.f90 sourcefile~adjacency_element.f90->sourcefile~core.f90 sourcefile~adjacency_element.f90->sourcefile~element.f90 sourcefile~adjacency_node.f90->sourcefile~core.f90 sourcefile~array.f90->sourcefile~allocate.f90 sourcefile~array.f90->sourcefile~deallocate.f90 sourcefile~c_utils.f90 c_utils.F90 sourcefile~memory_stats_wrapper.f90->sourcefile~c_utils.f90 sourcefile~project_settings.f90->sourcefile~core.f90 sourcefile~signal_flag.f90 signal_flag.F90 sourcefile~signal_flag_wrapper.f90->sourcefile~signal_flag.f90 sourcefile~system_info_wrapper.f90->sourcefile~c_utils.f90 sourcefile~variable.f90->sourcefile~allocate.f90 sourcefile~c_utils.f90->sourcefile~signal_flag.f90 sourcefile~memory_stats.f90 memory_stats.F90 sourcefile~c_utils.f90->sourcefile~memory_stats.f90 sourcefile~system_info.f90 system_info.F90 sourcefile~c_utils.f90->sourcefile~system_info.f90

Source Code

submodule(conditions_boundary) conditions_boundary_adiabatic
    implicit none
contains

    module subroutine initialize_type_bc_thermal_adiabatic(self, input, domain, id, i_material, time_conv)
        implicit none
        class(type_bc_thermal_adiabatic), intent(inout) :: self
        type(type_input), intent(in) :: input
        type(type_domain), intent(in) :: domain
        integer(int32), intent(in) :: id
        integer(int32), intent(in) :: i_material
        real(real64), intent(in) :: time_conv

        integer(int32) :: i
        integer(int32), allocatable :: tmp_indices(:)

        self%material_id = input%conditions%boundary_conditions(id)%id
        self%boundary_name = input%conditions%boundary_conditions(id)%thermal%type

        !! Time settings
        if (allocated(self%time_points)) deallocate (self%time_points)
        allocate (self%time_points, source=input%conditions%time_control%boundary_time_points)
        self%time_points = self%time_points * time_conv

        if (allocated(self%values)) deallocate (self%values)
        allocate (self%values, source=input%conditions%boundary_conditions(id)%thermal%values)

        call find_target_edges_by_group(domain, i_material, self%target_edges)
        self%num_target_edges = size(self%target_edges, 2)

        select case (input%basic%solver_settings%reordering)
        case ("cm", "rcm")
            call allocate_array(tmp_indices, 2_int32)
            do i = 1, self%num_target_edges
                call domain%reordering%to_reordered(self%target_edges(:, i), tmp_indices)
                self%target_edges(:, i) = tmp_indices(:)
            end do
            call deallocate_array(tmp_indices)
        end select

    end subroutine initialize_type_bc_thermal_adiabatic

    module subroutine apply_Dense_Thermal_Adiabatic(self, current_time, A, b, Domain, mode)
        implicit none
        class(type_bc_thermal_adiabatic), intent(in) :: self
        real(real64), intent(in) :: current_time
        real(real64), intent(inout), optional :: A(:, :)
        real(real64), intent(inout) :: b(:)
        type(type_domain), intent(in) :: Domain
        integer(int32), intent(in), optional :: mode

    end subroutine apply_Dense_Thermal_Adiabatic

    module subroutine apply_CRS_Thermal_Adiabatic(self, current_time, A, b, Domain, mode)
        implicit none
        class(type_bc_thermal_adiabatic), intent(in) :: self
        real(real64), intent(in) :: current_time
        type(Type_CRS), intent(inout), optional :: A
        real(real64), intent(inout) :: b(:)
        type(type_domain), intent(in) :: Domain
        integer(int32), intent(in), optional :: mode

        ! real(real64) :: Dval, timeCoe
        ! integer(int32) :: idx, iEdge

        ! if (.not. present(mode)) then
        !     call Calc_Time_Coefficients(current_time, self%time_points, timeCoe, idx)
        !     Dval = (self%values(idx) * (1.0d0 - timeCoe) + self%values(idx + 1) * timeCoe)

        !     do iEdge = 1, self%num_target_edges
        !         call apply_CRS_Adiabatic_base(A=A, &
        !                                       b=b, &
        !                                       isUniform=self%is_uniform, &
        !                                       Edge=self%target_edges(:, iEdge), &
        !                                       Dval=Dval, &
        !                                       perm=Domain%RCM_perm)
        !     end do
        ! else
        !     select case (mode)
        !     case (0)
        !         call Calc_Time_Coefficients(current_time, self%time_points, timeCoe, idx)
        !         Dval = (self%values(idx) * (1.0d0 - timeCoe) + self%values(idx + 1) * timeCoe)
        !     case (1)
        !         !! Newton-Raphson step
        !         Dval = 0.0d0
        !     case (2)
        !         !! initial condition
        !         Dval = self%values(1)
        !     end select

        !     do iEdge = 1, self%num_target_edges
        !         call apply_CRS_Adiabatic_base(A=A, &
        !                                       b=b, &
        !                                       isUniform=self%is_uniform, &
        !                                       Edge=self%target_edges(:, iEdge), &
        !                                       Dval=Dval, &
        !                                       perm=Domain%RCM_perm)
        !     end do
        ! end if

    end subroutine apply_CRS_Thermal_Adiabatic

    subroutine apply_CRS_Adiabatic_base(A, b, isUniform, Edge, Dval, perm)
        implicit none
        type(Type_CRS), intent(inout), optional :: A
        real(real64), intent(inout) :: b(:)
        logical(logical32), intent(in) :: isUniform
        integer(int32), intent(in) :: Edge(2)
        real(real64), intent(in) :: Dval
        integer(int32), intent(in) :: perm(:)

        integer(int32) :: i, ind, ps, pe
        integer(int32) :: p1, p2

        ! if (isUniform) then
        !     p1 = perm(Edge(1))
        !     p2 = perm(Edge(2))

        !     if (present(A)) then
        !         call A%Find(p1, p1, ind)
        !         ps = A%Ptr(p1)
        !         pe = A%Ptr(p1 + 1) - 1
        !         A%val(ps:pe) = 0.0d0
        !         A%val(ind) = 1.0d0

        !         call A%Find(p2, p2, ind)
        !         ps = A%Ptr(p2)
        !         pe = A%Ptr(p2 + 1) - 1
        !         A%val(ps:pe) = 0.0d0
        !         A%val(ind) = 1.0d0
        !     end if

        !     b(p1) = Dval
        !     b(p2) = Dval
        ! end if

    end subroutine apply_CRS_Adiabatic_base

    subroutine apply_Dense_Adiabatic_base(A, b, isUniform, Edge, Dval, perm)
        implicit none
        real(real64), intent(inout), optional :: A(:, :)
        real(real64), intent(inout) :: b(:)
        logical(logical32), intent(in) :: isUniform
        integer(int32), intent(in) :: Edge(2)
        real(real64), intent(in) :: Dval
        integer(int32), intent(in) :: perm(:)

        integer(int32) :: i, ind, ps, pe
        integer(int32) :: p1, p2

        ! if (isUniform) then
        !     p1 = perm(Edge(1))
        !     p2 = perm(Edge(2))

        !     if (present(A)) then
        !         A(p1, :) = 0.0d0
        !         A(p1, p1) = 1.0d0

        !         A(p2, :) = 0.0d0
        !         A(p2, p2) = 1.0d0
        !     end if

        !     b(p1) = Dval
        !     b(p2) = Dval
        ! end if

    end subroutine apply_Dense_Adiabatic_base

end submodule conditions_boundary_adiabatic