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
- 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
- The check name should be unique.
- Config should be set to “TclCheck.”
- Entity type should match the type of entity on which check is performed.
- A level should be associated with check.
- Function name should include the entire name of the Tcl procedure with namespace.
- 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.
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.
*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
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
-
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.
- For Name, enter a name for the check.
- For Config, select a configuration type.
-
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
-
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. - For Name, enter a name for the correction.
- For Config, select a configuration type.
-
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
- 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
- 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
- Reference definitions:
- References – Dataname or attribute name as defined in template
Function Names that can be Customized
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.