FEDEM Solver  R8.0
Source code of the dynamics solver
Functions/Subroutines
solverDriver.f90 File Reference

Global driver routines for the FEDEM Dynamics Solver. More...

Functions/Subroutines

subroutine slv_init0 (ierr)
 Initializes a new simulation process. More...
 
subroutine slv_inita (xinp, nxinp, ierr)
 Initializes a new simulation process. More...
 
subroutine slv_initb (chfsi, ierr)
 Initializes a new simulation process. More...
 
subroutine slv_initc (chfsi, data, ndat, ierr)
 Initializes a new simulation process and restarts from provided state. More...
 
subroutine slv_initd (data, ndat, ierr)
 Initializes a new simulation process and restarts from provided state. More...
 
subroutine slv_restart (data, ndat, writeToRDB, ierr)
 Restarts a running solver process from the provided state. More...
 
subroutine slv_next (iop, final, done, ierr)
 Solves the next time increment by Newton-Raphson iterations. More...
 
subroutine slv_modes (nMode, eval, evec, dofOrder, useLaPack, ierr)
 Solves the eigenvalue system at current configuration. More...
 
subroutine slv_inverse (x, xeqs, feqs, ndis, nfrc, done, ierr)
 Solves the inverse problem at the current state. More...
 
subroutine slv_done (ierr)
 Terminates the running solver process by deallocating all memory, etc. More...
 
real(dp) function slv_gettime (nextStep, ierr)
 Returns the time of current or next time increment. More...
 
subroutine slv_settime (nextTime, ierr)
 Sets the time increment size of the next time step. More...
 
real(dp) function slv_getfunc (uid, x, ierr)
 Evaluates the specified function. More...
 
real(dp) function slv_getfunction (ierr, uid, tag)
 Evaluates the (first) function identified by the given tag. More...
 
integer function slv_getfuncid (tag)
 Returns the user ID of (first) function identified by the given tag. More...
 
subroutine slv_getsmat (Nmat, iopM, ierr)
 Returns a system matrix in full format. More...
 
subroutine slv_getemat (Emat, bid, iopM, ierr)
 Returns an element matrix. More...
 
subroutine slv_rhsvec (Rvec, iopV, ierr)
 Sets, updates or retrieves a system right-hand-side vector. More...
 
subroutine slv_straindisp (disp, gageIds, eps, ndof, ng, ierr)
 Calculates the strains at strain gages for a given displacement field. More...
 
subroutine slv_beamforces (disp, beamIds, forces, ndof, nBeams, ierr)
 Calculates beam section forces for given displacement vector. More...
 
subroutine slv_reldistance (disp, Ids, relDis, ndof, nIds, ierr)
 Calculates the rel. dist between triads for given displacement vector. More...
 
subroutine slv_responsevars (disp, Ids, Var, ndof, nIds, ierr)
 Calculates response variable values for given displacement vector. More...
 
subroutine slv_jointspring (sprCoeff, bid, ierr)
 Gets joint spring stiffness coefficients. More...
 
integer function slv_geteqn (bid, meqn)
 Returns the equation numbers affected by a given mechanism object. More...
 
integer function slv_getvar (bid, var)
 Returns the state variables for a given mechanism object. More...
 
integer function slv_syssize (expanded)
 Returns the dimension of the system matrices and vectors. More...
 
integer function slv_statesize (posOnly)
 Returns the size of the total state array. More...
 
integer function slv_gagessize ()
 Returns the size of the strain gage state array. More...
 
integer function slv_partsize (iopS, bid)
 Returns the size of the deformation/stress state array for a FE part. More...
 
subroutine slv_savestate (posOnly, data, ndat, ierr)
 Saves the current state to an array in core. More...
 
subroutine slv_initgages (iopS, data, ndat, ierr)
 Save/restores initial gage strain state to/from an array in core. More...
 
subroutine slv_savepart (iopS, bid, data, ndat, ierr)
 Saves current deformation state for an FE part to an array in core. More...
 

Detailed Description

Global driver routines for the FEDEM Dynamics Solver.

All subroutines and functions of this file are global wrappers of the subroutines located in the solvermodule. They are defined in a way to facilitate invocation from C or C++, only with arguments of primitive data types that can be casted to equivalent data types in C/C++.

All the subroutines are used by the C++ API defined in solverInterface.C, however, no caller graphs are provided for them since Doxygen seems not to be able to generate cross-language call graphs.

Author
Knut Morten Okstad, Fedem Technology AS
Date
30 Nov 2016

Function/Subroutine Documentation

◆ slv_beamforces()

subroutine slv_beamforces ( real(dp), dimension(*), intent(in)  disp,
integer, dimension(*), intent(in)  beamIds,
real(dp), dimension(*), intent(out)  forces,
integer, intent(in)  ndof,
integer, intent(in)  nBeams,
integer, intent(out)  ierr 
)

Calculates beam section forces for given displacement vector.

Parameters
[in]dispDisplacement vector
[in]beamidsBase IDs of beam elements
[out]forcesSectional forces at beam ends
[in]ndofLength of displacement vector
[in]nbeamsNumber of beam elements
[out]ierrError flag
Here is the call graph for this function:

◆ slv_done()

subroutine slv_done ( integer, intent(out)  ierr)

Terminates the running solver process by deallocating all memory, etc.

Parameters
[out]ierrError flag
Here is the call graph for this function:

◆ slv_gagessize()

integer function slv_gagessize

Returns the size of the strain gage state array.

Here is the call graph for this function:

◆ slv_getemat()

subroutine slv_getemat ( real(dp), dimension(*), intent(out)  Emat,
integer, intent(in)  bid,
integer, intent(in)  iopM,
integer, intent(out)  ierr 
)

Returns an element matrix.

Parameters
[out]ematThe element matrix
[in]bidBase ID of the element to consider
[in]iopmFlag indicating which matrix to return
[out]ierrError Flag
Here is the call graph for this function:

◆ slv_geteqn()

integer function slv_geteqn ( integer, intent(in)  bid,
integer, dimension(*), intent(out)  meqn 
)

Returns the equation numbers affected by a given mechanism object.

Parameters
[in]bidBase ID of the mechanism object to consider
[out]meqnList of equation numbers
Here is the call graph for this function:

◆ slv_getfunc()

real(dp) function slv_getfunc ( integer, intent(in)  uid,
real(dp), intent(in)  x,
integer, intent(inout)  ierr 
)

Evaluates the specified function.

Parameters
[in]uidUser ID of the function to evaluate
[in]xThe function argument value
[in,out]ierrError flag
Here is the call graph for this function:

◆ slv_getfuncid()

integer function slv_getfuncid ( character(len=*), intent(in)  tag)

Returns the user ID of (first) function identified by the given tag.

Parameters
[in]tagTag identifying the function
Here is the call graph for this function:

◆ slv_getfunction()

real(dp) function slv_getfunction ( integer, intent(inout)  ierr,
integer, intent(in)  uid,
character(len=*), intent(in)  tag 
)

Evaluates the (first) function identified by the given tag.

Parameters
[in]uidUser ID of the function to evaluate
[in]tagTag identifying the function
[in,out]ierrError flag
Here is the call graph for this function:

◆ slv_getsmat()

subroutine slv_getsmat ( real(dp), dimension(*), intent(out)  Nmat,
integer, intent(in)  iopM,
integer, intent(out)  ierr 
)

Returns a system matrix in full format.

Parameters
[out]nmatThe system matrix
[in]iopmFlag indicating which matrix to return
[out]ierrError flag
Here is the call graph for this function:

◆ slv_gettime()

real(dp) function slv_gettime ( logical, intent(in)  nextStep,
integer, intent(inout)  ierr 
)

Returns the time of current or next time increment.

Parameters
[in]nextstepIf .true, return the time of next step
[in,out]ierrError flag
Here is the call graph for this function:

◆ slv_getvar()

integer function slv_getvar ( integer, intent(in)  bid,
real(dp), dimension(*), intent(out)  var 
)

Returns the state variables for a given mechanism object.

Parameters
[in]bidBase ID of the mechanism object to consider
[out]varList of state variables
Here is the call graph for this function:

◆ slv_init0()

subroutine slv_init0 ( integer, intent(out)  ierr)

Initializes a new simulation process.

Parameters
[out]ierrError flag
Here is the call graph for this function:

◆ slv_inita()

subroutine slv_inita ( real(dp), dimension(*), intent(in)  xinp,
integer, intent(inout)  nxinp,
integer, intent(out)  ierr 
)

Initializes a new simulation process.

Parameters
[in]xinpInitial external function values
[in,out]nxinpLength of the xinp array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_initb()

subroutine slv_initb ( character(len=*), intent(in)  chfsi,
integer, intent(out)  ierr 
)

Initializes a new simulation process.

Parameters
[in]chfsiContent of the solver input file
[out]ierrError flag
Here is the call graph for this function:

◆ slv_initc()

subroutine slv_initc ( character(len=*), intent(in)  chfsi,
real(dp), dimension(*), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(out)  ierr 
)

Initializes a new simulation process and restarts from provided state.

Parameters
[in]chfsiContent of the solver input file
[in]dataArray of state variables
[in]ndatLength of the data array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_initd()

subroutine slv_initd ( real(dp), dimension(*), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(out)  ierr 
)

Initializes a new simulation process and restarts from provided state.

Parameters
[in]dataArray of state variables
[in]ndatLength of the data array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_initgages()

subroutine slv_initgages ( integer, intent(in)  iopS,
real(dp), dimension(*), intent(out)  data,
integer, intent(in)  ndat,
integer, intent(out)  ierr 
)

Save/restores initial gage strain state to/from an array in core.

Parameters
[in]iopsOperation code telling what to do
[out]dataArray receiving the state variables
[in]ndatLength of the state array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_inverse()

subroutine slv_inverse ( real(dp), dimension(*), intent(in)  x,
integer, dimension(*), intent(in)  xeqs,
integer, dimension(*), intent(in)  feqs,
integer, intent(in)  ndis,
integer, intent(in)  nfrc,
logical, intent(out)  done,
integer, intent(out)  ierr 
)

Solves the inverse problem at the current state.

Parameters
[in]xArray with response data at certain DOFs
[in]xeqsArray of equation numbers of the DOFs with x values
[in]feqsArray of equation numbers of the DOFs for force calculation
[in]ndisLength of array x and xeqs
[in]nfrcLength of array feqs
[out]doneIf .true., the simulation is finished or failed
[out]ierrError flag
Here is the call graph for this function:

◆ slv_jointspring()

subroutine slv_jointspring ( real(dp), dimension(*), intent(out)  sprCoeff,
integer, intent(in)  bid,
integer, intent(out)  ierr 
)

Gets joint spring stiffness coefficients.

Parameters
[out]sprcoeffJoint spring stiffness coefficients
[in]bidBase ID of the spring
[out]ierrError flag
Here is the call graph for this function:

◆ slv_modes()

subroutine slv_modes ( integer, intent(in)  nMode,
real(dp), dimension(*), intent(out)  eval,
real(dp), dimension(*), intent(out)  evec,
logical, intent(in)  dofOrder,
integer, intent(in)  useLaPack,
integer, intent(out)  ierr 
)

Solves the eigenvalue system at current configuration.

Parameters
[in]nModeNumber of eigenmodes to compute
[out]evalComputed eigenvalues
[out]evecComputed eigenvectors
[in]dofOrderIf .true., return eigenvectors in DOF-order
[in]useLaPackFlag usage of LAPACK dense matrix eigensolver
[out]ierrError flag
Here is the call graph for this function:

◆ slv_next()

subroutine slv_next ( integer, intent(inout)  iop,
logical, intent(in)  final,
logical, intent(out)  done,
integer, intent(out)  ierr 
)

Solves the next time increment by Newton-Raphson iterations.

Parameters
iopOperation flag telling what to do, see solvermodule::solvestep
[in]finalIf .true., this is assumed to be the final time step
[out]doneIf .true., the simulation is finished or failed
[out]ierrError flag
Here is the call graph for this function:

◆ slv_partsize()

integer function slv_partsize ( integer, intent(in)  iopS,
integer, intent(in)  bid 
)

Returns the size of the deformation/stress state array for a FE part.

Parameters
[in]iopsOperation code telling which state to consider
[in]bidBase ID of the FE part to consider
Here is the call graph for this function:

◆ slv_reldistance()

subroutine slv_reldistance ( real(dp), dimension(*), intent(in)  disp,
integer, dimension(*), intent(in)  Ids,
real(dp), dimension(*), intent(out)  relDis,
integer, intent(in)  ndof,
integer, intent(in)  nIds,
integer, intent(out)  ierr 
)

Calculates the rel. dist between triads for given displacement vector.

Parameters
[in]dispDisplacement vector
[in]idsUser IDs of functions to use
[out]reldisRelative displacement change
[in]ndofLength of displacement vector
[in]nidsLength of Ids and relDis arrays
[out]ierrError flag
Here is the call graph for this function:

◆ slv_responsevars()

subroutine slv_responsevars ( real(dp), dimension(*), intent(in)  disp,
integer, dimension(*), intent(in)  Ids,
real(dp), dimension(*), intent(out)  Var,
integer, intent(in)  ndof,
integer, intent(in)  nIds,
integer, intent(out)  ierr 
)

Calculates response variable values for given displacement vector.

Parameters
[in]dispDisplacement vector
[in]idsUser IDs of functions to use
[out]varResponse variable values
[in]ndofLength of displacement vector
[in]nidsLength of Ids and Var arrays
[out]ierrError flag
Here is the call graph for this function:

◆ slv_restart()

subroutine slv_restart ( real(dp), dimension(*), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(in)  writeToRDB,
integer, intent(out)  ierr 
)

Restarts a running solver process from the provided state.

Parameters
[in]dataArray of state variables
[in]ndatLength of the data array
[in]writetordbFlag for controlling frs-file output
[out]ierrError flag
Here is the call graph for this function:

◆ slv_rhsvec()

subroutine slv_rhsvec ( real(dp), dimension(*), intent(inout)  Rvec,
integer, intent(in)  iopV,
integer, intent(out)  ierr 
)

Sets, updates or retrieves a system right-hand-side vector.

Parameters
[in,out]rvecThe right-hand-side vector
[in]iopvOperation flag telling what to do
[out]ierrError Flag
Here is the call graph for this function:

◆ slv_savepart()

subroutine slv_savepart ( integer, intent(in)  iopS,
integer, intent(in)  bid,
real(dp), dimension(*), intent(out)  data,
integer, intent(in)  ndat,
integer, intent(out)  ierr 
)

Saves current deformation state for an FE part to an array in core.

Parameters
[in]iopsOperation code telling what to save
[in]bidBase ID of the FE part to save for
[out]dataArray receiving the state variables
[in]ndatLength of the state array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_savestate()

subroutine slv_savestate ( logical, intent(in)  posOnly,
real(dp), dimension(*), intent(out)  data,
integer, intent(in)  ndat,
integer, intent(out)  ierr 
)

Saves the current state to an array in core.

Parameters
[in]posonlyIf .true., consider position matrices only
[out]dataArray receiving the state variables
[in]ndatLength of the state array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_settime()

subroutine slv_settime ( real(dp), intent(in)  nextTime,
integer, intent(out)  ierr 
)

Sets the time increment size of the next time step.

Parameters
[in]nexttimeTime to calculate next time increment from
[out]ierrError flag
Here is the call graph for this function:

◆ slv_statesize()

integer function slv_statesize ( logical, intent(in)  posOnly)

Returns the size of the total state array.

Parameters
[in]posonlyIf .true., consider position matrices only
Here is the call graph for this function:

◆ slv_straindisp()

subroutine slv_straindisp ( real(dp), dimension(*), intent(in)  disp,
integer, dimension(*), intent(in)  gageIds,
real(dp), dimension(*), intent(out)  eps,
integer, intent(in)  ndof,
integer, intent(in)  ng,
integer, intent(out)  ierr 
)

Calculates the strains at strain gages for a given displacement field.

Parameters
[in]dispDisplacement vector
[in]gageidsBase IDs of strain gages
[out]epsStrain tensor values at gage positions
[in]ndofLength of displacement vector
[in]ngLength of gageIds array
[out]ierrError flag
Here is the call graph for this function:

◆ slv_syssize()

integer function slv_syssize ( logical, intent(in)  expanded)

Returns the dimension of the system matrices and vectors.

Parameters
[in]expandedIf .true, return total number of DOFs
Here is the call graph for this function: