primitive_compressible Derived Type

type, public, extends(primitive_object) :: primitive_compressible

type~~primitive_compressible~~InheritsGraph type~primitive_compressible primitive_compressible vector vector vector->type~primitive_compressible velocity type~primitive_object primitive_object type~primitive_object->type~primitive_compressible
Help


Convervative compressible object class.



Components

TypeVisibility AttributesNameInitial
real(kind=R8P), public :: density =0._R8P

Density, rho.

real(kind=R8P), public :: pressure =0._R8P

Pressure, p.

type(vector), public :: velocity

Velocity, v.


Constructor

public interface primitive_compressible

Overload primitive_compressible name with its constructor.


Type-Bound Procedures

procedure, public, pass(lhs) :: add

Operator +.

  • private function add(lhs, rhs) result(operator_result)

    Operator +.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    class(primitive_object), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(self) :: array

Return serialized array of primitive.

  • private pure function array(self) result(array_)

    Return serialized array of primitive.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value real(kind=R8P), allocatable, (:)

    Serialized array of primitive.

generic, public :: assignment(=) => prim_assign_prim

Overload =.

procedure, public, pass(self) :: description

Return pretty-printed object description.

  • private pure function description(self, prefix) result(desc)

    Return a pretty-formatted object description.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    character(len=*), intent(in), optional :: prefix

    Prefixing string.

    Return Value character(len=:), allocatable

    Description.

procedure, public, pass(self) :: destroy

Destroy primitive.

  • private elemental subroutine destroy(self)

    Destroy primitive.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(inout) :: self

    Primitive.

procedure, public, pass(self) :: energy

Return energy value.

  • private elemental function energy(self, eos) result(energy_)

    Return energy value.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    class(eos_object), intent(in) :: eos

    Equation of state.

    Return Value real(kind=R8P)

    Energy value.

procedure, public, pass(self) :: initialize

Initialize primitive.

  • private subroutine initialize(self, initial_state)

    Initialize primitive.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(inout) :: self

    Primitive.

    class(primitive_object), intent(in), optional :: initial_state

    Initial state.

procedure, public, pass(self) :: left_eigenvectors

Return the left eigenvectors matrix L as dF/dP = A = R ^ L.

  • private pure function left_eigenvectors(self, eos) result(eig)

    Return the left eigenvectors matrix L as dF/dP = A = R ^ L.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    class(eos_object), intent(in) :: eos

    Equation of state.

    Return Value real(kind=R8P) (1:3,1:3)

    Eigenvectors.

procedure, public, pass(self) :: momentum

Return momentum vector.

  • private elemental function momentum(self) result(momentum_)

    Return momentum vector.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value type(vector)

    Momentum vector.

procedure, public, pass(self) :: negative

Unary operator - prim.

  • private function negative(self) result(operator_result)

    Unary operator - prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value class(primitive_object), allocatable

    Operator result.

generic, public :: operator(*) => prim_multiply_prim, prim_multiply_real, real_multiply_prim

Overload *.

  • private function prim_multiply_prim(lhs, rhs) result(operator_result)

    Operator *.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    class(primitive_object), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

  • private function prim_multiply_real(lhs, rhs) result(operator_result)

    Operator prim * real.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    real(kind=R8P), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

  • private function real_multiply_prim(lhs, rhs) result(operator_result)

    Operator real * prim.

    Arguments

    Type IntentOptional AttributesName
    real(kind=R8P), intent(in) :: lhs

    Left hand side.

    class(primitive_compressible), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

generic, public :: operator(+) => add, positive

Overload +.

  • private function add(lhs, rhs) result(operator_result)

    Operator +.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    class(primitive_object), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

  • private function positive(self) result(operator_result)

    Unary operator + prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value class(primitive_object), allocatable

    Operator result.

generic, public :: operator(-) => sub, negative

Overload -.

  • private function sub(lhs, rhs) result(operator_result)

    Operator +.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    class(primitive_object), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

  • private function negative(self) result(operator_result)

    Unary operator - prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value class(primitive_object), allocatable

    Operator result.

generic, public :: operator(/) => prim_divide_real

Overload /.

  • private function prim_divide_real(lhs, rhs) result(operator_result)

    Operator prim / real.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    real(kind=R8P), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(self) :: positive

Unary operator + prim.

  • private function positive(self) result(operator_result)

    Unary operator + prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(lhs) :: prim_assign_prim

Operator =.

procedure, public, pass(lhs) :: prim_divide_real

Operator prim / real.

  • private function prim_divide_real(lhs, rhs) result(operator_result)

    Operator prim / real.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    real(kind=R8P), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(lhs) :: prim_multiply_prim

Operator *.

procedure, public, pass(lhs) :: prim_multiply_real

Operator prim * real.

  • private function prim_multiply_real(lhs, rhs) result(operator_result)

    Operator prim * real.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    real(kind=R8P), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(rhs) :: real_multiply_prim

Operator real * prim.

  • private function real_multiply_prim(lhs, rhs) result(operator_result)

    Operator real * prim.

    Arguments

    Type IntentOptional AttributesName
    real(kind=R8P), intent(in) :: lhs

    Left hand side.

    class(primitive_compressible), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure, public, pass(self) :: right_eigenvectors

Return the right eigenvectors matrix R as dF/dP = A = R ^ L.

  • private pure function right_eigenvectors(self, eos) result(eig)

    Return the right eigenvectors matrix R as dF/dP = A = R ^ L.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: self

    Primitive.

    class(eos_object), intent(in) :: eos

    Equation of state.

    Return Value real(kind=R8P) (1:3,1:3)

    Eigenvectors.

procedure, public, pass(lhs) :: sub

Operator -.

  • private function sub(lhs, rhs) result(operator_result)

    Operator +.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_compressible), intent(in) :: lhs

    Left hand side.

    class(primitive_object), intent(in) :: rhs

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

Source Code

type, extends(primitive_object) :: primitive_compressible
   !< Convervative compressible object class.
   real(R8P)    :: density=0._R8P  !< Density, `rho`.
   type(vector) :: velocity        !< Velocity, `v`.
   real(R8P)    :: pressure=0._R8P !< Pressure, `p`.
   contains
      ! public methods
      procedure, pass(self) :: left_eigenvectors  !< Return the left eigenvectors matrix `L` as `dF/dP = A = R ^ L`.
      procedure, pass(self) :: right_eigenvectors !< Return the right eigenvectors matrix `R` as `dF/dP = A = R ^ L`.
      ! deferred methods
      procedure, pass(self) :: array              !< Return serialized array of primitive.
      procedure, pass(self) :: description        !< Return pretty-printed object description.
      procedure, pass(self) :: destroy            !< Destroy primitive.
      procedure, pass(self) :: energy             !< Return energy value.
      procedure, pass(self) :: initialize         !< Initialize primitive.
      procedure, pass(self) :: momentum           !< Return momentum vector.
      procedure, pass(lhs)  :: prim_assign_prim   !< Operator `=`.
      procedure, pass(lhs)  :: prim_divide_real   !< Operator `prim / real`.
      procedure, pass(lhs)  :: prim_multiply_real !< Operator `prim * real`.
      procedure, pass(lhs)  :: prim_multiply_prim !< Operator `*`.
      procedure, pass(rhs)  :: real_multiply_prim !< Operator `real * prim`.
      procedure, pass(lhs)  :: add                !< Operator `+`.
      procedure, pass(self) :: positive           !< Unary operator `+ prim`.
      procedure, pass(lhs)  :: sub                !< Operator `-`.
      procedure, pass(self) :: negative           !< Unary operator `- prim`.
endtype primitive_compressible