side.F90 Source File


This file depends on

sourcefile~~side.f90~~EfferentGraph sourcefile~side.f90 side.F90 sourcefile~core.f90 core.F90 sourcefile~side.f90->sourcefile~core.f90 sourcefile~input.f90 input.F90 sourcefile~side.f90->sourcefile~input.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~input_interface.f90 input_interface.F90 sourcefile~input.f90->sourcefile~input_interface.f90 sourcefile~allocate.f90->sourcefile~error.f90 sourcefile~deallocate.f90->sourcefile~error.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~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~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

Files dependent on this one

sourcefile~~side.f90~~AfferentGraph sourcefile~side.f90 side.F90 sourcefile~domain.f90 domain.F90 sourcefile~domain.f90->sourcefile~side.f90 sourcefile~domain_manager.f90 domain_manager.F90 sourcefile~domain.f90->sourcefile~domain_manager.f90 sourcefile~side_factory.f90 side_factory.F90 sourcefile~domain.f90->sourcefile~side_factory.f90 sourcefile~domain_manager.f90->sourcefile~side.f90 sourcefile~domain_manager.f90->sourcefile~side_factory.f90 sourcefile~side_factory.f90->sourcefile~side.f90 sourcefile~side_first.f90 side_first.F90 sourcefile~side_first.f90->sourcefile~side.f90 sourcefile~side_second.f90 side_second.F90 sourcefile~side_second.f90->sourcefile~side.f90 sourcefile~boundary_interface.f90 boundary_interface.F90 sourcefile~boundary_interface.f90->sourcefile~domain.f90 sourcefile~matrix.f90 matrix.F90 sourcefile~boundary_interface.f90->sourcefile~matrix.f90 sourcefile~boundary_manager.f90 boundary_manager.F90 sourcefile~boundary_manager.f90->sourcefile~domain.f90 sourcefile~boundary_manager.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_manager.f90->sourcefile~matrix.f90 sourcefile~ftdss.f90 ftdss.F90 sourcefile~ftdss.f90->sourcefile~domain.f90 sourcefile~thermal_interface.f90 thermal_interface.F90 sourcefile~ftdss.f90->sourcefile~thermal_interface.f90 sourcefile~boundary.f90 boundary.F90 sourcefile~ftdss.f90->sourcefile~boundary.f90 sourcefile~initial.f90 initial.F90 sourcefile~ftdss.f90->sourcefile~initial.f90 sourcefile~output.f90 output.F90 sourcefile~ftdss.f90->sourcefile~output.f90 sourcefile~initial_interface.f90 initial_interface.F90 sourcefile~initial_interface.f90->sourcefile~domain.f90 sourcefile~initial_interface.f90->sourcefile~boundary.f90 sourcefile~initial_manager.f90 initial_manager.F90 sourcefile~initial_manager.f90->sourcefile~domain.f90 sourcefile~initial_manager.f90->sourcefile~initial_interface.f90 sourcefile~matrix_base.f90 matrix_base.F90 sourcefile~matrix_base.f90->sourcefile~domain.f90 sourcefile~matrix_coo.f90 matrix_coo.F90 sourcefile~matrix_coo.f90->sourcefile~domain.f90 sourcefile~matrix_coo.f90->sourcefile~matrix_base.f90 sourcefile~matrix_crs.f90 matrix_crs.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 matrix_dense.F90 sourcefile~matrix_dense.f90->sourcefile~domain.f90 sourcefile~matrix_dense.f90->sourcefile~matrix_base.f90 sourcefile~output_interface.f90 output_interface.F90 sourcefile~output_interface.f90->sourcefile~domain.f90 sourcefile~output_interface.f90->sourcefile~matrix.f90 sourcefile~thermal_interface.f90->sourcefile~domain.f90 sourcefile~thermal_interface.f90->sourcefile~boundary.f90 sourcefile~thermal_interface.f90->sourcefile~matrix.f90 sourcefile~solver.f90 solver.F90 sourcefile~thermal_interface.f90->sourcefile~solver.f90 sourcefile~boundary.f90->sourcefile~boundary_interface.f90 sourcefile~boundary.f90->sourcefile~boundary_manager.f90 sourcefile~boundary_adiabatic.f90 boundary_adiabatic.F90 sourcefile~boundary_adiabatic.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_base.f90 boundary_base.F90 sourcefile~boundary_base.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_dirichlet.f90 boundary_dirichlet.F90 sourcefile~boundary_dirichlet.f90->sourcefile~boundary_interface.f90 sourcefile~initial.f90->sourcefile~initial_interface.f90 sourcefile~initial.f90->sourcefile~initial_manager.f90 sourcefile~initial_laplace.f90 initial_laplace.F90 sourcefile~initial_laplace.f90->sourcefile~initial_interface.f90 sourcefile~initial_uniform.f90 initial_uniform.F90 sourcefile~initial_uniform.f90->sourcefile~initial_interface.f90 sourcefile~matrix.f90->sourcefile~matrix_base.f90 sourcefile~matrix.f90->sourcefile~matrix_coo.f90 sourcefile~matrix.f90->sourcefile~matrix_crs.f90 sourcefile~matrix.f90->sourcefile~matrix_dense.f90 sourcefile~output.f90->sourcefile~output_interface.f90 sourcefile~output_base.f90 output_base.F90 sourcefile~output_base.f90->sourcefile~output_interface.f90 sourcefile~output_observation.f90 output_observation.F90 sourcefile~output_observation.f90->sourcefile~output_interface.f90 sourcefile~output_overall_base.f90 output_overall_base.F90 sourcefile~output_overall_base.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtk.f90 output_overall_vtk.F90 sourcefile~output_overall_vtk.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtu.f90 output_overall_vtu.F90 sourcefile~output_overall_vtu.f90->sourcefile~output_interface.f90 sourcefile~output_system_logger.f90 output_system_logger.F90 sourcefile~output_system_logger.f90->sourcefile~output_interface.f90 sourcefile~thermal.f90 thermal.F90 sourcefile~thermal.f90->sourcefile~thermal_interface.f90 sourcefile~thermal_3phase.f90 thermal_3phase.F90 sourcefile~thermal_3phase.f90->sourcefile~thermal_interface.f90 sourcefile~solver_factory.f90 solver_factory.F90 sourcefile~solver_factory.f90->sourcefile~matrix.f90 sourcefile~solver.f90->sourcefile~solver_factory.f90

Source Code

module domain_side
    !---------------------------------------------------------------------------------------
    !  Module: domain_side
    !  Purpose: Define 1D finite element types (square and triangle) and their
    !           associated operations (shape functions, Jacobian, Gauss points).
    !  Ford Coding Standard:
    !    - Use ISO_FORTRAN_ENV for portable kinds
    !    - Maintain explicit interfaces and consistent indentation
    !    - Preserve original function and type names
    !--------------------------------------------------------------------------------------
    use, intrinsic :: iso_fortran_env, only: int32, real64
    use :: stdlib_logger
    use :: module_core, only:type_dp_3d, type_dp_pointer, type_vtk_cell, allocate_array
    use :: module_input, only:type_geometry_settings
    implicit none
    private

    public :: abst_side
    public :: type_side_first
    public :: type_side_second
    public :: holder_sides

    !--------------------------------------------------------------------------------------
    ! Holder for polymorphic element objects
    !--------------------------------------------------------------------------------------
    type :: holder_sides
        class(abst_side), allocatable :: s
    end type holder_sides

    !--------------------------------------------------------------------------------------
    !   Abstract base type for 1D elements
    !--------------------------------------------------------------------------------------
    type, abstract :: abst_side
        integer(int32), private :: id
        integer(int32), private :: type ! Edge type
        integer(int32), private :: num_nodes ! Number of nodes in the Edge
        integer(int32), private :: group ! Group ID
        integer(int32), private :: dimension
        integer(int32), private :: order
        integer(int32), allocatable :: connectivity(:) !! connectivity information
        integer(int32), allocatable :: connectivity_reordered(:) !! reordered connectivity information
        type(type_dp_pointer), allocatable :: x(:) !! X coordinate
        type(type_dp_pointer), allocatable :: y(:) !! Y coordinate
        type(type_dp_pointer), allocatable :: z(:) !! Z coordinate

        !----------------------------------------------------------------------------------
        ! Gauss Quadrature points and weights
        !  - Gauss Quadrature points are defined in the local coordinate system
        !  - The number of Gauss points is determined by the element type
        !  - The weights are used for numerical integration over the element
        !  - The Gauss points are used to evaluate the shape functions and their derivatives
        !----------------------------------------------------------------------------------
        integer(int32) :: num_gauss !! Number of Gauss Quadrature points
        real(real64), allocatable :: weight(:) !! Gauss weight
        real(real64), allocatable :: gauss(:) !! Gauss Quadrature points Coordinate
    contains
        procedure(abst_get_id),        pass(self), deferred :: get_id !&
        procedure(abst_get_type),      pass(self), deferred :: get_type !&
        procedure(abst_get_num_nodes), pass(self), deferred :: get_num_nodes !&
        procedure(abst_get_group),     pass(self), deferred :: get_group !&
        procedure(abst_get_order),     pass(self), deferred :: get_order !&
        procedure(abst_get_dimension), pass(self), deferred :: get_dimension !&
        procedure(abst_get_num_gauss), pass(self), deferred :: get_num_gauss !&
        !----------------------------------------------------------------------------------
        procedure(abst_psi),           pass(self), deferred :: psi !&
        procedure(abst_dpsi_dxi),      pass(self), deferred :: dpsi_dxi !&
    end type abst_side

    !--------------------------------------------------------------------------------------
    !   Triangle First Order Element Type
    !--------------------------------------------------------------------------------------
    type, extends(abst_side) :: type_side_first
    contains
        procedure, pass(self) :: get_id        => get_id_side_first !&
        procedure, pass(self) :: get_type      => get_type_side_first !&
        procedure, pass(self) :: get_num_nodes => get_num_nodes_side_first !&
        procedure, pass(self) :: get_group     => get_group_side_first !&
        procedure, pass(self) :: get_order     => get_order_side_first !&
        procedure, pass(self) :: get_dimension => get_dimension_side_first !&
        procedure, pass(self) :: get_num_gauss => get_num_gauss_side_first !
        !----------------------------------------------------------------------------------
        procedure, pass(self) :: psi           => psi_side_first !&
        procedure, pass(self) :: dpsi_dxi      => dpsi_dxi_side_first !&
    end type type_side_first

    !--------------------------------------------------------------------------------------
    !   Triangle Second Order Element Type
    !--------------------------------------------------------------------------------------
    type, extends(abst_side) :: type_side_second
    contains
        procedure, pass(self) :: get_id        => get_id_side_second !&
        procedure, pass(self) :: get_type      => get_type_side_second !&
        procedure, pass(self) :: get_num_nodes => get_num_nodes_side_second !&
        procedure, pass(self) :: get_group     => get_group_side_second !&
        procedure, pass(self) :: get_order     => get_order_side_second !&
        procedure, pass(self) :: get_dimension => get_dimension_side_second !&
        procedure, pass(self) :: get_num_gauss => get_num_gauss_side_second !
        !----------------------------------------------------------------------------------
        procedure, pass(self) :: psi           => psi_side_second !&
        procedure, pass(self) :: dpsi_dxi      => dpsi_dxi_side_second !&
    end type type_side_second

    !--------------------------------------------------------------------------------------
    !  Abstract interface for the 1D element
    !--------------------------------------------------------------------------------------
    abstract interface
        function abst_get_id(self) result(id)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: id
        end function abst_get_id

        function abst_get_type(self) result(type)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: type
        end function abst_get_type

        function abst_get_num_nodes(self) result(num_nodes)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: num_nodes
        end function abst_get_num_nodes

        function abst_get_order(self) result(order)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: order
        end function abst_get_order

        function abst_get_dimension(self) result(dimension)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: dimension
        end function abst_get_dimension

        function abst_get_num_gauss(self) result(num_gauss)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: num_gauss
        end function abst_get_num_gauss

        function abst_get_group(self) result(group)
            import :: abst_side, int32
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32) :: group
        end function abst_get_group

        function abst_psi(self, i, xi) result(psi)
            import :: abst_side, int32, real64
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64), intent(in) :: xi
            real(real64) :: psi
        end function abst_psi

        function abst_dpsi_dxi(self, i) result(dpsi)
            import :: abst_side, int32, real64
            implicit none
            class(abst_side), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64) :: dpsi
        end function abst_dpsi_dxi
    end interface
    !--------------------------------------------------------------------------------------
    !   Edge first order procedures interface
    !--------------------------------------------------------------------------------------
    interface
        module function construct_side_first(id, global_coordinate, cell_info, integration) result(side)
            implicit none
            integer(int32), intent(in) :: id
            type(type_dp_3d), pointer, intent(in) :: global_coordinate
            type(type_vtk_cell), intent(in) :: cell_info
            type(type_geometry_settings), intent(in) :: integration
            class(abst_side), allocatable :: side

        end function construct_side_first

        module function get_id_side_first(self) result(id)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: id
        end function get_id_side_first

        module function get_type_side_first(self) result(type)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: type
        end function get_type_side_first

        module function get_num_nodes_side_first(self) result(n)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: n
        end function get_num_nodes_side_first

        module function get_group_side_first(self) result(group)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: group
        end function get_group_side_first

        module function get_order_side_first(self) result(order)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: order
        end function get_order_side_first

        module function get_dimension_side_first(self) result(dimension)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: dimension
        end function get_dimension_side_first

        module function get_num_gauss_side_first(self) result(num_gauss)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32) :: num_gauss
        end function get_num_gauss_side_first

        module function psi_side_first(self, i, xi) result(psi)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64), intent(in) :: xi
            real(real64) :: psi
        end function psi_side_first

        module function dpsi_dxi_side_first(self, i) result(dpsi)
            implicit none
            class(type_side_first), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64) :: dpsi
        end function dpsi_dxi_side_first
    end interface

    !--------------------------------------------------------------------------------------
    !   Edge Second order procedures interface
    !--------------------------------------------------------------------------------------
    interface
        module function construct_side_second(id, global_coordinate, cell_info, integration) result(side)
            implicit none
            integer(int32), intent(in) :: id
            type(type_dp_3d), pointer, intent(in) :: global_coordinate
            type(type_vtk_cell), intent(in) :: cell_info
            type(type_geometry_settings), intent(in) :: integration
            class(abst_side), allocatable :: side

        end function construct_side_second

        module function get_id_side_second(self) result(id)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: id
        end function get_id_side_second

        module function get_type_side_second(self) result(type)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: type
        end function get_type_side_second

        module function get_num_nodes_side_second(self) result(n)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: n
        end function get_num_nodes_side_second

        module function get_group_side_second(self) result(group)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: group
        end function get_group_side_second

        module function get_order_side_second(self) result(order)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: order
        end function get_order_side_second

        module function get_dimension_side_second(self) result(dimension)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: dimension
        end function get_dimension_side_second

        module function get_num_gauss_side_second(self) result(num_gauss)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32) :: num_gauss
        end function get_num_gauss_side_second

        module function psi_side_second(self, i, xi) result(psi)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64), intent(in) :: xi
            real(real64) :: psi
        end function psi_side_second

        module function dpsi_dxi_side_second(self, i) result(dpsi)
            implicit none
            class(type_side_second), intent(in) :: self
            integer(int32), intent(in) :: i
            real(real64) :: dpsi
        end function dpsi_dxi_side_second
    end interface

    interface type_side_first
        module procedure :: construct_side_first
    end interface

    interface type_side_second
        module procedure :: construct_side_second
    end interface

end module domain_side