bc_poly Derived Type

type, public :: bc_poly

Implement a runtime polymorphism pattern [1] to emulate an abstract parent of the bc_math/bc_wall classes. TODO: Modernize by 1. Refactoring math/wall so they extend bc_poly, 2. Replace all TYPE(bc_poly) with CLASS(bc_poly), and 3. Make bc_poly ABSTRACT.

[1] Akin, E. (2003) Object-oriented programming via Fortran 90/95. Cambridge University Press.


Inherits

type~~bc_poly~~InheritsGraph type~bc_poly bc_poly type~motion motion type~bc_poly->type~motion mot type~bc_math bc_math type~bc_poly->type~bc_math math type~bc_wall bc_wall type~bc_poly->type~bc_wall wall type~vector vector type~motion->type~vector law_y type~bc_wall->type~bc_math temp, pressure, conc, vel, pos, stress

Inherited by

type~~bc_poly~~InheritedByGraph type~bc_poly bc_poly type~field field type~field->type~bc_poly bc type~scalar_field scalar_field type~scalar_field->type~field type~vector_field vector_field type~vector_field->type~field

Contents

Source Code


Components

TypeVisibility AttributesNameInitial
integer, private :: id
type(bc_math), private, pointer:: math=> null()
type(motion), private :: mot
type(bc_wall), private, pointer:: wall=> null()

Type-Bound Procedures

generic, public :: get_abc => get_abc_s, get_abc_v

generic, public :: get_displacement => get_bc_motion_displacement

generic, public :: get_velocity => get_bc_motion_velocity

generic, public :: nemo_sizeof => nemo_bc_poly_sizeof

generic, public :: set_bc => set_bc_poly_map_s, set_bc_poly_map_v

generic, public :: surface_motion_ => get_bc_surface_motion

generic, public :: vertex_motion_ => get_bc_vertex_motion

procedure, private :: get_abc_s

  • interface

    ----- Getters -----

    Read more…

    private module subroutine get_abc_s(bc, dim, id, a, b, c)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc
    type(dimensions), intent(in) :: dim
    integer, intent(out) :: id
    real(kind=psb_dpk_), intent(inout) :: a(:)
    real(kind=psb_dpk_), intent(inout) :: b(:)
    real(kind=psb_dpk_), intent(inout) :: c(:)

procedure, private :: get_abc_v

  • interface

    ----- Getters -----

    Read more…

    private module subroutine get_abc_v(bc, dim, id, a, b, c)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc
    type(dimensions), intent(in) :: dim
    integer, intent(out) :: id
    real(kind=psb_dpk_), intent(inout) :: a(:)
    real(kind=psb_dpk_), intent(inout) :: b(:)
    type(vector), intent(inout) :: c(:)

procedure, private :: get_bc_motion_displacement

  • interface

    ----- Getters -----

    Read more…

    private module function get_bc_motion_displacement(bc, x1, x2) result(res)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc
    real(kind=psb_dpk_), intent(in) :: x1
    real(kind=psb_dpk_), intent(in) :: x2

    Return Value type(vector)

procedure, private :: get_bc_motion_velocity

  • interface

    ----- Getters -----

    Read more…

    private module function get_bc_motion_velocity(bc, x) result(res)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc
    real(kind=psb_dpk_), intent(in) :: x

    Return Value type(vector)

procedure, private :: get_bc_surface_motion

  • interface

    ----- Getters -----

    Read more…

    private module function get_bc_surface_motion(bc)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc

    Return Value integer

procedure, private :: get_bc_vertex_motion

  • interface

    ----- Getters -----

    Read more…

    private module function get_bc_vertex_motion(bc)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc

    Return Value integer

procedure, private :: nemo_bc_poly_sizeof

  • interface

    ----- Getters -----

    Read more…

    private elemental module function nemo_bc_poly_sizeof(bc)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(in) :: bc

    Return Value integer(kind=nemo_int_long_)

procedure, private :: set_bc_poly_map_s

  • interface

    ----- Getters -----

    Read more…

    private module subroutine set_bc_poly_map_s(bc, i, a, b, c)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(inout) :: bc
    integer, intent(in) :: i
    real(kind=psb_dpk_), intent(in) :: a
    real(kind=psb_dpk_), intent(in) :: b
    real(kind=psb_dpk_), intent(in) :: c

procedure, private :: set_bc_poly_map_v

  • interface

    ----- Getters -----

    Read more…

    private module subroutine set_bc_poly_map_v(bc, i, a, b, c)

    Arguments

    Type IntentOptional AttributesName
    class(bc_poly), intent(inout) :: bc
    integer, intent(in) :: i
    real(kind=psb_dpk_), intent(in) :: a
    real(kind=psb_dpk_), intent(in) :: b
    type(vector), intent(in) :: c

Source Code

    TYPE bc_poly
      !! Implement a runtime polymorphism pattern [1] to emulate an abstract parent of the bc_math/bc_wall classes.
      !! TODO: Modernize by 1. Refactoring math/wall so they extend bc_poly, 2. Replace all TYPE(bc_poly) with CLASS(bc_poly), and
      !! 3. Make bc_poly ABSTRACT.
      !!
      !! [1] Akin, E. (2003) Object-oriented programming via Fortran 90/95. Cambridge University Press.
        PRIVATE
        INTEGER :: id
        TYPE(motion) :: mot
        TYPE(bc_math), POINTER :: math => NULL()
        TYPE(bc_wall), POINTER :: wall => NULL()
    CONTAINS
        PROCEDURE, PRIVATE :: get_abc_s, get_abc_v
        GENERIC, PUBLIC :: get_abc => get_abc_s, get_abc_v
        PROCEDURE, PRIVATE :: set_bc_poly_map_s, set_bc_poly_map_v
        GENERIC, PUBLIC :: set_bc => set_bc_poly_map_s, set_bc_poly_map_v
        PROCEDURE, PRIVATE :: get_bc_surface_motion, get_bc_vertex_motion
        GENERIC, PUBLIC :: surface_motion_ => get_bc_surface_motion
        GENERIC, PUBLIC :: vertex_motion_ => get_bc_vertex_motion
        PROCEDURE, PRIVATE :: get_bc_motion_displacement
        GENERIC, PUBLIC :: get_displacement => get_bc_motion_displacement
        PROCEDURE, PRIVATE :: get_bc_motion_velocity
        GENERIC, PUBLIC :: get_velocity => get_bc_motion_velocity
        PROCEDURE, PRIVATE :: nemo_bc_poly_sizeof
        GENERIC, PUBLIC :: nemo_sizeof => nemo_bc_poly_sizeof
    END TYPE bc_poly