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.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | id | ||||
type(bc_math), | private, | pointer | :: | math | => | null() | |
type(motion), | private | :: | mot | ||||
type(bc_wall), | private, | pointer | :: | wall | => | null() |
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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(:) |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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(:) |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bc_poly), | intent(in) | :: | bc | |||
real(kind=psb_dpk_), | intent(in) | :: | x1 | |||
real(kind=psb_dpk_), | intent(in) | :: | x2 |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bc_poly), | intent(in) | :: | bc | |||
real(kind=psb_dpk_), | intent(in) | :: | x |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bc_poly), | intent(in) | :: | bc |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bc_poly), | intent(in) | :: | bc |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bc_poly), | intent(in) | :: | bc |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
----- Getters -----
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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