material Derived Type

type, public :: material

Encapsulate material properties and equations of state


Inherited by

type~~material~~InheritedByGraph type~material material type~matptr matptr type~matptr->type~material mat type~field field type~field->type~matptr mats 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
real(kind=psb_dpk_), private :: dtemp
integer, private :: ilaw(4)
real(kind=psb_dpk_), private, allocatable:: lambda(:)

elastic modulus

integer, private :: mat_id
character(len=name_len), private :: mat_type
real(kind=psb_dpk_), private, allocatable:: mu(:)

viscosity

character(len=name_len), private :: name
real(kind=psb_dpk_), private, allocatable:: rho(:)

density

real(kind=psb_dpk_), private, allocatable:: sh(:)

shear modulus

character(len=1), private :: state
real(kind=psb_dpk_), private :: tmax
real(kind=psb_dpk_), private :: tmin

Type-Bound Procedures

procedure, public :: create_material

  • interface

    private module subroutine create_material(mat, input_file, block_id)

    Global Constructor

    Arguments

    Type IntentOptional AttributesName
    class(material), intent(out) :: mat
    character(len=*), intent(in) :: input_file
    integer, intent(in) :: block_id

procedure, public :: free_material

  • interface

    private module subroutine free_material(mat)

    Arguments

    Type IntentOptional AttributesName
    class(material), intent(inout) :: mat

generic, public :: mat_id_ => get_material_id

generic, public :: name_ => get_material_name

generic, public :: nemo_sizeof => nemo_material_sizeof

procedure, private :: get_material_id

  • interface

    private module function get_material_id(mat)

    Getter

    Arguments

    Type IntentOptional AttributesName
    class(material), intent(in) :: mat

    Return Value integer

procedure, private :: get_material_name

  • interface

    private module function get_material_name(mat)

    Getter

    Arguments

    Type IntentOptional AttributesName
    class(material), intent(in) :: mat

    Return Value character(len=name_len)

procedure, private :: nemo_material_sizeof

  • interface

    private module function nemo_material_sizeof(mat)

    Arguments

    Type IntentOptional AttributesName
    class(material), intent(in) :: mat

    Return Value integer(kind=nemo_int_long_)

Source Code

    TYPE material
        !! Encapsulate material properties and equations of state
        PRIVATE
        !
        ! From input file ...
        CHARACTER(len=name_len) :: name
        CHARACTER(len=name_len) :: mat_type
        INTEGER :: ilaw(4)
        INTEGER :: mat_id
        !
        ! ... and from DB
        CHARACTER(len=1) :: state
        REAL(psb_dpk_) :: dtemp, tmin, tmax
        REAL(psb_dpk_), ALLOCATABLE :: rho(:)    !! density
        REAL(psb_dpk_), ALLOCATABLE :: mu(:)     !! viscosity
        REAL(psb_dpk_), ALLOCATABLE :: lambda(:) !! elastic modulus
        REAL(psb_dpk_), ALLOCATABLE :: sh(:)     !! shear modulus
    CONTAINS
        PROCEDURE :: create_material, free_material ! Constructor/Destructor
        PROCEDURE, PRIVATE :: get_material_name, get_material_id  ! Getter
        GENERIC, PUBLIC :: name_ => get_material_name
        GENERIC, PUBLIC :: mat_id_ => get_material_id
        PROCEDURE, PRIVATE :: nemo_material_sizeof
        GENERIC, PUBLIC :: nemo_sizeof => nemo_material_sizeof
    END TYPE material