FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with model containers and top lever driver subroutines. More...
Functions/Subroutines | |
subroutine, public | initialize (chfsi, stateData, ndat, xinp, nxinp, ierr) |
Initializes the simulation model. More... | |
subroutine, public | softrestart (stateData, ndat, writeToRDB, ierr) |
Restarts a running simulation model from the provided state. More... | |
subroutine, public | solvestep (iop, finalStep, finished, ierr) |
Solves for the next time step or iteration. More... | |
subroutine, public | solverampup (iop, finished, ierr) |
Solves the ramp-up stage, if any. More... | |
subroutine, public | solvemodes (nModes, eVal, eVec, dofOrder, useLaPack, ierr) |
Solves the eigenvalue system at current configuration. More... | |
subroutine, public | finalize (ierr) |
Terminates the simulation and close the result database. More... | |
subroutine, public | closeall (ierr, abortsub) |
Closes the result database files and any external modules used. More... | |
subroutine | writeclosure (lcon, ierr) |
Outputs file and profiling information on program termination. More... | |
subroutine | deallocateall () |
Deallocates all dynamically allocated data. More... | |
logical function, public | solvedynamic () |
Returns whether the next step should be solved dynamically or not. More... | |
subroutine, public | gettime (time, nextStep, ierr) |
Returns the simulation time of the current or next time step. More... | |
subroutine, public | setnewtime (nextTime, ierr) |
Sets the time increment size to be used for next time step. More... | |
subroutine, public | getengine (value, ierr, userId, tag, x) |
Returns the current value of the specified engine. More... | |
integer function, public | getengineid (tag) |
Returns the user Id of the (first) engine with the specified tag. More... | |
subroutine, public | getsystemmatrix (Nmat, iopM, ierr) |
Returns a system matrix as a full matrix. More... | |
subroutine, public | getelementmatrix (Emat, baseId, iopM, ierr) |
Returns an element matrix for the specified superelement. More... | |
subroutine, public | getrhsvector (Rvec, iopV, ierr) |
Returns the current right-hand-side vector of the linearized system. More... | |
subroutine, public | setrhsvector (Rvec, addTo, keepDuringIterations, ierr) |
Sets/Updates current right-hand-side vector of linearized system. More... | |
subroutine, public | systemsize (ndim, expanded) |
Returns the dimension of the linearized system. More... | |
subroutine, public | solverparameters (dt, alpha, beta, gamma) |
Returns parameters for the Newmark/HHT-algorithm. More... | |
subroutine, public | objectequations (baseId, meqn, ndof) |
Returns the equation numbers for the specified object. More... | |
subroutine, public | objectstatevar (baseId, vars, nVar) |
Returns the current state variables for the specified object. More... | |
subroutine, public | solvelineqsystem (rhs, nrhs, ierr) |
Solves current linear equation system for a set of right-hand-sides. More... | |
subroutine, public | statevectorsize (transOnly, ndat) |
Returns the dimension of the state vector. More... | |
subroutine, public | savestate (transOnly, stateData, ndat, ierr) |
Saves current state to an in-core array. More... | |
subroutine, public | partstatevectorsize (iopS, bid, ndat) |
Returns the state vector dimension for a FE part. More... | |
subroutine, public | savepartstate (iopS, bid, data, ndat, ierr) |
Saves the deformation/stress state of a FE part to an in-core array. More... | |
subroutine, public | straingagessize (ndat) |
Returns the dimension of the strain gages vector. More... | |
subroutine, public | saveinitgagestrains (iopS, data, ndat, ierr) |
Save/restores the initial gage strain to/from an in-core array. More... | |
subroutine, public | computegagestrains (disp, gageIds, nDisp, nGage, eps, ierr) |
Computes strain tensor at gage positions for input displacements. More... | |
subroutine, public | computebeamforces (disp, beamIds, nDofs, nBeams, forces, ierr) |
Computes beam sectional forces for input displacements. More... | |
subroutine, public | computerelativedistance (disp, Ids, relDis, nDofs, nIds, ierr) |
Computes relative distance between 2 triads for input displacements. More... | |
subroutine, public | computeresponsevars (disp, Ids, resp, nDofs, nIds, ierr) |
Computes response variables for input displacements. More... | |
subroutine, public | getjointspringstiffness (sprCoeff, bid, ierr) |
Gets joint spring stiffness coefficients. More... | |
Variables | |
type(samtype), save, public | sam |
Data for managing system matrix assembly. More... | |
type(modestype), save | modes |
Data for eigenmodes. More... | |
type(systemtype), save, public | sys |
System level model data. More... | |
type(controltype), save | ctrl |
Control system data. More... | |
type(mechanismtype), save, public | mech |
Mechanism objects of the model. More... | |
type(sysmatrixtype), save | amat |
System matrix for external communication. More... | |
real(dp), dimension(:), allocatable, save | extrhs |
Externally set load vector. More... | |
character(len=lfnam_p), save | chmodel |
Model file name. More... | |
character(len=lfnam_p), dimension(5), save | chnames |
Result database file names. More... | |
character(len=lfnam_p), save | yamlfile |
Mode shape file name. More... | |
character(len=:), allocatable, save | frsnames |
Recovery result files. More... | |
Module with model containers and top lever driver subroutines.
This module contains all model data and the top-level subroutines of the FEDEM Dynamics solver. It replaces the old top-level driver subroutine of version R7.2 and earlier. The new driver is divided into three main parts:
In addition, this module contains several utility subroutines for external manipulation of the solution process through the solver API.
subroutine, public solvermodule::closeall | ( | integer, intent(inout) | ierr, |
character(len=*), intent(in), optional | abortsub | ||
) |
Closes the result database files and any external modules used.
ierr | Error flag | |
[in] | abortsub | If present, gives the name of the aborting subroutine |
subroutine, public solvermodule::computebeamforces | ( | real(dp), dimension(*), intent(in) | disp, |
integer, dimension(*), intent(in) | beamIds, | ||
integer, intent(in) | nDofs, | ||
integer, intent(in) | nBeams, | ||
real(dp), dimension(*), intent(out) | forces, | ||
integer, intent(out) | ierr | ||
) |
Computes beam sectional forces for input displacements.
[in] | disp | Displacement vector |
[in] | beamIds | Base IDs of the beams/triads to calculate for |
[in] | nDofs | Length of displacement vector |
[in] | nBeams | Length of beam identifier array |
[out] | forces | Beam sectional forces |
[out] | ierr | Error flag |
The array beamIds contains triplets of (beamId, triadId, dof), where triadId is the base ID of one of the two end triads of the beam element, and dof is a zero-based force component index (-1 implies all). This subroutine always returns all force components, i.e., the dof index is not used here.
subroutine, public solvermodule::computegagestrains | ( | real(dp), dimension(*), intent(in) | disp, |
integer, dimension(*), intent(in) | gageIds, | ||
integer, intent(in) | nDisp, | ||
integer, intent(in) | nGage, | ||
real(dp), dimension(*), intent(out) | eps, | ||
integer, intent(out) | ierr | ||
) |
Computes strain tensor at gage positions for input displacements.
[in] | disp | Displacement vector |
[in] | gageIds | Base IDs of strain gages to calculate for |
[in] | nDisp | Length of displacement vector (if 0, use internal state) |
[in] | nGage | Length of gageIds array (number of strain gages) |
[out] | eps | Strain tensors at gage positions |
[out] | ierr | Error flag |
subroutine, public solvermodule::computerelativedistance | ( | real(dp), dimension(*), intent(in) | disp, |
integer, dimension(*), intent(in) | Ids, | ||
real(dp), dimension(*), intent(out) | relDis, | ||
integer, intent(in) | nDofs, | ||
integer, intent(in) | nIds, | ||
integer, intent(out) | ierr | ||
) |
Computes relative distance between 2 triads for input displacements.
[in] | disp | Displacement vector |
[in] | Ids | User IDs of the functions with relative sensors |
[out] | relDis | Relative distances |
[in] | nDofs | Length of displacement vector |
[in] | nIds | Length of function identifier array |
[out] | ierr | Error flag |
subroutine, public solvermodule::computeresponsevars | ( | real(dp), dimension(*), intent(in) | disp, |
integer, dimension(*), intent(in) | Ids, | ||
real(dp), dimension(*), intent(out) | resp, | ||
integer, intent(in) | nDofs, | ||
integer, intent(in) | nIds, | ||
integer, intent(out) | ierr | ||
) |
Computes response variables for input displacements.
[in] | disp | Displacement vector |
[in] | Ids | User IDs of the functions with response quantities |
[out] | resp | Response variable values |
[in] | nDofs | Length of displacement vector |
[in] | nIds | Length of function identifier array |
[out] | ierr | Error flag |
|
private |
Deallocates all dynamically allocated data.
subroutine, public solvermodule::finalize | ( | integer, intent(out) | ierr | ) |
Terminates the simulation and close the result database.
[out] | ierr | Error flag |
This subroutine is invoked after the time integration has completed successfully, and there are no more calculations to be performed. Its main task is to close down the result database, but it also performs the automatic curve export when that has been requested.
subroutine, public solvermodule::getelementmatrix | ( | real(dp), dimension(*), intent(out) | Emat, |
integer, intent(in) | baseId, | ||
integer, intent(in) | iopM, | ||
integer, intent(out) | ierr | ||
) |
Returns an element matrix for the specified superelement.
[out] | Emat | The element matrix |
[in] | baseId | Base ID of the superelement to return the matrix for |
[in] | iopM | Option telling which matrix to return (see below) |
[out] | ierr | Error flag |
The value of iopM is iterpreted as follows:
subroutine, public solvermodule::getengine | ( | real(dp), intent(out) | value, |
integer, intent(inout) | ierr, | ||
integer, intent(in) | userId, | ||
character(len=*), intent(in), optional | tag, | ||
real(dp), intent(in), optional | x | ||
) |
Returns the current value of the specified engine.
[out] | value | The function value |
ierr | Error flag | |
[in] | userId | User ID of the engine to evaluate |
[in] | x | Optional function argument value |
[in] | tag | Optional tag to identify the engine with |
If an engine with userId is found, the value of that engine is returned. Otherwise, the (first) engine with a matching tag is used. If no engine with the given identification is found, zero is returned. The error flag is decrementend on failure, othwerwise it is not touched.
integer function, public solvermodule::getengineid | ( | character(len=*), intent(in) | tag | ) |
Returns the user Id of the (first) engine with the specified tag.
[in] | tag | Tag to identify the engine with |
subroutine, public solvermodule::getjointspringstiffness | ( | real(dp), dimension(*), intent(out) | sprCoeff, |
integer, intent(in) | bid, | ||
integer, intent(out) | ierr | ||
) |
Gets joint spring stiffness coefficients.
[out] | sprCoeff | Spring stiffness coefficient |
[in] | bid | Base ID for spring |
[out] | ierr | Error flag |
subroutine, public solvermodule::getrhsvector | ( | real(dp), dimension(sam%neq), intent(out) | Rvec, |
integer, intent(in) | iopV, | ||
integer, intent(out) | ierr | ||
) |
Returns the current right-hand-side vector of the linearized system.
[out] | Rvec | The right-hand-side vector |
[in] | iopV | If equal to 1, return current external load vector instead |
[out] | ierr | Error flag |
subroutine, public solvermodule::getsystemmatrix | ( | real(dp), dimension(sam%neq,sam%neq), intent(out) | Nmat, |
integer, intent(in) | iopM, | ||
integer, intent(out) | ierr | ||
) |
Returns a system matrix as a full matrix.
[out] | Nmat | The system matrix |
[in] | iopM | Option telling which matrix to return (see below) |
[out] | ierr | Error flag |
The value of iopM is iterpreted as follows:
subroutine, public solvermodule::gettime | ( | real(dp), intent(out) | time, |
logical, intent(in) | nextStep, | ||
integer, intent(inout) | ierr | ||
) |
Returns the simulation time of the current or next time step.
[out] | time | The simulation time returned |
[in] | nextStep | If .true., return for next step, otherwise current step |
ierr | Error flag |
This subroutine does not always work with nextStep = .true. if cut-back is performed, as the time step size then might be decreased.
subroutine, public solvermodule::initialize | ( | character(len=*), intent(in), optional | chfsi, |
real(dp), dimension(*), intent(in), optional | stateData, | ||
integer, intent(in), optional | ndat, | ||
real(dp), dimension(*), intent(in), optional | xinp, | ||
integer, intent(inout), optional | nxinp, | ||
integer, intent(out) | ierr | ||
) |
Initializes the simulation model.
[in] | chfsi | Text string containing the model definition |
[in] | stateData | Current state to restart from |
[in] | ndat | Length of the stateData array |
[in] | xinp | External function values for initial state |
nxinp | Number of external function values to extract/extracted | |
[out] | ierr | Error flag |
This subroutine reads and sets up a new simulation model, defines the initial configuration and initializes the result database. It also handles restart, both from file and from a solution state provided as argument.
subroutine, public solvermodule::objectequations | ( | integer, intent(in) | baseId, |
integer, dimension(*), intent(out) | meqn, | ||
integer, intent(out) | ndof | ||
) |
Returns the equation numbers for the specified object.
[in] | baseId | Base ID of the object to get equation numbers for |
[out] | meqn | Array of equation numbers |
[out] | ndof | Number of degrees of freedom for the object in question |
subroutine, public solvermodule::objectstatevar | ( | integer, intent(in) | baseId, |
real(dp), dimension(*), intent(out) | vars, | ||
integer, intent(out) | nVar | ||
) |
Returns the current state variables for the specified object.
[in] | baseId | Base ID of the object to get equation numbers for |
[out] | vars | Array of state variables (positions only for Triads) |
[out] | nVar | Number of state variables |
subroutine, public solvermodule::partstatevectorsize | ( | integer, intent(in) | iopS, |
integer, intent(in) | bid, | ||
integer, intent(out) | ndat | ||
) |
Returns the state vector dimension for a FE part.
[in] | iopS | Option telling for which state, 1: deformation, 2: stresses |
[in] | bid | Base ID if the FE part to consider |
[in] | ndat | Required length of the state array |
The deformation state size equals 4 + 3*(number of nodes) whereas the stress state size euals 4 + number of nodes. In both cases the first 4 entries are the step number, time, step size and baseID, respectiviely.
subroutine, public solvermodule::saveinitgagestrains | ( | integer, intent(in) | iopS, |
real(dp), dimension(*), intent(inout) | data, | ||
integer, intent(in) | ndat, | ||
integer, intent(out) | ierr | ||
) |
Save/restores the initial gage strain to/from an in-core array.
[in] | iopS | If equal to 1 save to data array, otherwise restore from it |
data | Array with strain gage values | |
[in] | ndat | Length of the data array |
[out] | ierr | Error flag |
subroutine, public solvermodule::savepartstate | ( | integer, intent(in) | iopS, |
integer, intent(in) | bid, | ||
real(dp), dimension(*), intent(out) | data, | ||
integer, intent(in) | ndat, | ||
integer, intent(out) | ierr | ||
) |
Saves the deformation/stress state of a FE part to an in-core array.
[in] | iopS | Option telling what to save, 1: deformation, 2: stress |
[in] | bid | Base ID if the FE part to consider |
[out] | data | Deformation/stress state array |
[in] | ndat | Length of the data array |
[out] | ierr | Error flag |
If iopS equals 1, the von Mises stress value at each node of the part is saved, otherwise the 3 deformational displacement components at each node are saved. As the first four values, the current step number, the current time, the time step size, and the base ID of the FE part, respectively, are saved.
subroutine, public solvermodule::savestate | ( | logical, intent(in) | transOnly, |
real(dp), dimension(*), intent(out) | stateData, | ||
integer, intent(in) | ndat, | ||
integer, intent(out) | ierr | ||
) |
Saves current state to an in-core array.
[in] | transOnly | If .true., consider position matrices only |
[out] | stateData | Array containing all solution dependent variables |
[in] | ndat | Length of the stateData array |
[out] | ierr | Error flag |
subroutine, public solvermodule::setnewtime | ( | real(dp), intent(in) | nextTime, |
integer, intent(out) | ierr | ||
) |
Sets the time increment size to be used for next time step.
[in] | nextTime | Physical time to calculate time increment size from |
[out] | ierr | Error flag |
subroutine, public solvermodule::setrhsvector | ( | real(dp), dimension(sam%neq), intent(in) | Rvec, |
logical, intent(in) | addTo, | ||
logical, intent(in) | keepDuringIterations, | ||
integer, intent(out) | ierr | ||
) |
Sets/Updates current right-hand-side vector of linearized system.
Rvec | The right-hand-side vector | |
[in] | addTo | If .true., the provided vector is added to the current right-hand-side vector in the model, otherwise it replaces the current one |
[in] | keepDuringIterations | If .true., the provided vector should be applied in all iterations of current time step |
[out] | ierr | Error flag |
subroutine, public solvermodule::softrestart | ( | real(dp), dimension(*), intent(in) | stateData, |
integer, intent(in) | ndat, | ||
integer, intent(in) | writeToRDB, | ||
integer, intent(out) | ierr | ||
) |
Restarts a running simulation model from the provided state.
[in] | stateData | Current state to restart from |
[in] | ndat | Length of the stateData array |
[in] | writeToRDB | Control variable for frs-file output |
[out] | ierr | Error flag |
The value of the argument writeToRDB is interpreted as follows:
logical function, public solvermodule::solvedynamic |
Returns whether the next step should be solved dynamically or not.
subroutine, public solvermodule::solvelineqsystem | ( | real(dp), dimension(:), intent(inout) | rhs, |
integer, intent(in) | nrhs, | ||
integer, intent(out) | ierr | ||
) |
Solves current linear equation system for a set of right-hand-sides.
rhs | The right-hand-side vectors of the linear equation system | |
[in] | nrhs | Number of right-hand-side vectors |
[out] | ierr | Error flag |
Assuming the Newton matrix already have been factorized. To be used by the inverse problem algorithm.
subroutine, public solvermodule::solvemodes | ( | integer, intent(in) | nModes, |
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] | nModes | Number of eigenmodes to solve for |
[out] | eVal | Computed eigenvalues (frequencies in [Hz]) |
[out] | eVec | Mass-normalized eigenvectors |
[in] | dofOrder | If .true., expand eigenvectors to DOF-order |
[in] | useLaPack | Flag for using LAPack eigenvalue solvers |
[out] | ierr | Error flag |
subroutine, public solvermodule::solverampup | ( | integer, intent(inout) | iop, |
logical, intent(out) | finished, | ||
integer, intent(out) | ierr | ||
) |
Solves the ramp-up stage, if any.
iop | Operation flag telling what to do, should be zero | |
[out] | finished | If .true., the time integration failed |
[out] | ierr | Error flag |
subroutine, public solvermodule::solverparameters | ( | real(dp), intent(out) | dt, |
real(dp), intent(out) | alpha, | ||
real(dp), intent(out) | beta, | ||
real(dp), intent(out) | gamma | ||
) |
Returns parameters for the Newmark/HHT-algorithm.
[out] | dt | Time step size |
[out] | alpha | Numerical damping parameter of the HHT-scheme |
[out] | beta | Newmark time integration parameter |
[out] | gamma | Newmark time integration parameter |
subroutine, public solvermodule::solvestep | ( | integer, intent(inout) | iop, |
logical, intent(in) | finalStep, | ||
logical, intent(out) | finished, | ||
integer, intent(out) | ierr | ||
) |
Solves for the next time step or iteration.
iop | Control variable defining what to do (see below) | |
[in] | finalStep | If .true., this is the final step of current time window |
[out] | finished | If .true., the end of the simulation has been reached, or the time integration failed |
[out] | ierr | Error flag |
This subroutine performs different sub-tasks of the solution process, depending on the value of the control variable iop, as follows:
subroutine, public solvermodule::statevectorsize | ( | logical, intent(in) | transOnly, |
integer, intent(out) | ndat | ||
) |
Returns the dimension of the state vector.
[in] | transOnly | If .true., consider position matrices only |
[out] | ndat | Required length of the state array |
subroutine, public solvermodule::straingagessize | ( | integer, intent(out) | ndat | ) |
Returns the dimension of the strain gages vector.
[out] | ndat | Required length of the strain gage state array |
subroutine, public solvermodule::systemsize | ( | integer, intent(out) | ndim, |
logical, intent(in), optional | expanded | ||
) |
Returns the dimension of the linearized system.
[out] | ndim | Number of unknowns in the linear equation system |
[in] | expanded | If .true., return total number of DOFs in the system |
subroutine solvermodule::writeclosure | ( | integer, intent(in) | lcon, |
integer, intent(inout) | ierr | ||
) |
Outputs file and profiling information on program termination.
[in] | lcon | File unit number for console messages |
ierr | Error flag |
|
private |
System matrix for external communication.
|
private |
Model file name.
|
private |
Result database file names.
|
private |
Control system data.
|
private |
Externally set load vector.
Assumed constant during Newton iterations.
|
private |
Recovery result files.
type(mechanismtype), save, public solvermodule::mech |
Mechanism objects of the model.
|
private |
Data for eigenmodes.
type(samtype), save, public solvermodule::sam |
Data for managing system matrix assembly.
type(systemtype), save, public solvermodule::sys |
System level model data.
|
private |
Mode shape file name.