The SAVE command stores the current Adams Solver (C++) model and simulation conditions or only the current simulation states. This allows you to return to the model or states at a later time using the
RELOAD command.
Format
SAVE/ { STATES, BUFFER = c }
{ SYSTEM, FILE = c }
Arguments
BUFFER | Specifies the internal memory buffer for state values. The buffer memory is allocated dynamically. The buffer exists only during the current Solver session and cannot be saved to disk.
Range: All printable characters except "!", ";", "," and "&" |
FILE=C | Specifies the complete file name where Adams Solver (C++) writes the SAVE command information. The file name may include the directory on operating systems that support such path names, such as Linux. There is no default extension for this file.
Range: All printable characters except “!”, “;”, “,” and “&” |
STATES | Specifies Adams Solver (C++) to save just the current simulation time and state values (displacements, velocities, force values, user-defined variable values and so on). The RELOAD/STATES command can later reload these states to restart the simulation from this point. |
SYSTEM | Specifies that Adams Solver (C++) saves the entire current system, including the model definition (parts, markers, joints, and so on), simulation time and state values (displacements, velocities, force values, user-defined variable values, and so on), and solver data (integrator parameters, state derivatives, and so on). SYSTEM creates a complete record of the current model and simulation conditions. The RELOAD/SYSTEM command can later reload this record to return to these model and simulation conditions. |
Extended Definition
You can use the SAVE command with the STATES argument to save the current simulation time and state values, including displacements, velocities, force values, and user-defined variable values. You can later restart a simulation from this point by reloading the states with the RELOAD/STATES command. When you reload this buffer, Adams Solver (C++) resets the simulation time to the saved value and uses the saved states as initial conditions for the next simulation.
You can use the SAVE command with the SYSTEM argument to save the entire current system, including the model definition (parts, markers, joints, and so on), simulation time, state values (displacements, velocities, force values, user-defined variable values, and so on), and solver data (integrator parameters, state derivatives, and so on). SAVE/SYSTEM creates a complete record of the current model and simulation conditions. You can later return to this point by reloading the conditions using the RELOAD/SYSTEM command.
When you reload a system file, Adams Solver (C++) completely resets all model, simulation, and solver data to that stored in the file. Except for interactive plotting, Adams Solver (C++) responds to subsequent commands just as it would have at the time the file was saved. (Because past simulation results are not stored in the save file, they cannot be plotted when the file is restored.)
Caution: | ■Files are saved in a machine- and code-dependent binary format. They are not portable across platforms or between versions of Adams Solver (C++). ■Save files generated by Adams Solver (FORTRAN) cannot be reloaded by Adams Solver (C++). Similarly, save files generated by Adams Solver (C++) cannot be reloaded by Adams Solver (FORTRAN). ■SAVE/STATES cannot be used with FILE and SAVE/SYSTEM cannot be used with BUFFER. ■Models containing nonlinear flexible bodies are not supported by the [SAVE/RELOAD] command. |
Examples
SAVE/SYSTEM,FILE=BASE1.SAV
This SAVE command saves the current model and simulation information in file BASE1SAV. When this file is reloaded with the RELOAD command, Adams Solver (C++) returns to this exact configuration.
Used with other interactive Adams Solver (C++) commands, SAVE and RELOAD can help simulate several versions of the same model. SAVE/SYSTEM creates a baseline configuration which you can then reload and simulate repeatedly without leaving Adams Solver (FORTRAN). After each RELOAD/SYSTEM, you may modify the model. This can be done by using the ACTIVATE and DEACTIVATE commands to switch sets of loads on and off, for example.
The following command file uses the SAVE/SYSTEM and RELOAD/SYSTEM commands to run three simulations from the same input file, creating three sets of output files: case1, case2, and case3. The command file loads example.adm, the original model, which contains three sets of forces. After deactivating all the forces and performing a static solution, the SAVE command saves the whole system. ACTIVATE commands then turn on one set of forces at a time.
Between simulations, the RELOAD command restores the saved version of the model. Reloading the save file returns the model to the conditions at the time of the save. In this case, the saved version of the model is at static equilibrium with all the forces inactive.
example | |
case1 | |
dea/sfo,id=101,102,201,202,301,302 | ! Deactivate all forces |
sim/static | ! Find static equilibrium |
save/system, file=ex.sav | ! Save system at static, no forces |
act/sfo, id=101,102 | ! Activate first set of forces |
sim/dyn, end=.25, steps=100 | ! Simulate |
rel/system, file=ex.sav, out=case2 | ! Reload(now back at static,no forces) |
act/sfo, id=201,202 | ! Activate second set of forces |
sim/dyn, end=.05, steps=20 | ! Simulate |
rel/system, file=ex.sav, out=case3 | ! Reload(now back at static,no forces) |
act/sfo, id=301,302 | ! Activate third set of forces |
sim/dyn, end=.10, steps=40 | ! Simulate |
stop | |
The following command file demonstrates using SAVE/STATES and RELOAD/ STATES.
deactivate/contact,id=1 | ! Deactivate contact |
sim/dyn, end=1.3, dtout=0.004 | ! Simulate |
save/states, buffer=1 | ! Save states to buffer |
activate/contact,id=1 | ! Activate contact |
sim/dyn, end=2.0, dtout=0.004 | ! Simulate |
reload/states, buffer=1 | ! Reload states from buffer |
sim/dyn, end=2.0, dtout=0.004 | ! Simulate |
See other
Simulation available.