Create 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.

  1. Create a simulation by calling HMRES_simulationcreate().
  2. Open the simulation to allow items to be placed inside by using HMRES_simulationopen().
  3. Create a data type by calling HMRES_datatypecreate().
  4. Open the data type by calling HMRES_datatypeopen().
  5. 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.
  6. Continue to open as many data types as necessary for this simulation and store the appropriate results by repeating the last three steps.
  7. Repeat the above steps until all of the simulations, data types for each simulation, and results for each data type are passed to hmreslib.
  8. After all of the results are passed to hmreslib, call HMRES_writeresults() to transfer the memory image of the results to disk.
HyperMesh does not require that a data type contain a results record for every node or element in a model. Therefore, only create result records within a data type for the entities that have actual results. The following rules apply when building a results database:
  1. Only one simulation and data type may be opened at a time.
  2. When a data type is created, it is placed in the currently open simulation.
  3. When a result record is added to the database, it is placed in the currently open data type.
  4. When a simulation or data type is created, it is not opened.
  5. When a simulation or data type is opened, the simulation or data type that was previously opened is closed.
  6. 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.