linear_spring Derived Type

type, public, extends(axial_force_element) :: linear_spring

Defines a linear axial spring supporting tension and compression.


Contents


Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: body_1 = 0

The one-based body index for the first attachment point, or zero for a ground point.

integer(kind=int32), public :: body_2 = 0

The one-based body index for the second attachment point, or zero for a ground point.

real(kind=real64), public :: free_length = 0.0d0

The zero-force element length, including preload definition.

real(kind=real64), public, dimension(3) :: point_1 = 0.0d0

The first attachment point in body_1 coordinates, or in world coordinates when body_1 is zero.

real(kind=real64), public, dimension(3) :: point_2 = 0.0d0

The second attachment point in body_2 coordinates, or in world coordinates when body_2 is zero.

real(kind=real64), public :: stiffness = 0.0d0

The force per unit extension.


Type-Bound Procedures

procedure, public :: evaluate_force => linear_spring_force

  • private pure function linear_spring_force(this, length, length_rate) result(rst)

    Evaluates the signed force produced by a linear axial spring.

    Arguments

    Type IntentOptional Attributes Name
    class(linear_spring), intent(in) :: this

    The spring whose stiffness and free length define the force law.

    real(kind=real64), intent(in) :: length

    The current element length and its time derivative. The rate is unused by a linear spring.

    real(kind=real64), intent(in) :: length_rate

    The current element length and its time derivative. The rate is unused by a linear spring.

    Return Value real(kind=real64)

    The signed spring force, positive in the element's point-1 to point-2 direction.