Creating a Database
The steps you need to follow to create a results database with hmreslib are listed below. When creating programs using C and hmreslib, keep in mind that C is case sensitive.
- Create a simulation by calling HMRES_simulationcreate().
- Open the simulation to allow items to be placed inside by using HMRES_simulationopen().
- Create a data type by calling HMRES_datatypecreate().
- Open the data type by calling HMRES_datatypeopen().
- Add result records to the simulation and data type by calling the appropriate add function HMRES_displacementadd() or HMRES_valueadd(). These functions are called once for each node or element record to be added. For example, if there are results for 1000 nodes, then the ...add() functions must be called 1000 times for each data type. Each call passes one of the 1000 nodes and its respective values.
- Continue to open as many data types as necessary for this simulation and store the appropriate results by repeating the last three steps.
- Repeat the above steps until all of the simulations, data types for each simulation, and results for each data type are passed to hmreslib.
- After all of the results are passed to hmreslib, call HMRES_writeresults() to transfer the memory image of the results to disk.
- Only one simulation and data type may be opened at a time.
- When a data type is created, it is placed in the currently open simulation.
- When a result record is added to the database, it is placed in the currently open data type.
- When a simulation or data type is created, it is not opened.
- When a simulation or data type is opened, the simulation or data type that was previously opened is closed.
- While simulations should only be created once and data types should only be created once for each simulation, they may be opened as many times as necessary. This feature may come in handy when results for a model are scattered in several different locations.