FEDEM Solver
R8.0
Source code of the dynamics solver
|
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... | |
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.
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.
[in] | disp | Displacement vector |
[in] | beamids | Base IDs of beam elements |
[out] | forces | Sectional forces at beam ends |
[in] | ndof | Length of displacement vector |
[in] | nbeams | Number of beam elements |
[out] | ierr | Error flag |
subroutine slv_done | ( | integer, intent(out) | ierr | ) |
Terminates the running solver process by deallocating all memory, etc.
[out] | ierr | Error flag |
integer function slv_gagessize |
Returns the size of the strain gage state array.
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.
[out] | emat | The element matrix |
[in] | bid | Base ID of the element to consider |
[in] | iopm | Flag indicating which matrix to return |
[out] | ierr | Error Flag |
integer function slv_geteqn | ( | integer, intent(in) | bid, |
integer, dimension(*), intent(out) | meqn | ||
) |
Returns the equation numbers affected by a given mechanism object.
[in] | bid | Base ID of the mechanism object to consider |
[out] | meqn | List of equation numbers |
real(dp) function slv_getfunc | ( | integer, intent(in) | uid, |
real(dp), intent(in) | x, | ||
integer, intent(inout) | ierr | ||
) |
Evaluates the specified function.
[in] | uid | User ID of the function to evaluate |
[in] | x | The function argument value |
[in,out] | ierr | Error flag |
integer function slv_getfuncid | ( | character(len=*), intent(in) | tag | ) |
Returns the user ID of (first) function identified by the given tag.
[in] | tag | Tag identifying the function |
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.
[in] | uid | User ID of the function to evaluate |
[in] | tag | Tag identifying the function |
[in,out] | ierr | Error flag |
subroutine slv_getsmat | ( | real(dp), dimension(*), intent(out) | Nmat, |
integer, intent(in) | iopM, | ||
integer, intent(out) | ierr | ||
) |
Returns a system matrix in full format.
[out] | nmat | The system matrix |
[in] | iopm | Flag indicating which matrix to return |
[out] | ierr | Error flag |
real(dp) function slv_gettime | ( | logical, intent(in) | nextStep, |
integer, intent(inout) | ierr | ||
) |
Returns the time of current or next time increment.
[in] | nextstep | If .true, return the time of next step |
[in,out] | ierr | Error flag |
integer function slv_getvar | ( | integer, intent(in) | bid, |
real(dp), dimension(*), intent(out) | var | ||
) |
Returns the state variables for a given mechanism object.
[in] | bid | Base ID of the mechanism object to consider |
[out] | var | List of state variables |
subroutine slv_init0 | ( | integer, intent(out) | ierr | ) |
Initializes a new simulation process.
[out] | ierr | Error flag |
subroutine slv_inita | ( | real(dp), dimension(*), intent(in) | xinp, |
integer, intent(inout) | nxinp, | ||
integer, intent(out) | ierr | ||
) |
Initializes a new simulation process.
[in] | xinp | Initial external function values |
[in,out] | nxinp | Length of the xinp array |
[out] | ierr | Error flag |
subroutine slv_initb | ( | character(len=*), intent(in) | chfsi, |
integer, intent(out) | ierr | ||
) |
Initializes a new simulation process.
[in] | chfsi | Content of the solver input file |
[out] | ierr | Error flag |
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.
[in] | chfsi | Content of the solver input file |
[in] | data | Array of state variables |
[in] | ndat | Length of the data array |
[out] | ierr | Error flag |
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.
[in] | data | Array of state variables |
[in] | ndat | Length of the data array |
[out] | ierr | Error flag |
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.
[in] | iops | Operation code telling what to do |
[out] | data | Array receiving the state variables |
[in] | ndat | Length of the state array |
[out] | ierr | Error flag |
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.
[in] | x | Array with response data at certain DOFs |
[in] | xeqs | Array of equation numbers of the DOFs with x values |
[in] | feqs | Array of equation numbers of the DOFs for force calculation |
[in] | ndis | Length of array x and xeqs |
[in] | nfrc | Length of array feqs |
[out] | done | If .true., the simulation is finished or failed |
[out] | ierr | Error flag |
subroutine slv_jointspring | ( | real(dp), dimension(*), intent(out) | sprCoeff, |
integer, intent(in) | bid, | ||
integer, intent(out) | ierr | ||
) |
Gets joint spring stiffness coefficients.
[out] | sprcoeff | Joint spring stiffness coefficients |
[in] | bid | Base ID of the spring |
[out] | ierr | Error flag |
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.
[in] | nMode | Number of eigenmodes to compute |
[out] | eval | Computed eigenvalues |
[out] | evec | Computed eigenvectors |
[in] | dofOrder | If .true., return eigenvectors in DOF-order |
[in] | useLaPack | Flag usage of LAPACK dense matrix eigensolver |
[out] | ierr | Error flag |
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.
iop | Operation flag telling what to do, see solvermodule::solvestep | |
[in] | final | If .true., this is assumed to be the final time step |
[out] | done | If .true., the simulation is finished or failed |
[out] | ierr | Error flag |
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.
[in] | iops | Operation code telling which state to consider |
[in] | bid | Base ID of the FE part to consider |
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.
[in] | disp | Displacement vector |
[in] | ids | User IDs of functions to use |
[out] | reldis | Relative displacement change |
[in] | ndof | Length of displacement vector |
[in] | nids | Length of Ids and relDis arrays |
[out] | ierr | Error flag |
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.
[in] | disp | Displacement vector |
[in] | ids | User IDs of functions to use |
[out] | var | Response variable values |
[in] | ndof | Length of displacement vector |
[in] | nids | Length of Ids and Var arrays |
[out] | ierr | Error flag |
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.
[in] | data | Array of state variables |
[in] | ndat | Length of the data array |
[in] | writetordb | Flag for controlling frs-file output |
[out] | ierr | Error flag |
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.
[in,out] | rvec | The right-hand-side vector |
[in] | iopv | Operation flag telling what to do |
[out] | ierr | Error Flag |
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.
[in] | iops | Operation code telling what to save |
[in] | bid | Base ID of the FE part to save for |
[out] | data | Array receiving the state variables |
[in] | ndat | Length of the state array |
[out] | ierr | Error flag |
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.
[in] | posonly | If .true., consider position matrices only |
[out] | data | Array receiving the state variables |
[in] | ndat | Length of the state array |
[out] | ierr | Error flag |
subroutine slv_settime | ( | real(dp), intent(in) | nextTime, |
integer, intent(out) | ierr | ||
) |
Sets the time increment size of the next time step.
[in] | nexttime | Time to calculate next time increment from |
[out] | ierr | Error flag |
integer function slv_statesize | ( | logical, intent(in) | posOnly | ) |
Returns the size of the total state array.
[in] | posonly | If .true., consider position matrices only |
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.
[in] | disp | Displacement vector |
[in] | gageids | Base IDs of strain gages |
[out] | eps | Strain tensor values at gage positions |
[in] | ndof | Length of displacement vector |
[in] | ng | Length of gageIds array |
[out] | ierr | Error flag |
integer function slv_syssize | ( | logical, intent(in) | expanded | ) |
Returns the dimension of the system matrices and vectors.
[in] | expanded | If .true, return total number of DOFs |