primitive_object Derived Type

type, public, abstract :: primitive_object

Convervative object class.

Inherited By

type~~primitive_object~~InheritedByGraph type~primitive_object primitive_object type~primitive_compressible primitive_compressible type~primitive_object->type~primitive_compressible
Help

Source Code


Type-Bound Procedures

procedure(symmetric_operator), public, deferred, pass(lhs) :: add

Operator +.

  • function symmetric_operator(lhs, rhs) result(operator_result) Prototype

    Symmetric operator prim.op.prim.

    Arguments

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

    Left hand side.

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

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(array_interface), public, deferred, pass(self) :: array

Return serialized array of primitive.

  • pure function array_interface(self) result(array_) Prototype

    Return serialized array of primitive.

    Arguments

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

    Primitive.

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

    Serialized array of primitive.

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

Overload =.

procedure(description_interface), public, deferred, pass(self) :: description

Return pretty-printed object description.

  • pure function description_interface(self, prefix) result(desc) Prototype

    Return a pretty-formatted object description.

    Arguments

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

    Primitive.

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

    Prefixing string.

    Return Value character(len=:), allocatable

    Description.

procedure(destroy_interface), public, deferred, pass(self) :: destroy

Destroy primitive.

  • elemental subroutine destroy_interface(self) Prototype

    Destroy primitive.

    Arguments

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

    Primitive.

procedure(energy_interface), public, deferred, pass(self) :: energy

Return energy value.

  • elemental function energy_interface(self, eos) result(energy_) Prototype

    Return energy value.

    Arguments

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

    Primitive.

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

    Equation of state.

    Return Value real(kind=R8P)

    Energy value.

procedure(initialize_interface), public, deferred, pass(self) :: initialize

Initialize primitive.

  • subroutine initialize_interface(self, initial_state) Prototype

    Initialize primitive.

    Arguments

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

    Primitive.

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

    Initial state.

procedure(momentum_interface), public, deferred, pass(self) :: momentum

Return momentum vector.

  • elemental function momentum_interface(self) result(momentum_) Prototype

    Return momentum vector.

    Arguments

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

    Primitive.

    Return Value type(vector)

    Momentum vector.

procedure(unary_operator), public, deferred, pass(self) :: negative

Unary operator - prim.

  • function unary_operator(self) result(operator_result) Prototype

    Unary operator .op.prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_object), 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(unary_operator), public, deferred, pass(self) :: positive

Unary operator + prim.

  • function unary_operator(self) result(operator_result) Prototype

    Unary operator .op.prim.

    Arguments

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

    Primitive.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(assignment_interface), public, deferred, pass(lhs) :: prim_assign_prim

Operator =.

procedure(prim_operator_real), public, deferred, pass(lhs) :: prim_divide_real

Operator prim / real.

  • function prim_operator_real(lhs, rhs) result(operator_result) Prototype

    Operator prim.op.real.

    Arguments

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

    Left hand side.

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

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(symmetric_operator), public, deferred, pass(lhs) :: prim_multiply_prim

Operator *.

  • function symmetric_operator(lhs, rhs) result(operator_result) Prototype

    Symmetric operator prim.op.prim.

    Arguments

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

    Left hand side.

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

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(prim_operator_real), public, deferred, pass(lhs) :: prim_multiply_real

Operator prim * real.

  • function prim_operator_real(lhs, rhs) result(operator_result) Prototype

    Operator prim.op.real.

    Arguments

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

    Left hand side.

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

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(real_operator_prim), public, deferred, pass(rhs) :: real_multiply_prim

Operator real * prim.

  • function real_operator_prim(lhs, rhs) result(operator_result) Prototype

    Operator real * prim.

    Arguments

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

    Left hand side.

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

    Right hand side.

    Return Value class(primitive_object), allocatable

    Operator result.

procedure(symmetric_operator), public, deferred, pass(lhs) :: sub

Operator -.

  • function symmetric_operator(lhs, rhs) result(operator_result) Prototype

    Symmetric operator prim.op.prim.

    Arguments

    Type IntentOptional AttributesName
    class(primitive_object), 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, abstract :: primitive_object
   !< Convervative object class.
   contains
      ! deferred methods
      procedure(array_interface),       pass(self), deferred :: array              !< Return serialized array of primitive.
      procedure(description_interface), pass(self), deferred :: description        !< Return pretty-printed object description.
      procedure(destroy_interface),     pass(self), deferred :: destroy            !< Destroy primitive.
      procedure(energy_interface),      pass(self), deferred :: energy             !< Return energy value.
      procedure(initialize_interface),  pass(self), deferred :: initialize         !< Initialize primitive.
      procedure(momentum_interface),    pass(self), deferred :: momentum           !< Return momentum vector.
      procedure(assignment_interface),  pass(lhs),  deferred :: prim_assign_prim   !< Operator `=`.
      procedure(prim_operator_real),    pass(lhs),  deferred :: prim_divide_real   !< Operator `prim / real`.
      procedure(prim_operator_real),    pass(lhs),  deferred :: prim_multiply_real !< Operator `prim * real`.
      procedure(symmetric_operator),    pass(lhs),  deferred :: prim_multiply_prim !< Operator `*`.
      procedure(real_operator_prim),    pass(rhs),  deferred :: real_multiply_prim !< Operator `real * prim`.
      procedure(symmetric_operator),    pass(lhs),  deferred :: add                !< Operator `+`.
      procedure(unary_operator),        pass(self), deferred :: positive           !< Unary operator `+ prim`.
      procedure(symmetric_operator),    pass(lhs),  deferred :: sub                !< Operator `-`.
      procedure(unary_operator),        pass(self), deferred :: negative           !< Unary operator `- prim`.
      ! operators
      generic :: assignment(=) => prim_assign_prim                                         !< Overload `=`.
      generic :: operator(+) => add, positive                                              !< Overload `+`.
      generic :: operator(-) => sub, negative                                              !< Overload `-`.
      generic :: operator(*) => prim_multiply_prim, prim_multiply_real, real_multiply_prim !< Overload `*`.
      generic :: operator(/) => prim_divide_real                                           !< Overload `/`.
endtype primitive_object