Method Manager

Use the Method Manager dialog to create new methods and populate libraries or import existing libraries from xml files, as explained in previous chapters.

The Method Manager is a notebook with two sheets (Library or Resources).




Figure 1. Library Editor (normal and edit mode)

Settings

When the Method Manager is invoked for the first time, it is populated only with the default library and no resource. An empty library called "Session" is added to the list; it aims to contain temporary method definitions used in the live session only.

When you exit the HyperMesh session, a settings file is saved. The settings file contains the list of libraries and resources loaded before exit; the content of the Session library is removed. The settings file is saved in user/.altair/StressTool/settings.xml for windows and /home/.altair/StressTool/settings.xml for linux.

When starting a new instance of HyperMesh (without deleting the settings file), all previously loaded libraries and resources are scanned; hence, they are available in the Method Manager and up to date.

Features

When the Method Manager is invoked from other tools like Assign Method or Run Method, you can only review method definitions and create designpointmethod entities in the database from the selected methods in the browser.

However, when the Method Manager is invoked from the Create Methods tool, it opens in edit mode and provides you with several options to:

  • Import or delete resources (oml, python, tcl files)
  • Import an existing library (from an xml file)
  • Create a new library (empty)
  • Delete a library
  • Edit a library (except the default library)
    • Add or delete methods in a library
    • Define method inputs/outputs

Manage Resources

Functions defined in files (oml, python, tcl) are considered as resources that can be used to create a method. These can be managed in the Resources tab (Figure 2).

Context menu options are:

Add Resource
Folder level (COMPOSE, PYTHON, TCL) or empty area
Prompts for a file of the selected type and scans the file for functions (resp def for python and procs for tcl). If valid functions are found, they are listed under the resource node.
You can also click to add a resource.
Delete
Resource level
Deletes selected resource unless any of its functions are used by a method in libraries.
You can also click to delete a resource.
Edit
Resource level
Run system command to open the file with its associated editor.
Create Method & Assign Method
Function level
Create is enabled only if a library is in edit mode; it adds a new method in the current library, using the function/resource from which it is invoked. Assign is enabled if a method is currently edited. As a result, it updates the current method to refer to the function from which the menu is invoked.
It is also possible if an *.oml file is edited in Altair Compose to use Register Function… in Compose to directly make it available in the list of registered functions in the Resources tab.


Figure 2. Register OML function

Manage Libraries

By default, the Library browser is in review mode only. Selecting a method in the list will display its details in the method editor:

  • Input argument list and mapping
  • Output arguments
  • Sort


Figure 3. Attribute mapping review

Selecting an item in the list of inputs will show its mapping either as:

  • Model attribute
    • If found in predefined list of attributes as Model info
  • Result attribute
    • If found in predefined list of attributes as Result info
  • Metadata
    • Shows entity type where metadata is bound and default value
  • Output from another method (called method Chain)
    • Show independent method used as source
  • User
    • Argument defined locally in library file
    • Value available only in tooltip
  • Undefined
    • Mapping key is unresolved
    • Attention: Method will not run

Import/ New /Delete Library

Import Library
Prompts you to import an *.xml file, which must follow the schema detailed in Author Custom Methods. If the selected file is malformed, nothing is added to the browser. If the import is successful, then a new library folder is added to the browser with a list of methods available. Moreover, an automatic scan of functions used by new methods may result in new resources being added (available in the Resources tab).
New Library
Adds a new library to the list and brings it to edit mode to let you add methods.
A library added from Import or New has an automatic name that can be changed using the Rename Library option on the library node.
Delete Library
Removes the library and its methods from the list, unless a designpointmethod entity in the database refers to a method defined in that library.
Resources are not deleted.

Scan/Open Library

Scan Library
Available on a library node. It will re-scan the library file to check for updates. Such an operation is performed automatically each time you open the Library tab.
Open Library
Open the library xml file calling its associated file editor.

Edit Library

Edit Library is available on a library node (except Default) or method and puts the Library tab in edit mode. The browser is populated only with the given library (works with Session too). Alternatively, you can double-click on a method/library to reach the same state.
Note: Editing capabilities are available only when the browser display method is in hierarchy view .
The / icons add or delete methods. New methods inherit their category from the current config set in the display filters.
  • default engine is “COMPOSE”
  • default function is the first registered function if any exist
  • otherwise, it defaults to the first COMPOSE resource and points to its first function
At this point, you can fully edit the method (see Edit Methods).

If the current library is Session, then using Save commits the changes in the session library and leaves edit mode. Using Save as gives a change to transform methods in Session onto a saved library; it results in an xml file written and imported in the Library Manager. The Session library will be clean.

If the current library edited is a regular library, then Save asks for confirmation to overwrite the original xml file. If accepted, changes done to the library file are permanent (no Undo) and you are returned to the library view mode; otherwise, operations will be cancelled. Using Save as saves a new xml file and imports it as a new library. If method names from the newly imported library conflict with existing libraries, then the methods are disabled from selection. To resolve the issue, you need to either rename the method display name in edit mode or delete the previous library from the list (where methods are duplicated).

Cancel will cancel all changes and leave library edit mode.

Edit Methods

When a library is in edit mode, select a method in the list to change its engine or resource/function. Selecting a function to be used can be done directly from the Resource tab (Create Methods & Assign Methods). The Method Category can be changed if the config filter is set to Generic.

Once a function is selected, you can define the method arguments in the editor with three tabs: Inputs/ Outputs/Sort (Figure 3).

Inputs

If the selected function was defined with an explicit list of arguments, like func(a,b,c)=, then the number of inputs is set by default to the number of arguments. You can increase/decrease the number of inputs but no lesser than the number of function arguments. If the last argument name starts with arg, it is considered an optional argument. If args is used in the function definition, then inputs defaults to 0.

Each input argument listed in the Input table has 6 columns. The first column is the function’s variable name. It is filled by the variable name in the function file by default but can take any value. It is only for human reference.

The second column (Database Attribute Query) is the most important as it defines the key mapped to the input parameter. A tooltip on this column shows the actual key value in review mode.

Other columns include options to provide input values bind per bind, or as a vector, or as an aggregated value (min, max, sum, avg) across loadcases or elements/layers when applicable.



Figure 4.
To map an argument with a query key:
  1. Select an argument.
  2. In the Model | Result | Metadata | Method tabs, double-click on a tree item to map it, or select options and click Map.
  3. Select options if a vector or aggregation is desired.
  4. If options need to be propagated up/down, right-click on an input and select Propagate up/down.
  5. To reset your selection, use Reset current or Reset all in the right-click menu.
The tool automatically manages available options and compatibility based on the method category and selections.

Outputs

Defines the number of outputs from the function and gives a meaningful name to each output. The given name will be the displayed name for the output in the contouring tool. Moreover, when chaining methods one after another, the mapping key mapped to an input parameter will use this name.

One output can be tagged as “margin of safety”. It states that this output can be used as a metric when comparing multiple methods altogether. When multiple methods are assigned to a designpointset, then an extra table is created with consolidated values comparing methods based on their “margin of safety” key.

Sort

In Sort tab, you can specify whether a post-evaluation sorting must occur (Sorting).

In Aggregated Domain, select either:
None
No spatial aggregation.
All
Sort across all entities.
Across layers
Sort across layers.
It then retains value only at element level.
Across elems
Sort across elements.
It then retains value only at designpoint level only.
In Loadcases:
Per loadcase
Does not perform loadcase envelope.
Gives a result per loadcase.
Envelope
Include loadcases in envelope.
  • Only final envelope available
  • No intermediate loadcase data stored
Type
The type of aggregation
Sorting Value
Select one method output as a metric for sorting.

If no domain nor loadcase are considered, then no Sort block is written in the method definition.