FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines
restartmodule Module Reference

Module with subroutines for simulation restart. More...

Data Types

interface  restartinit
 Initializes the mechanism configuration for restart. More...
 

Functions/Subroutines

subroutine restartfromfile (sam, sys, mech, ctrl, lpu, ierr)
 Initializes the mechanism configuration from restart file. More...
 
subroutine readtriaddata (triads, previousStep, ierr)
 Reads triad results from results database for restart. More...
 
subroutine readsupdata (sups, previousStep, ierr)
 Reads superelement results from results database for restart. More...
 
subroutine readjointdata (joints, previousStep, ierr)
 Reads joint results from results database for restart. More...
 
subroutine readjointdofdata (jointType, jointId, jointDof, previousStep, ierr)
 Reads joint DOF data for current time step. More...
 
subroutine readcontactelementdata (cElems, ierr)
 Reads contact element results from results database for restart. More...
 
subroutine readcontroldata (ctrl, mechId, ierr)
 Reads control system data from results database for restart. More...
 
integer function, public getstatesize (sam, mech, ctrl)
 Calculates the length of the state array to restart from. More...
 
integer function, public gettransformationstatesize (mech)
 Calculates the length of the transformation state array. More...
 
subroutine restartfromcore (sam, sys, mech, ctrl, data, ndat, lpu, istat)
 Initializes the mechanism configuration from provided state array. More...
 
subroutine extracttriaddata (triads, data, ndat, idat)
 Extracts triad results from in-core array for restart. More...
 
subroutine extractsuperelementdata (sups, data, ndat, idat)
 Extracts superelement results from in-core array for restart. More...
 
subroutine extractjointdata (joints, data, ndat, idat)
 Extracts joint results from in-core state array for restart. More...
 
subroutine extractdamperdata (dampers, data, ndat, idat)
 Extracts damper results from state array for restart. More...
 
subroutine extractcontactelementdata (cElems, data, ndat, idat)
 Extracts contact element results from state array for restart. More...
 
subroutine extractmotiondata (motions, data, ndat, idat)
 Extracts prescribed motion results from state array for restart. More...
 
subroutine extractcontroldata (ctrl, data, ndat, idat)
 Extracts control system data from state array for restart. More...
 
subroutine restartinitialize (sam, sys, mech, ctrl, fromCore, ierr)
 Initializes the mechanism configuration for restart. More...
 
subroutine, public savetocore (sam, sys, mech, ctrl, data, ndat, istat)
 Saves state-dependent data of current time step to an array in core. More...
 
subroutine, public savetransformationdatatocore (sys, mech, data, ndat, istat)
 Saves the transformation data of current step to an array in core. More...
 
subroutine savetriaddata (triads, data, ndat, idat)
 Saves triad results to in-core array for restart. More...
 
subroutine savesuperelementdata (sups, data, ndat, idat)
 Saves superelement results to in-core array for restart. More...
 
subroutine savejointdata (joints, data, ndat, idat)
 Saves joint results to in-core state array for restart. More...
 
subroutine savedamperdata (dampers, data, ndat, idat)
 Saves damper results to in-core state array for restart. More...
 
subroutine savecontactelementdata (cElems, data, ndat, idat)
 Saves contact element results to in-core state array for restart. More...
 
subroutine savemotiondata (motions, data, ndat, idat)
 Saves prescribed motion results to in-core state array for restart. More...
 
subroutine savecontroldata (ctrl, data, ndat, idat)
 Saves control system data to in-core state array for restart. More...
 
logical function outofrange (oper, object, id, idat, ndat)
 Prints an error message when the in-core state array is exhausted. More...
 

Detailed Description

Module with subroutines for simulation restart.

This module contains the subroutines that handles restart of a dynamics simulation. The state that is restarted from can either be read from a set of frs-files generated by a previous simulation of the same model, or provided through an in-core state array. The latter is typically used when the solver is executed via the solver API by some external script.

Function/Subroutine Documentation

◆ extractcontactelementdata()

subroutine restartmodule::extractcontactelementdata ( type(contactelementtype), dimension(:), intent(inout)  cElems,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts contact element results from state array for restart.

Parameters
cElemsAll contact elements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ extractcontroldata()

subroutine restartmodule::extractcontroldata ( type(controltype), intent(inout)  ctrl,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts control system data from state array for restart.

Parameters
ctrlControl system data
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
22 Dec 2020
Here is the caller graph for this function:

◆ extractdamperdata()

subroutine restartmodule::extractdamperdata ( type(dampertype), dimension(:), intent(inout)  dampers,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts damper results from state array for restart.

Parameters
dampersAll damper elements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read

Only the damper velocity is extracted, and only if the damper uses deformational velocity. Because it is computed using the previous spring deflection which is not known at restart point.

Author
Knut Morten Okstad
Date
1 Jul 2022
Here is the caller graph for this function:

◆ extractjointdata()

subroutine restartmodule::extractjointdata ( type(masterslavejointtype), dimension(:), intent(inout)  joints,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts joint results from in-core state array for restart.

Parameters
jointsAll joints in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read

The internal position matrices are then updated.

Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ extractmotiondata()

subroutine restartmodule::extractmotiondata ( type(motiontype), dimension(:), intent(inout)  motions,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts prescribed motion results from state array for restart.

Parameters
[in]motionsAll prescribed motions in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ extractsuperelementdata()

subroutine restartmodule::extractsuperelementdata ( type(supeltype), dimension(:), intent(inout)  sups,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts superelement results from in-core array for restart.

Parameters
supsAll superelements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ extracttriaddata()

subroutine restartmodule::extracttriaddata ( type(triadtype), dimension(:), intent(inout)  triads,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Extracts triad results from in-core array for restart.

Parameters
triadsAll triads in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ getstatesize()

integer function, public restartmodule::getstatesize ( type(samtype), intent(in)  sam,
type(mechanismtype), intent(in)  mech,
type(controltype), intent(in)  ctrl 
)

Calculates the length of the state array to restart from.

Parameters
[in]samData for managing system matrix assembly
[in]mechMechanism components of the model
[in]ctrlControl system data
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ gettransformationstatesize()

integer function, public restartmodule::gettransformationstatesize ( type(mechanismtype), intent(in)  mech)

Calculates the length of the transformation state array.

Parameters
[in]mechMechanism components of the model
Author
Runar Heggelien Refsnaes
Date
28 Jun 2017
Here is the caller graph for this function:

◆ outofrange()

logical function restartmodule::outofrange ( character(len=*), intent(in)  oper,
character(len=*), intent(in)  object,
type(idtype), intent(in)  id,
integer, intent(inout)  idat,
integer, intent(in)  ndat 
)
private

Prints an error message when the in-core state array is exhausted.

Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ readcontactelementdata()

subroutine restartmodule::readcontactelementdata ( type(contactelementtype), dimension(:), intent(inout)  cElems,
integer, intent(out)  ierr 
)

Reads contact element results from results database for restart.

Parameters
cElemsAll contact elements of the model
[out]ierrError flag
Author
Knut Morten Okstad
Date
14 Nov 2005
Here is the caller graph for this function:

◆ readcontroldata()

subroutine restartmodule::readcontroldata ( type(controltype), intent(inout)  ctrl,
integer, intent(in)  mechId,
integer, intent(out)  ierr 
)

Reads control system data from results database for restart.

Parameters
ctrlControl system data
[in]mechIdBase ID of the mechanism object of the model
[out]ierrError flag
Author
Knut Morten Okstad
Date
25 Nov 2008
Here is the caller graph for this function:

◆ readjointdata()

subroutine restartmodule::readjointdata ( type(masterslavejointtype), dimension(:), intent(inout)  joints,
logical, intent(in)  previousStep,
integer, intent(out)  ierr 
)

Reads joint results from results database for restart.

Parameters
jointsAll joints of the model
[in]previousStepIf .true., read into the previous configuration
[out]ierrError flag

The internal position matrices are then updated.

Author
Knut Morten Okstad
Date
1 Nov 2005
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readjointdofdata()

subroutine restartmodule::readjointdofdata ( character(len=*), intent(in)  jointType,
type(idtype), intent(in)  jointId,
type(jointdoftype), intent(inout)  jointDof,
logical, intent(in)  previousStep,
integer, intent(out)  ierr 
)

Reads joint DOF data for current time step.

Parameters
[in]jointTypeType string of the joint in question
[in]jointIdID of the joint in question
jointDofThe joint DOF to read response data for
[in]previousStepIf .true., read into the previous configuration
[out]ierrError flag
Author
Knut Morten Okstad
Date
1 Nov 2005
Here is the caller graph for this function:

◆ readsupdata()

subroutine restartmodule::readsupdata ( type(supeltype), dimension(:), intent(inout)  sups,
logical, intent(in)  previousStep,
integer, intent(out)  ierr 
)

Reads superelement results from results database for restart.

Parameters
supsAll superelements of the model
[in]previousStepIf .true., read into the previous configuration
[out]ierrError flag
Author
Knut Morten Okstad
Date
1 Nov 2005
Here is the caller graph for this function:

◆ readtriaddata()

subroutine restartmodule::readtriaddata ( type(triadtype), dimension(:), intent(inout)  triads,
logical, intent(in)  previousStep,
integer, intent(out)  ierr 
)

Reads triad results from results database for restart.

Parameters
triadsAll triads of the model
[in]previousStepIf .true., read into the previous configuration
[out]ierrError flag
Author
Knut Morten Okstad
Date
1 Nov 2005
Here is the caller graph for this function:

◆ restartfromcore()

subroutine restartmodule::restartfromcore ( type(samtype), intent(in)  sam,
type(systemtype), intent(inout)  sys,
type(mechanismtype), intent(inout)  mech,
type(controltype), intent(inout)  ctrl,
real(dp), dimension(ndat), intent(in)  data,
integer, intent(in)  ndat,
integer, intent(in)  lpu,
integer, intent(out)  istat 
)

Initializes the mechanism configuration from provided state array.

Parameters
[in]samData for managing system matrix assembly
sysSystem level model data
mechMechanism components of the model
ctrlControl system data
[in]ndatLength of the solution state array
[in]dataSolution state array
[in]lpuFile unit number for res-file output
[out]istatStatus flag, <0: Error, ≥0: Number of values read
Author
Knut Morten Okstad
Date
13 Jan 2017

◆ restartfromfile()

subroutine restartmodule::restartfromfile ( type(samtype), intent(in)  sam,
type(systemtype), intent(inout)  sys,
type(mechanismtype), intent(inout)  mech,
type(controltype), intent(inout)  ctrl,
integer, intent(in)  lpu,
integer, intent(out)  ierr 
)
private

Initializes the mechanism configuration from restart file.

Parameters
[in]samData for managing system matrix assembly
sysSystem level model data
mechMechanism components of the model
ctrlControl system data
[in]lpuFile unit number for res-file output
[out]ierrError flag
Note
Proper initialization of tire models is not implemented yet.
Author
Knut Morten Okstad
Date
1 Nov 2005

◆ restartinitialize()

subroutine restartmodule::restartinitialize ( type(samtype), intent(in)  sam,
type(systemtype), intent(inout)  sys,
type(mechanismtype), intent(inout)  mech,
type(controltype), intent(in)  ctrl,
logical, intent(in)  fromCore,
integer, intent(out)  ierr 
)
private

Initializes the mechanism configuration for restart.

Parameters
[in]samData for managing system matrix assembly
sysSystem level model data
mechMechanism components of the model
[in]ctrlControl system data
[in]fromCoreIf .true., invoked from restartmodule::restartfromcore
[out]ierrError flag
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savecontactelementdata()

subroutine restartmodule::savecontactelementdata ( type(contactelementtype), dimension(:), intent(in)  cElems,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves contact element results to in-core state array for restart.

Parameters
[in]cElemsAll contact elements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
16 Jan 2017
Here is the caller graph for this function:

◆ savecontroldata()

subroutine restartmodule::savecontroldata ( type(controltype), intent(in)  ctrl,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves control system data to in-core state array for restart.

Parameters
[in]ctrlControl system data
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
22 Dec 2020
Here is the caller graph for this function:

◆ savedamperdata()

subroutine restartmodule::savedamperdata ( type(dampertype), dimension(:), intent(in)  dampers,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves damper results to in-core state array for restart.

Parameters
[in]dampersAll damper elements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error

Only the damper velocity needs to be stored, if the damper uses deformational velocity. Because it is computed using the previous spring deflection which is not known at restart point.

Author
Knut Morten Okstad
Date
1 Jul 2022
Here is the caller graph for this function:

◆ savejointdata()

subroutine restartmodule::savejointdata ( type(masterslavejointtype), dimension(:), intent(in)  joints,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves joint results to in-core state array for restart.

Parameters
[in]jointsAll joints in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
16 Jan 2017
Here is the caller graph for this function:

◆ savemotiondata()

subroutine restartmodule::savemotiondata ( type(motiontype), dimension(:), intent(in)  motions,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves prescribed motion results to in-core state array for restart.

Parameters
[in]motionsAll prescribed motions in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
13 Jan 2017
Here is the caller graph for this function:

◆ savesuperelementdata()

subroutine restartmodule::savesuperelementdata ( type(supeltype), dimension(:), intent(in)  sups,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves superelement results to in-core array for restart.

Parameters
[in]supsAll superelements in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
16 Jan 2017
Here is the caller graph for this function:

◆ savetocore()

subroutine, public restartmodule::savetocore ( type(samtype), intent(in)  sam,
type(systemtype), intent(in)  sys,
type(mechanismtype), intent(in)  mech,
type(controltype), intent(in)  ctrl,
real(dp), dimension(ndat), intent(out)  data,
integer, intent(in)  ndat,
integer, intent(out)  istat 
)

Saves state-dependent data of current time step to an array in core.

Parameters
[in]samData for managing system matrix assembly
[in]sysSystem level model data
[in]mechMechanism components of the model
[in]ctrlControl system data
[in]ndatLength of the solution state array
[in]dataSolution state array
[out]istatStatus flag, <0: Error, =0: Ok, >0: The data array is this value longer than necessary

Currently does not tires, aerodynamics, etc.

Author
Knut Morten Okstad
Date
16 Jan 2017
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savetransformationdatatocore()

subroutine, public restartmodule::savetransformationdatatocore ( type(systemtype), intent(in)  sys,
type(mechanismtype), intent(in)  mech,
real(dp), dimension(ndat), intent(out)  data,
integer, intent(in)  ndat,
integer, intent(out)  istat 
)

Saves the transformation data of current step to an array in core.

Parameters
[in]sysSystem level model data
[in]mechMechanism components of the model
[in]ndatLength of the solution state array
[in]dataSolution state array
[out]istatStatus flag, <0: Error, =0: Ok, >0: The data array is this value longer than necessary

It also saves a TypeId and BaseId for triads and superelements. The TypeId is 1 for triads and 2 for superelements (FE-parts).

Author
Runar Heggelien Refsnaes
Date
28 Jun 2017
Here is the caller graph for this function:

◆ savetriaddata()

subroutine restartmodule::savetriaddata ( type(triadtype), dimension(:), intent(in)  triads,
real(dp), dimension(ndat), intent(inout)  data,
integer, intent(in)  ndat,
integer, intent(inout)  idat 
)

Saves triad results to in-core array for restart.

Parameters
[in]triadsAll triads in the model
[in]ndatLength of the solution state array
[in]dataSolution state array
idatRunning array index, negative value indicates an error
Author
Knut Morten Okstad
Date
16 Jan 2017
Here is the caller graph for this function: