HM-4060: Work with Include Files

Many FEA solvers allow you to organize your input deck into separate files, and provide a mechanism to read all files linked to a single input deck. This capability is commonly known as "includes."

HyperMesh provides several options for importing such models, one of which preserves the include structure upon import. The Includeview in the Model Browser is available to manipulate these includes. The Includeview lets you create, review, edit, organize, and update the contents of any HyperMesh model into various include files. Every entity in HyperMesh then belongs to either the master model or one of its include files.

While HyperMesh supports include formulations for several other solvers, you will use LS-DYNA 970 input decks for the purpose of this tutorial.

In this tutorial you will learn how to:
  • Import include files
  • Review and manipulate includes
  • Create includes and reorganize the database
  • Locate entities in includes
  • Import new data into includes
  • Export options

This exercise uses the master.k file, which can be found in the hm.zip file. Copy the file(s) from this directory to your working directory.

Load the User Profile

In this step you will load the LS-DYNA user profile, import the LS-DYNA decks (master file and include files) defining the model, and preserve the organization of the data into the various include files.

  1. Start HyperMesh Desktop.
  2. In the User Profile dialog, select LS-DYNA Keyword970.
    Note: Selecting a solver user profile sets the FE input reader to this solver and loads the solver’s FE output template. It also loads a macro menu with numerous tools specific to this interface. The graphical user interface is also tailored to this solver with panel names and options renamed or removed to match its terminology as much as possible.
  3. Click OK.
  4. From the menu bar, click File > Import > Solver Deck.
    Note: The Import - Solver Deck tab contains the following advanced options for importing include files:
    • Merge: merges all of the data in the individual includes into a master model, and then imports the master model into HyperMesh as a single model. HyperMesh has no knowledge regarding individual include files with this option.
    • Skip: reads INCLUDE statements as control cards and ignores the data within the include files. None of the contents of the include files are processed.
    • Preserve: preserves the INCLUDE statements, and processes the contents of the include files. The contents of the include files are "marked" to remember which include file they belong to. When the deck is exported from HyperMesh, if desired, all of the entities that are marked as belonging to include files get written back to that include file. The entire file structure (the master file and all of its include files) are rewritten from the HyperMesh database.
  5. In the File field, open the master.k file.
  6. Next to Import options, click .
  7. From the Include files drop-down list, select Preserve.
  8. Click Import.
    HyperMesh imports the master.k deck and the wheels.key, frame.key, and engine.key include files, which are also present in the same directory. The truck model defined with a master deck and several include files were imported into HyperMesh while preserving the organization of the data between the various files.


    Figure 1.

Review the Model Organization

You can access the Include view () in the Model Browser. In this view you can create, review, edit, organize, and update the contents of a model into various include files. From the right-click context menu you can access additional Include view functions.

In this step, you will launch the Include view, review the structure of the model and its organization into the various includes, and experiment with some of the display and configuration options available.

  1. In the Model Browser, click .
    HyperMesh displays a tree-like organization of the database structure.
    Note:

    The Master Model is at the top level of the include browser. Data, which does not have any references to an include file, is stored in the master model. Each include file is represented by along with its file name. Each include can be expanded to reveal its contents. The contents of each include is grouped into folders containing each type, next to which appears the total number of entities of that type. Each of the folders can be expanded to review the individual entities in that folder. The browser can be configured to show only specific entities of interest.

  2. Expand the include, engine.key.
  3. Review its content, which consists of components, materials, and properties.
  4. Expand the Component folder, which consists of six component collectors.


    Figure 2.
  5. Review the contents of the other includes as well as the contents of the folders belonging to the Master Model. The wheels.key include contains, for example, components, control volumes, groups, materials, properties, and sets.
    Note: While most entities are presented in this tree, elements and nodes are not listed, as this would not be practical for larger models.
  6. In the Model Browser, right-click and select Collapse All from the context menu.
    All folders collapse.
  7. Right-click on Master Model and experiment with the Show and Hide display options in the context menu.
  8. Visually review the components that each include contains by isolating the include you wish to review using the Isolate only option in the context menu.


    Figure 3.
  9. Turn on the display of the entire model.

    In this section, you launched the Include view and reviewed the structure of the model and its organization into the various includes. You also customized the Include view and used some of the display options to modify the display of the model in the graphics area.

Review Options

You can configure the columns within the Include View so that only the columns you are interested in are displayed. In this step you will learn how to configure the Include View in the Model Browser.

  1. In the Model Browser, right-click and select Collapse All from the context menu.
    Note: There are columns for Export, Include Path, and Include Type.


    Figure 4.
  2. Expand the frame.key folder.
    Note: The Export, Include Path and Include Type columns are only relevant for the include files and not for the individual entities within the file.


    Figure 5.
  3. In the Model Browser, right-click and select Configure Browser form the context menu.
  4. In the Browser Configuration dialog, select the Columns tab.
    Note: From the Columns tab you can define which columns are displayed in the Model Browser when you are in the Include View.


    Figure 6.
  5. Clear the Include Type checkbox.
  6. Click OK.
    The Include Type column is no longer displayed.

Create New Includes

Whether you import includes or are simply starting from a ‘flat’ HyperMesh model, you can create new includes in your database using the Include View, and organize entities into them using the Organize panel. You can also select entities (using the standard Shift and Ctrl keys) from the Include View and drag them between two includes or between the master model and an include.

To determine which include a specific entity belongs to, you can use the Organize panel’s locate function.

In this section, create a new include for the doors and organize the corresponding collectors into it using the Organize panel. Finally, determine which include a certain material belongs to using the locate function.

  1. In the Model Browser, Include View, right-click on Master Model and select Create Include File from the context menu.
    HyperMesh adds a new include under the master model with an editable name and displays it in bold, which signifies that it is the current include.
    Note: You can add includes under the master model or under includes themselves.


    Figure 7.
  2. In the editable field, type the name doors.key for the new include.
    Note: You can rename or make current a new include using the right-click context menu.
  3. Open the Organize panel by clicking organize from the Tool page.
  4. Go to the includes subpanel.
  5. Set the entity selector to comps.
  6. Click dest= and select doors.key as the destination for the components.
  7. Click comps.
  8. Select the components: SHELL: DOOR-LEFT, SHELL: DOOR-RIGHT, and SHELL: DOOR-WINDOWG-LEFT.
  9. Click select.
  10. Click move.
    HyperMesh moves the selected components into the doors.key include.
    Note: An expand/collapse icon is added next to the doors.key include, which indicates that data has been placed under it.
  11. Expand the doors.key include, Component folder to review the components that you moved.
  12. Hide all includes except door.key.
    HyperMesh displays the elements organized in the include in the graphics area.


    Figure 8.
  13. Change the display back to Display All.
  14. In the Organize panel, includes subpanel, set the entity selector to mats.
  15. Click locate.
    HyperMesh displays a list of all the materials available in this model.
  16. Select the material, MATL1_38.
    HyperMesh updates the dest= field to show which include (or master) file this particular material belongs to. In this case, it belongs to the wheels.key include.


    Figure 9.
  17. Exit the panel by clicking return.

    In this section, you created a new include in the Include view, and moved some components from the master model, as well as their corresponding elements, into it. Finally, you used the locate function to quickly identify which include a material belonged to.

Import Data and Export the Model

In this section, you will create a new include in the master model labeled barrier.dyn, and then import a barrier model into it. You will then review the include file options for each one of the includes in the model and modify them as needed. Lastly, you will export the model, while also preserving the includes.

By default, the Master Model is always the current file (displayed in bold in the Include view) and any new entities you create or import into HyperMesh will be automatically placed in it. You can use the Make Current option from the Include view context menu to make any include the current include. When you create a new include, this include will automatically become the current include.

You can use the Include File Options function in the Include view context menu to define export options for individual include files. Using this option, you can define whether the include file should get exported, when the export function is used, and where the file should be exported.

The Export - Solver Deck tab contains the following advanced options for exporting models that contain include files:
  • Merge: merges all of the data in individual include files into a single master model during export. The exported file does not contain references to any include files.
  • Preserve: exports all the data in individual include files separately to their corresponding files. The references to these includes in the master model file are also maintained.
  1. In the Include view, right-click on Master Model and select Create > Include File from the context menu.
  2. In the editable field, type the name barrier.dyn for the new include.
    Note: The new include is displayed in bold, which indicates that it is now the current include and any new data created or imported into HyperMesh will be placed in it.
  3. From the menu bar, click File > Import > Solver Deck.
    The Import tab opens.
  4. In the File field, open the barrier.dyn file.
  5. Click Import.
    HyperMesh imports the barrier.


    Figure 10.
  6. In the Include view, expand Barrier.dyn and review its contents.
    Note: Barrier.dyn is displayed in bold, and both barrier.dyn and doors.key are non-italicized, while engine.key, frame.key, and wheels.key are all italicized. This is a visual representation of the export option that is set for each of the three includes.
  7. Right-click on engine.key and select Include File Options from the context menu.
    The Include File Options dialog opens and displays the following:
    • File path: type in or browse for the directory in which the include is to be exported.
    • Do not export: When this check box is selected, HyperMesh will not export include when you export the model. When this check box is clear, HyperMesh exports the include when you export the model. This check box is automatically selected when you read includes into HyperMesh that have their permission set to read only, as well as includes that are referenced by the master include using absolute paths.
      The frame.key, wheels.key and engine.key includes are all referenced by the master.k include that you import5ed initially using relative paths (edit the master.k file to verify this), but their permissions were set to read only. To export these includes, clear the Do not export checkbox.


      Figure 11.
  8. For the engine.key, frame.key, and wheels.key includes, clear the Do not export checkbox and then click Set.
  9. Right-click on an include and select Export All Includes from the context menu.
    The Export all includes dialog opens.
  10. In the File name field, type the location and name of the master model and click OK.
    HyperMesh exports the include files as individual files.
    Note: This option is equivalent to exporting the master model from the Export - Solver Deck tab () with the preserve includes checkbox selected. When you want to export a single file, use the export subpanel and set export option to merge includes.
  11. Go to the directory you selected in the previous step and verify that all includes have been exported with the names set in the Include view.

Save Your Work

In this optional step you will save your work.

Optional: Save your work as a HyperMesh file.