Sample User-Subroutine Load

<< Click to Display Table of Contents >>

Navigation:  Flexcom > Theory > Applied Loading > Additional Loading Options > User-Defined Forces >

Sample User-Subroutine Load

Previous pageNext page

In a particular analysis, it is required to invoke the user-subroutine option to define point loads at two nodes (say 20 and 30) in degrees of freedom 2 and 3 respectively. It is also necessary to define a uniformly distributed load along a section of the structure (say Elements 36, 37 and 38) in DOF 2. The various loads are all sinusoidal, of period 10 seconds, but the magnitudes and phases relative to the analysis regular wave are different for each load, as defined in the first table below. It must be stressed here of course that these values are entirely notional, and do not represent any reasonable condition, or indeed a situation that is ever likely to occur. A subroutine usrlod to apply these displacements is shown in the second table below. Note the use of if ... then ... else statements to vary the load magnitude and phase.

Sample Amplitude and Phase Values

Load

Node

Element

DOF

Amplitude (N)

Phase (deg)

Point

Point

Distributed

20

30

---

---

---

36, 37, 38

2

3

2

500.

100.

400.

90.

-90.

45.

 

Sample Load User-Subroutine

 

! Subroutine usrlod -- to prescribe time-dependent loads.

! Do not modify the following lines.

subroutine usrlod(key, node, lsta, lend, ndof, time, ramp, value)

!dec$ attributes dllexport, stdcall, reference :: usrlod

  implicit none

  

  integer, intent(in) :: key

  !dec$ attributes reference :: key

  integer, intent(in) :: node

  !dec$ attributes reference :: node

  integer, intent(in) :: lsta

  !dec$ attributes reference :: lsta

  integer, intent(in) :: lend

  !dec$ attributes reference :: lend

  integer, intent(in) :: ndof

  !dec$ attributes reference :: ndof

  real(8), intent(in) :: time

  !dec$ attributes reference :: time

  real(8), intent(in) :: ramp

  !dec$ attributes reference :: ramp

  real(8), intent(inout) :: value

  !dec$ attributes reference :: value

!

! Variable Names

!

!     key     : Key to indicate point load (key = 1) or udl (key = 2).

!     node    : The number of the node for which usrlod is being called,

!               for key = 1; node is 0 for key = 2.

!     lsta    : The number of the start element for which usrlod is being

!             : called to prescribe a udl, for key = 2; lsta is 0 for

!             : key = 1.

!     lend    : The number of the endt element for which usrlod is being

!             : called to prescribe a udl, for key = 2; lend is 0 for

!             : key = 1.

!     ndof    : The number of the degree of freedom (dof) for which usrlod

!               is being called.

!     time    : The present simulation time.

!     ramp    : The current value of the ramp being applied to loads and

!               displacements.

!     value   : The value of the load to be applied for this time value

!               (user-specified).

!

! Declare local variables.

  real(8) :: period

  real(8) :: pi

  real(8) :: factor

  real(8) :: omega

  real(8) :: amag

  real(8) :: phase

 

! Insert coding to define user-specified loading below this line.

 

  period = 10.d0

  pi     = 4.d0 * datan(1.d0)

  factor = 180.d0 / pi

  omega  = 2.d0 * pi / period

  amag   = 0.d0

  phase  = 0.d0

  

  if( key == 1 )then

    if( node == 20 )then

      amag  = 500.d0

      phase = 90.d0

    else if( node == 30 )then

      amag  = 100.d0

      phase = -90.d0

    end if

  else if( key == 2 )then

    amag  = 400.d0

    phase = 45.d0

  end if

  

  phase = phase / factor

  

  value = amag * dcos(-omega*time + phase) * ramp

 

! Do not alter the next line. 

end subroutine usrlod