General

General

Why is it important to use the SET,LAST command when reading a Mechanical Database in MAPDL?

    • FAQFAQ
      Participant

      It might help understand this if we look at how the the SET command works with the MAPDL general post-processor (/POST1 module), database (file.db), and results file (file.rst). MAPDL stores results in the results file; and stores the model and one set of results in the database. /POST1 commands do not directly use the results file. They use the results that are stored in the database. The SET command instructs MAPDL to read one set of results from the results file and put them into the database for access by /POST1 commands. For example, SET,FIRST puts the first set of results from the results file into the database. SET,LAST puts the last set of results from the results file into the database. The SET command overwrites any results previously stored in the database to ensure that the database only contains one set of results. The SET command does not directly interact with /POST1. It just puts results in the database which can then be accessed by the /POST1 commands. /POST1 commands do not need a SET command to perform their tasks. If you do not implicitly issue a SET command, the /POST1 commands will just use whatever results (complete or incomplete) that are currently in the database. If the results needed by a /POST1 command are not currently in the database, it will issue an error message when performing operations on nodes or elements. What might be confusing is that in the normal course of solving, results are stored in the database and they are not automatically removed when the solution is finished. So, when a solution is successful, some results remain in the database. In particular, the complete last set of results typically remain in the database and therefore are accessible by /POST1 commands (which usually makes issuing SET,LAST redundant). In some cases, the results remaining in the database after the solution might be incomplete. Hence, issuing a SET command retrieves the full set of results. MAPDL does not guarantee that the results that remain in the database after a solution are complete. To ensure that a full set of results are put into the database, you must directly issue a SET command. You cannot assume that a complete set of results will be automatically retained in the database after the solution is finished.