FEDEM Solver  R8.0
Source code of the dynamics solver
Functions/Subroutines
userdefelroutinesmodule Module Reference

Module with subroutines for user-defined element calculations. More...

Functions/Subroutines

subroutine initializeude (elmId, etype, nedof, triads, iwork, rwork, ierr)
 Initializes a user-defined element. More...
 
subroutine, private updateude (elmId, etype, nedof, triads, engines, iwork, rwork, hydyn, envir, K, C, M, Fs, Fd, Fi, Q, Tlg, t, dt, istep, iter, ierr)
 Updates a user-defined element. More...
 
subroutine updateudes (elms, env, time, timeStep, istep, iter, ierr)
 Updates all user-defined elements in the model. More...
 
subroutine, private calcmorisonforces (elmId, nedof, triads, Tlg, urd, urdd, C, M, Q, hydyn, envir, time, istep, iter, ierr)
 Calculates Morison force contributions for a two-noded element. More...
 
subroutine, private calcbuoyancyforces (elmId, nedof, triads, Tlg, Q, hydyn, envir, time, iter, ierr)
 Calculates buoyancy force contributions for a two-noded element. More...
 
subroutine addinudeforces (sam, elms, FSk, FDk, FIk, Qk, RFk, ierr)
 Adds element forces into corresponding system force vectors. More...
 
subroutine addinstaticudeforces (sam, elms, FSk, Qk, RFk, ierr)
 Adds static element forces into corresponding system force vectors. More...
 
subroutine addinudemat (udeMat, sysMat, elm, sam, ierr, sysRhs)
 Adds an element matrix into the equivalent system matrix. More...
 
subroutine buildudenewtonmat (scaleM, scaleC, scaleK, elm, ierr)
 Computes the user-defined element Newton matrix. More...
 

Detailed Description

Module with subroutines for user-defined element calculations.

This module contains a set of subroutines for performing various computation tasks on the userdefeltypemodule::userdefeltype objects in the model during the dynamic or quasi-static simulation.

Function/Subroutine Documentation

◆ addinstaticudeforces()

subroutine userdefelroutinesmodule::addinstaticudeforces ( type(samtype), intent(in)  sam,
type(userdefeltype), dimension(:), intent(in)  elms,
real(dp), dimension(:), intent(inout)  FSk,
real(dp), dimension(:), intent(inout)  Qk,
real(dp), dimension(:), intent(inout)  RFk,
integer, intent(out)  ierr 
)

Adds static element forces into corresponding system force vectors.

Parameters
[in]samData for managing system matrix assembly
[in]elmsAll user-defined elements in the model
FSkInternal stiffness force vector
QkExternal force vector (gravitation loads)
RFkReaction forces
[out]ierrError flag
Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addinudeforces()

subroutine userdefelroutinesmodule::addinudeforces ( type(samtype), intent(in)  sam,
type(userdefeltype), dimension(:), intent(in)  elms,
real(dp), dimension(:), intent(inout)  FSk,
real(dp), dimension(:), intent(inout)  FDk,
real(dp), dimension(:), intent(inout)  FIk,
real(dp), dimension(:), intent(inout)  Qk,
real(dp), dimension(:), intent(inout)  RFk,
integer, intent(out)  ierr 
)

Adds element forces into corresponding system force vectors.

Parameters
[in]samData for managing system matrix assembly
[in]elmsAll user-defined elements in the model
FSkInternal stiffness force vector
FDkInternal damping force vector
FIkInternal inertia force vector
QkExternal force vector (gravitation loads)
RFkReaction forces
[out]ierrError flag
Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addinudemat()

subroutine userdefelroutinesmodule::addinudemat ( real(dp), dimension(:,:), intent(in)  udeMat,
type(sysmatrixtype), intent(inout)  sysMat,
type(userdefeltype), intent(in)  elm,
type(samtype), intent(in)  sam,
integer, intent(out)  ierr,
real(dp), dimension(:), intent(inout), optional  sysRhs 
)

Adds an element matrix into the equivalent system matrix.

Parameters
[in]udeMatThe element matrix to add into the system
sysMatSystem coefficiant matrix (stiffness, mass, ...)
[in]elmThe user-defined element the matrix is associated with
[in]samData for managing system matrix assembly
[out]ierrError flag
sysRhsSystem right-hand-side vector

This subroutine transforms the user-defined element matrix udeMat to the system directions for each DOF associated with it, and then adds it into the corresponding system matrix sysMat. If any of the element DOFs are prescribed, the associated force contributions are added into the system force vector sysRhs, if present.

Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildudenewtonmat()

subroutine userdefelroutinesmodule::buildudenewtonmat ( real(dp), intent(in)  scaleM,
real(dp), intent(in)  scaleC,
real(dp), intent(in)  scaleK,
type(userdefeltype), intent(inout)  elm,
integer, intent(out)  ierr 
)

Computes the user-defined element Newton matrix.

Parameters
[in]scaleMMass matrix scaling factor
[in]scaleCDamping matrix scaling factor
[in]scaleKStiffness matrix scaling factor
elmThe user-defined element to compute Newton matrix for
[out]ierrError flag

The Newton matrix is a linear combination of the stiffness-, damping- (if any) and stiffness matrices of the user-defined element.

Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcbuoyancyforces()

subroutine, private userdefelroutinesmodule::calcbuoyancyforces ( character(len=*), intent(in)  elmId,
integer, intent(in)  nedof,
type(triadptrtype), dimension(:), intent(in)  triads,
real(dp), dimension(:,:), intent(in)  Tlg,
real(dp), dimension(:), intent(inout)  Q,
type(hydrodyntype), intent(inout)  hydyn,
type(environmenttype), intent(inout)  envir,
real(dp), intent(in)  time,
integer, intent(in)  iter,
integer, intent(inout)  ierr 
)
private

Calculates buoyancy force contributions for a two-noded element.

Parameters
[in]elmIdID string of the element to calculate for
[in]nedofDimension of the element matrices
[in]triadsThe triads connected to this user-defined element
[in]TlgLocal-to-global transformation matrix for the element
QExternal element forces
hydynData for hydrodynamic force calculation for this element
envirEnvironmental data
[in]timeCurrent simulation time
[in]iterIteration counter
[out]ierrError flag
Author
Knut Morten Okstad
Date
30 Sep 2019
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcmorisonforces()

subroutine, private userdefelroutinesmodule::calcmorisonforces ( character(len=*), intent(in)  elmId,
integer, intent(in)  nedof,
type(triadptrtype), dimension(:), intent(in)  triads,
real(dp), dimension(:,:), intent(in)  Tlg,
real(dp), dimension(:), intent(in)  urd,
real(dp), dimension(:), intent(in)  urdd,
real(dp), dimension(:,:), intent(inout)  C,
real(dp), dimension(:,:), intent(inout)  M,
real(dp), dimension(:), intent(inout)  Q,
type(hydrodyntype), intent(inout)  hydyn,
type(environmenttype), intent(inout)  envir,
real(dp), intent(in)  time,
integer, intent(in)  istep,
integer, intent(in)  iter,
integer, intent(inout)  ierr 
)
private

Calculates Morison force contributions for a two-noded element.

Parameters
[in]elmIdID string of the element to calculate for
[in]nedofDimension of the element matrices
[in]triadsThe triads connected to this user-defined element
[in]TlgLocal-to-global transformation matrix for the element
[in]urdElement velocity vector, in global coordinates
[in]urddElement acceleration vector, in global coordinates
CElement damping matrix
MElement mass matrix
QExternal element forces
hydynData for hydrodynamic force calculation for this element
envirEnvironmental data
[in]timeCurrent simulation time
[in]istepTime increment counter
[in]iterIteration counter
[out]ierrError flag
Author
Knut Morten Okstad
Date
30 Sep 2019
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeude()

subroutine userdefelroutinesmodule::initializeude ( type(idtype), intent(in)  elmId,
integer, intent(in)  etype,
integer, intent(in)  nedof,
type(triadptrtype), dimension(:), intent(in)  triads,
integer, dimension(:), pointer  iwork,
real(dp), dimension(:), pointer  rwork,
integer, intent(out)  ierr 
)

Initializes a user-defined element.

Parameters
[in]elmIdId of the user-defined element to initialize
[in]etypeUser-defined element type flag
[in]nedofDimension of the element matrices
[in]triadsThe triads connected to this user-defined element
iworkInteger work array for this user-defined element
rworkReal work array for this user-defined element
[out]ierrError flag
Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateude()

subroutine, private userdefelroutinesmodule::updateude ( type(idtype), intent(in)  elmId,
integer, intent(in)  etype,
integer, intent(in)  nedof,
type(triadptrtype), dimension(:), intent(in)  triads,
type(engineptrtype), dimension(:), intent(in)  engines,
integer, dimension(:), intent(inout)  iwork,
real(dp), dimension(:), intent(inout)  rwork,
type(hydrodyntype), pointer  hydyn,
type(environmenttype), intent(inout)  envir,
real(dp), dimension(:,:), intent(out)  K,
real(dp), dimension(:,:), intent(out)  C,
real(dp), dimension(:,:), intent(out)  M,
real(dp), dimension(:), intent(out)  Fs,
real(dp), dimension(:), intent(out)  Fd,
real(dp), dimension(:), intent(out)  Fi,
real(dp), dimension(:), intent(out)  Q,
real(dp), dimension(3,4), intent(out)  Tlg,
real(dp), intent(in)  t,
real(dp), intent(in)  dt,
integer, intent(in)  istep,
integer, intent(in)  iter,
integer, intent(out)  ierr 
)
private

Updates a user-defined element.

Parameters
[in]elmIdId of the user-defined element to update
[in]etypeUser-defined element type flag
[in]nedofDimension of the element matrices
[in]triadsThe triads connected to this user-defined element
[in]enginesThe engines connected to this user-defined element
iworkInteger work array for this user-defined element
rworkReal work array for this user-defined element
hydynData for hydrodynamic force calculation for this element
envirEnvironmental data
[out]KTangent stiffness matrix
[out]CDamping matrix
[out]MMass matrix
[out]FsInternal elastic forces
[out]FdDamping forces
[out]FiIntertia forces
[out]QExternal forces
[out]TlgLocal-to-global transformation matrix for the element
[in]tCurrent simulation time
[in]dtTime increment size
[in]istepTime increment counter
[in]iterIteration counter
[out]ierrError flag

This is the main work-horse for the user-defined element objects. It is responsible for calculation of all tangent matrices and associated right-hand-side force vectors eminating from the linearized dynamic equilibrium equation. The subroutine is typically invoked once per Newton iteration for each element.

Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateudes()

subroutine userdefelroutinesmodule::updateudes ( type(userdefeltype), dimension(:), intent(inout)  elms,
type(environmenttype), intent(inout)  env,
real(dp), intent(in)  time,
real(dp), intent(in)  timeStep,
integer, intent(in)  istep,
integer, intent(in)  iter,
integer, intent(inout)  ierr 
)

Updates all user-defined elements in the model.

Parameters
elmsArray of all user-defined elements in the model
envEnvironmental data
[in]timeCurrent simulation time
[in]timeStepTime increment size
[in]istepTime increment counter
[in]iterIteration counter
[out]ierrError flag
Author
Knut Morten Okstad
Date
28 Mar 2014
Here is the call graph for this function:
Here is the caller graph for this function: