Interface userdef_element_calculate()

userdef_element_calculate() is called for every iteration/time step.

1. User defined element type ELTYPE = EARTH

The interface is given as:

! -----------------------------------------------------------------------------------------------------
subroutine userdef_element_calculate(instance,c_ch_usrelname,c_ch_elid,iel,      &
                                     diameter, elin, xyz_iel, depth_iel,         &
                                     incli_iel, tracon_iel, vel_iel,iter,time,   &
                                     rts,ldyn, usrfor, usrstf, usrdamp, ierr)    &
                                     bind(c)
! -----------------------------------------------------------------------------------------------------
       import c_int, c_double, c_char
       !
       type(c_ptr), value,     intent(in) :: instance
       character(kind=c_char), intent(in) :: c_ch_usrelname(*)
       character(kind=c_char), intent(in) :: c_ch_elid(*)
       integer(c_int), intent(in) :: iel
       real(c_double), intent(in) :: diameter
       real(c_double), intent(in) :: elin
       real(c_double), dimension(3), intent(in) :: xyz_iel
       real(c_double), intent(in) :: depth_iel
       real(c_double), intent(in) :: incli_iel
       real(c_double), dimension(3,3), intent(in)  :: tracon_iel
       real(c_double), dimension(3)  , intent(in)  :: vel_iel
       integer(c_int), intent(in) :: iter
       real(c_double), intent(in) :: time
       real(c_double), intent(in) :: rts
       integer(c_int), intent(in) :: ldyn
       !
       real(c_double), dimension(3)  , intent(out) :: usrfor(3)
       real(c_double), dimension(3,3), intent(out) :: usrstf(3,3)
       real(c_double), dimension(3,3), intent(out) :: usrdamp(3,3)
       !
       integer(c_int), intent(out):: ierr
     end subroutine interface_userdef_calculate

1.1. Input and output data

A description of the input and output is given in Table 1.

Table 1. Input and output
Data Input/Output Type Size Description

instance

I

pointer

-

Pointer to model specific data

c_ch_usrelname

I

CH

*

Name of the dll

c_ch_elid

I

CH

*

User defined id

iel

I

INT

-

Element number

See Figure 1.

Diameter

I

DOUBLE

-

External contact diameter.

  • The external contact diameter is twice the external contact radius.

  • If the external contact radius = 0, the external contact diameter is calculated from the external area of the cross section.

elin

I

DOUBLE

-

Element length

NOTE: The length is equal to the half-length between the nodes on the reference element, see

See Figure 1 and Figure 2.

xyz_iel

I

DOUBLE, ARRAY

3

Coordinates for element iel
See Figure 1

incli_iel

I

DOUBLE

-

Angle [radians] between the user element and the sea floor.
See Figure 2.

depth_iel

I

DOUBLE

-

depth for element iel (from mean water level)
See Figure 2.

tracon_iel

I

DOUBLE

9

Transformation matrix between local and global systems:

vlocal= tracon_iel * vglobal

vel_iel

I

DOUBLE

6

Structural velocity in all 6-dofs in the global system

iter

I

I

iteration step

time

I

DOUBLE

Accumulated time [s]

rts

I

DOUBLE

Time step

ldyn

I

INT

-

Flag, static or dynamic analysis

  • 0: static analysis

  • 1: linear analysis

  • 2: nonlinear analysis

  • 3: freq. domain analysis

usrfor

O

DOUBLE

3

(3) - forces in x, y & z-direction (global coordinate system)

urstf

O

DOUBLE

3,3

3-by-3 tangent stiffness matrix (global coordinate system)

usrdamp

O

DOUBLE

3,3

3-by-3 damping matrix (global coordinate system)

ierr

IO

INT

-

Error flag

Multidimensional arrays are stored using column major order.