Create/Edit Checks and Corrections

Create new checks and corrections, and edit default checks and corrections.

HyperMesh supports default checks and corrections in the Model Checker. You can use the Check and Correction entities to create new checks and corrections.

Create New Tcl Checks

Create new Tcl checks in the Model Checker.

Overview

Each Tcl check is associated with a unique Tcl procedure that contains the algorithm to be verified in the check. Tcl procedures must exist in pre-defined namespaces:
  • HM::ModelCheck::LsDyna for LS-DYNA specific procedures
  • HM::ModelCheck::Nastran for Nastran specific procedures
  • HM::ModelCheck::OptiStruct for OptiStruct specific procedures
  • HM::ModelCheck::RadiossBlock for Radioss specific procedures
  • HM::ModelCheck::Abaqus for Abaqus specific procedures
  • HM::ModelCheck::Ansys for ANSYS specific procedures
  • HM::ModelCheck::Permas for Permas specific procedures

Key Points

Keep these points in mind when creating Tcl checks:
  1. The check name should be unique.
  2. Config should be set to “TclCheck.”
  3. Entity type should match the type of entity on which check is performed.
  4. A level should be associated with check.
  5. Function name should include the entire name of the Tcl procedure with namespace.
  6. The Tcl file name can either be a relative path from the checks configuration file or the absolute path of the Tcl file containing the Tcl procedure.


    Figure 1.

Optional Method

There is an optional way to set the path of the custom Tcl file using environment variables.

The HM_MODELCHECKER_TCLPATH_$profile_name environment variable should be used per solver user profile. When this is set, only the Tcl file name in the “Tcl File” field is needed.

By default, this environment variable points to the path of the checks configuration file. If the Tcl file and config file are in same location then you do not need to specify the path. Only the name of the file in “Tcl file” field is required.

Within the Tcl procedure, update the failed entity list on the check as follows:
*createmark mats 1 $failed_id_list
hm_setmodelcheckresultentids $checkDisplayname 1

When there are no failed entities found, it is a good practice to update an empty list on the check using the same two lines above.

Sample Tcl Procedure

The following is a sample Tcl procedure:
proc :: HM::ModelCheck::Nastran::CheckPropsUnused { checkDisplayname } {
    set entitytype [hm_getmodelcheckenttype $checkDisplayname];
         if { $entitytype ne "Props" } { return; }

    set lsProps [hm_propertylist id];
    if {[llength $lsProps] == 0} {
        hm_setmodelcheckcheckstatus $checkDisplayname 3;
        return;
    }

    *EntityPreviewUnused properties 1;
    set lsProps [hm_getmark props 1];
    set lsFailed {};
    foreach prop_id $lsProps {
        lappend lsFailed $prop_id;
    }

        eval *createmark $entitytype 1 "by id" $lsFailed;
        if { [hm_marklength $entitytype 1] } {
            hm_setmodelcheckresultentids $checkDisplayname 1;
        } else {
     hm_setmodelcheckresultentids $checkDisplayname 1;
        }
   };

Create Checks

  1. In the Model Checker, right-click on an existing check or one of the check folders (ERROR, WARNING, INFO) and select Create Check from the context menu.
    The Entity Editor opens and displays entity attributes corresponding to the check.


    Figure 2.
  2. For Name, enter a name for the check.
  3. For Config, select a configuration type.
  4. Define attributes.
    Note: The attributes available are dependent on the type of Config selected.
    Common attributes to define include:
    Attribute Description
    Check Entity Type of entity on which the check is applied.
    Folder Directory that contains the definition of the grouping or folder name in which the check is located.
    Level Type of check to perform: ERROR, WARNING, INFO.
    Function Name Core check function to apply for the check. Core check function name can be found in Entity Editor of existing checks.
    Auto Correction Function to perform when automatically performing check correction.
    Manual Correction Function to perform when manually performing check correction.
    Default Correction Default automatic correction associated with the check. By default, the first chosen auto correction is considered the default value if you do not make a selection in this field.
    When Config = TclCheck, define the following attributes:
    Attribute Description
    Tcl File External Tcl script to perform the desired check.
    When Config = GenericCheck, define the following attributes:
    Attribute Description
    Number of references Numbers of references to be defined and exposed in the table entity in which references must be defined.
    Number of filters Number of filters to be defined and exposed in the table entity in which filter rules must be defined.
    Number of Value definition Number of value definition to be defined and exposed in the table entity in which value definition rules must be defined.

Create Corrections

  1. Create a Correction in the following ways:
    • In the Model Checker, right-click and select Create Correction from the context menu.
    • In the Entity Editor of a Check entity, right-click on a Correction attribute and select Create from the context menu.

      Supported Correction attributes include: Manual Correction, Auto Correction, Default Correction.

    If you created a Correction from the Model Checker, a new Correction opens in the Entity Editor, and if you created a Correction from a Correction attribute in the Entity Editor, a new Correction opens in the Create Modelcheckcorrections dialog.


    Figure 3.
  2. For Name, enter a name for the correction.
  3. For Config, select a configuration type.
  4. Define attributes.
    Note: The attributes available are dependent on the type of Config selected.
    When Config = Automatic, define the following attributes:
    Attribute Description
    Tcl File External Tcl script to perform the desired check.
    Function name Core check function to apply for the check. The core check function name can be found in Entity Editor of existing corrections.
    Correct value Value to be set when performing auto correction.
    When Config = Manual, define the following attributes:
    Attribute Description
    Option Tool used to perform a manual correction.

Generic Checks

Some pre-defined checks are available in the Model Checker that can be easily customized. The config of these checks is “GenericCheck.”

Overview

The value limits and filters in these existing checks can also be modified. For the creation of these checks:
  • Use a unique check name
  • The entity type should be set to the type of entity on which the check is to be performed
  • A level should be associated with the check
  • Function names that can be customized are listed below
  • Define filter definitions, value definitions, and references as applicable
  • Filter definitions:
    • Filter Attribute – “CARD”, “CONFIG”, “TYPE”, “GROUPTYPE” or name of attribute as defined in template
    • Filter Value – Filter to pass (attribute name or value). Even status of the attribute can be checked in some of the above functions using “STATUS_OFF”
    • Filter Criteria – PASS, FAIL, EQ, NE, LT, LE, GT, GE. PASS and FAIL usually used for STATUS_OFF filter


      Figure 4.
  • Value definitions:
    • Value Attribute – Dataname or attribute name as defined in template as applicable to the functions above
    • Value Limit – The acceptable value limits
    • Value Criteria – EQ, NE, LT, LE, GT, GE


      Figure 5.
  • Reference definitions:
    • References – Dataname or attribute name as defined in template


      Figure 6.

Function Names that can be Customized

AttributeValueRange – To check whether attribute value is defined within range specified. This check can be run on integer, double, and entity fields that are mandatory or that need to be defined within a prescribed limit for the solver to run. The value limits and criteria are defined in value definitions. Checks can be further customized to add filters using filter definitions.


Figure 7. Area is not defined for section beam
DatanameValueRange – Check if the dataname on an entity is in specified range. This check has the same functionality as “AttributeValueRange” and can be run on datanames that are not defined in the template file.


Figure 8. Admas having zero or negative mass
EntityFieldDefined – Check if an entity is associated with the attribute field. Entity is defined in References. Check can be further customized to add filters using filter definitions. This check works on both attributes defined in the template and data names defined for new entities.


Figure 9. Sid is missing for the airbag definition
UndefinedEntities – Check if an entity contains undefined entities. Undefined entity needs to be defined in references. This check works on both attributes defined in the template and data names defined for new entities.


Figure 10. Component is referring to undefined entity
UnresolvedEntities – Check if an entity refers to an unresolved entity. Unresolved entity needs to be defined in references. This check works on both attributes defined in the template and data names defined for new entities.


Figure 11. Unresolved main or secondary in contact
EntGetRefIncludeFile – Check if entity and the references within the entity are in the same include. Attribute needs to be defined in references. This check can only be used on attributes defined in the template file.


Figure 12. Mat and referenced curves not in same include
CheckReferencesInSameInclude – Check if an entity and the entity referred in the dataname field are in the same include. Dataname needs to be defined in references. This check can only be used on data names of new entities.


Figure 13. Cload and referenced entities not in same include
EntityNotOnRigidParts – Check if the entity is associated with a rigid part. This check is specific to LS-DYNA solver. Entity is defined in references. Check can be further customized to add filters using filter definitions.


Figure 14. CRB referring to non-rigid part

After checks are added, right-click in Model Checker Browser and click Save config file to write out the checks to an .xml config file that can be accessed later.