Defining grid generating conditions

Define grid generating conditions. Grid generating conditions are defined in “GridGeneratingCondition” element in a grid generating program definition file. Add description of grid generating condition to the grid generating program definition file you created in Defining basic information, and overwrite it. Grid generating program definition file content is now as shown in List 15. The added part is shown with highlight.

List 15 Example of grid generating program definition file that now has grid generating condition definition
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="UTF-8"?>
<GridGeneratorDefinition
  name="samplecreator"
  caption="Sample Grid Creator"
  version="1.0"
  copyright="Example Company"
  executable="generator.exe"
  gridtype="structured2d"
>
  <GridGeneratingCondition>
    <Tab name="size" caption="Grid Size">
      <Item name="imax" caption="IMax">
        <Definition valueType="integer" default="10" max="10000" min="1" />
      </Item>
      <Item name="jmax" caption="JMax">
        <Definition valueType="integer" default="10" max="10000" min="1" />
      </Item>
    </Tab>
  </GridGeneratingCondition>
</GridGeneratorDefinition>

At this point, the structure of the grid generating program definition file is as shown in Figure 31.

../_images/gridgen_structure_with_gridgencond.png

Figure 31 Grid generating program definition file structure

Now make sure that grid generating program definition file is arranged correctly.

Launch iRIC, and opens the [Select Grid Generating Algorithm] dialog with the same procedure in Defining basic information. Select “Sample Grid Creator” in the list, and click on [OK].

The [Grid Creation] dialog (Figure 32) will open. Now you can see that the grid generating condition items you defined are shown. When you checked, click on [Cancel] to close the dialog.

../_images/gridgen_cond_dialog_base.png

Figure 32 The [Grid Creation] dialog

Now add one more group and add grid generating condition items. Add “Elevation Output” Tab element just under “Grid Size” Tab element. The added part is shown with highlight.

List 16 Example of grid generating program definition file that now has grid generating condition definition
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
    (abbr.)
    </Tab>
    <Tab name="elevation" caption="Elevation Output">
      <Item name="elev_on" caption="Output">
        <Definition valueType="integer" default="0">
          <Enumeration caption="Enabled" value="1" />
          <Enumeration caption="Disabled" value="0" />
        </Definition>
      </Item>
      <Item name="elev_value" caption="Value">
        <Definition valueType="real" default="0">
          <Condition type="isEqual" target="elev_on" value="1" />
        </Definition>
      </Item>
    </Tab>
  </GridGeneratingCondition>
</GridGeneratorDefinition>

At this Point, the structure of grid generating program definition file is as shown in Figure 33.

../_images/gridgen_structure_with_gridgencond_advanced.png

Figure 33 Grid generating program definition file structure

Now make sure that grid generating program definition file is arranged correctly. Do the operation you did again, to show the [Grid Creation] dialog (Figure 34).

Now you’ll see that the new group “Elevation Output” in the group list. You’ll also notice that “Value” item is enabled only when “Output” value is “Enabled”.

../_images/gridgen_cond_dialog_advanced.png

Figure 34 The [Grid Creation] dialog

What it comes down to is:

  • Grid generating condition group is defined with “Tab” element, and grid generating condition item is defined with “Item” element.
  • The Structure under “Definition” elements depends on the condition type (i. e. Integer, Real number, functional etc.). Refer to Section Examples of calculation conditions, boundary conditions, and grid generating condition for examples of grid generating condition items for each type.
  • Dependenciy between grid generating condition items can be defined with “Condition” element. In “Condition” element, define the condition when that item should be enabled. Refer to Example of condition to activate calculation conditions etc. for examples of “Condition” element.
  • In this example, the calculation condition dialog shows the items as a simple list, but iRIC has feature to show items with more complex layouts, like layout with group boxes. Refer to Example of dialog layout definition for more complex calculation condition page layouts.