immersed_vessel_m.f90 Source File


This file depends on

sourcefile~~immersed_vessel_m.f90~~EfferentGraph sourcefile~immersed_vessel_m.f90 immersed_vessel_m.f90 sourcefile~equilibrium_m.f90 equilibrium_m.f90 sourcefile~immersed_vessel_m.f90->sourcefile~equilibrium_m.f90 sourcefile~immersed_m.f90 immersed_m.f90 sourcefile~immersed_vessel_m.f90->sourcefile~immersed_m.f90 sourcefile~mesh_cart_m.f90 mesh_cart_m.f90 sourcefile~immersed_vessel_m.f90->sourcefile~mesh_cart_m.f90 sourcefile~precision_m.f90 precision_m.f90 sourcefile~immersed_vessel_m.f90->sourcefile~precision_m.f90 sourcefile~equilibrium_m.f90->sourcefile~precision_m.f90 sourcefile~immersed_m.f90->sourcefile~equilibrium_m.f90 sourcefile~immersed_m.f90->sourcefile~mesh_cart_m.f90 sourcefile~immersed_m.f90->sourcefile~precision_m.f90 sourcefile~list_operations_m.f90 list_operations_m.f90 sourcefile~immersed_m.f90->sourcefile~list_operations_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~equilibrium_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~precision_m.f90 sourcefile~comm_handling_m.f90 comm_handling_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~comm_handling_m.f90 sourcefile~descriptors_m.f90 descriptors_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~descriptors_m.f90 sourcefile~error_handling_m.f90 error_handling_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~error_handling_m.f90 sourcefile~slab_equilibrium.f90 slab_equilibrium.f90 sourcefile~mesh_cart_m.f90->sourcefile~slab_equilibrium.f90 sourcefile~status_codes_m.f90 status_codes_m.f90 sourcefile~mesh_cart_m.f90->sourcefile~status_codes_m.f90 sourcefile~screen_io_m.f90 screen_io_m.f90 sourcefile~descriptors_m.f90->sourcefile~screen_io_m.f90 sourcefile~error_handling_m.f90->sourcefile~precision_m.f90 sourcefile~error_handling_m.f90->sourcefile~comm_handling_m.f90 sourcefile~error_handling_m.f90->sourcefile~status_codes_m.f90 sourcefile~error_handling_m.f90->sourcefile~screen_io_m.f90 sourcefile~list_operations_m.f90->sourcefile~precision_m.f90 sourcefile~list_operations_m.f90->sourcefile~screen_io_m.f90 sourcefile~slab_equilibrium.f90->sourcefile~equilibrium_m.f90 sourcefile~slab_equilibrium.f90->sourcefile~precision_m.f90 sourcefile~slab_equilibrium.f90->sourcefile~descriptors_m.f90 sourcefile~params_equi_slab_m.f90 params_equi_slab_m.f90 sourcefile~slab_equilibrium.f90->sourcefile~params_equi_slab_m.f90 sourcefile~slab_equilibrium.f90->sourcefile~screen_io_m.f90 sourcefile~params_equi_slab_m.f90->sourcefile~precision_m.f90 sourcefile~params_equi_slab_m.f90->sourcefile~error_handling_m.f90 sourcefile~params_equi_slab_m.f90->sourcefile~status_codes_m.f90 sourcefile~params_equi_slab_m.f90->sourcefile~screen_io_m.f90 sourcefile~screen_io_m.f90->sourcefile~precision_m.f90

Files dependent on this one

sourcefile~~immersed_vessel_m.f90~~AfferentGraph sourcefile~immersed_vessel_m.f90 immersed_vessel_m.f90 sourcefile~immersed_factory_m.f90 immersed_factory_m.f90 sourcefile~immersed_factory_m.f90->sourcefile~immersed_vessel_m.f90

Source Code

module immersed_vessel_m
    !! Immersed boundary module, based on vessel function from equilibrium
    use precision_m, only : FP
    use immersed_m, only : immersed_t
    use equilibrium_m, only : equilibrium_t
    use mesh_cart_m, only : mesh_cart_t
    implicit none

    type, public, extends(immersed_t) :: immersed_vessel_t
        !! Immersed boundary type based on vessel
    contains
        procedure, public :: init
        procedure, public :: display
        final :: destructor_immersed_vessel_t
    end type

contains
    
    subroutine init(self, equi, mesh, filename)
        class(immersed_vessel_t), intent(inout) :: self
        class(equilibrium_t), intent(inout) :: equi
        type(mesh_cart_t), intent(in) :: mesh
        character(len=*), intent(in), optional :: filename

        integer :: l
        real(FP) :: x, y, phi

        phi = mesh%get_phi()

        ! Allocate fields
        allocate(self%charfun(mesh%get_n_points()))
        allocate(self%dirindfun(mesh%get_n_points()))

        !$omp parallel default(none) private(l, x, y) &
        !$omp shared(self, mesh, equi, phi)
        !$omp do
        do l = 1, mesh%get_n_points()
            x = mesh%get_x(l)
            y = mesh%get_y(l)
            if (equi%in_vessel(x, y, phi)) then
                self%charfun(l) = 0.0_FP
            else
                self%charfun(l) = 1.0_FP
            endif

            ! Set dirindfun to 0
            self%dirindfun(l) = 0.0_FP 
        enddo
        !$omp end do
        !$omp end parallel

        ! Build inds and adj_inds
        call self%build_inds(mesh)
        call self%build_adj_inds(mesh)

    end subroutine

    subroutine display(self)
        class(immersed_vessel_t), intent(in) :: self

        ! No parameters to display

    end subroutine

    subroutine destructor_immersed_vessel_t(self)
        !! Destructor for immersed_vessel_t
        type(immersed_vessel_t), intent(inout) :: self

        if (allocated(self%charfun)) deallocate(self%charfun)
        if (allocated(self%dirindfun)) deallocate(self%dirindfun)
        if (allocated(self%inds)) deallocate(self%inds)
        if (allocated(self%adj_inds)) deallocate(self%adj_inds)

    end subroutine

end module