• Array fields

Fields of conditions, problem data or materials could store an array of values, and the lenght of this array is not predefined, could be set at runtime.

For example, if a material has a variable property (an example would be where a property was dependent on temperature and was defined with several values for several temperatures) a table of changing values may be declared for this property. When the solver evaluates the problem, it reads the values and applies a suitable property value.

The declaration of the table requires two lines of text:

The first is a QUESTION line with a list of alphanumeric values between parentheses.

QUESTION: field_name(column_title_1,...,column_title_n)

These values are the names of each of the columns in the table so that the number of values declared is the number of columns.

This first line is followed by another with the default data values. It starts with the words VALUE: #N#, and is followed by a number that indicates the quantity of elements in the matrix and, finally, the list of values.

VALUE: #N# number_of_values value_1 ... value_m

The number of values m declared for the matrix obviously has to be the number of columns n multiplied by the number of rows to be filled.

e.g.

MATERIAL: Steel

QUESTION: TypeId

VALUE: Metal

STATE: Hidden

QUESTION: Internal_Points(X,Y,Z)

VALUE: #N# 3 0.0 0.0 0.0

HELP: Internal points coordinates

END MATERIAL

and example writting the values of this material from the .bas template: TEMPLATE FILES

*loop materials

*if(strcmp(Matprop(TypeId),"Metal")==0)

*set var N=Matprop(Internal_Points,int)

X Y Z

*for(i=1;i<=N;i=i+3)

*Matprop(Internal_Points,*i) *Matprop(Internal_Points,*operation(i+1)) *Matprop(Internal_Points,*operation(i+2))

*end for

*endif

*end materials

Note that in the example a hidden field named 'TypeId' is used to identify this and its derivated materials.

  • Aesthetic fields:

These fields are useful for organizing the information within data files. They make the information shown in the data windows more readable. In this way you can better concentrate on the data properties relevant to the current context.

  • Book: With the Book field it is possible to split the data windows into other windows. For example, we can have two windows for the materials, one for the steels and another for the concretes:

BOOK: Steels

...

All steels come here

...

BOOK: Concretes

...

All concretes come here

...

The same applies to conditions. For general and interval data the book field groups a set of properties.

  • Title: The Title field groups a set of properties on different tabs of one book. All properties appearing after this field will be included on this tab.

TITLE: Basic

...

Basics properties

....

TITLE: Advanced

...

Advanced properties

....

  • Help: With the Help field it is possible to assign a description to the data property preceding it. In this way you can inspect the meaning of the property through the help context function by holding the cursor over the property or by right-clicking on it.

QUESTION: X-Constraint#CB#(1,0)

VALUE: 1

HELP: If this flag is set, movement is ...

  • Image: The Image field is useful for inserting descriptive pictures in the data window. The value of this field is the file name of the picture relating to the problem type location.

IMAGE: young.png

  • Unit field: With this feature it is possible to define and work with properties that have units. GiD is responsible for the conversion between units of the same magnitude

....

QUESTION: Normal_pressure#UNITS#

VALUE: 0.0Pa

...

  • Dependencies: Depending on the value, we can define some behavior associated with the property. For each value we can have a list of actions. The syntax is as follows:

DEPENDENCIES:( <V1>,[ TITLESTATE,<Title>,<State> ],<A1>,<P1>,<NV1>,...,<An>,<Pn>,<NVn> ) ... ( <Vm>,<Am>,<Pm>,<NVm>,... )

where:

  • <Vi> is the value that triggers the actions. A special value is #DEFAULT#, which refers to all the values not listed.
  • [TITLESTATE,<Title>,<State>] this argument is optional. Titlestate should be used to show or hide book labels. Many Titlestate entries can be given. <Title> is the title defined for a book (TITLE: Title). State is the visualization mode: normal or hidden.
  • <Ai> is the action and can have one of these values: SET, HIDE, RESTORE. All these actions change the value of the property with the following differences: SET disables the property, HIDE hides the property and RESTORE brings the property to the enabled state.
  • <Pi> is the name of the property to be modified.
  • <NVi> is the new value of <Pi>. A special value is #CURRENT#, which refers to the current value of <Pi>.
  • Here is an example:

    ...

    TITLE: General

    QUESTION: Type_of_Analysis:#CB#(FILLING,SOLIDIFICATION)

    VALUE: SOLIDIFICATION

    DEPENDENCIES: (FILLING,TITLESTATE,Filling-Strategy,normal,RESTORE,

    Filling_Analysis,GRAVITY,HIDE,Solidification_Analysis,#CURRENT#)

    DEPENDENCIES: (SOLIDIFICATION,TITLESTATE,Filling-Strategy,hidden,HIDE,

    Filling_Analysis,#CURRENT#,RESTORE,Solidification_Analysis,#CURRENT#)

    TITLE: Filling-Strategy

    QUESTION: Filling_Analysis:#CB#(GRAVITY,LOW-PRESSURE,FLOW-RATE)

    VALUE: GRAVITY

    QUESTION: Solidification_Analysis:#CB#(THERMAL,THERMO-MECHANICAL)

    VALUE: THERMAL

    ...

    • State: Defines the state of a field; this state can be: disabled, enabled or hidden. Here is an example:

    ...

    QUESTION: Elastic modulus XX axis

    VALUE: 2.1E+11

    STATE: HIDDEN

    ...

    • #MAT#('BookName'): Defines the field as a material, to be selected from the list of materials in the book 'BookName'. Here is an example:

    QUESTION:Composition_Material#MAT#(BaseMat)

    VALUE:AISI_4340_STEEL

    The Tkwidged special field mechanism allow to customize with Tcl scripting language condition or material fields.

    some Tcl procedures are predefined in dev_kit.tcl to be used for common cases, like show current layers, materials, pick a point or node, or select a filename.

    • Layer field:

    Declare in the tkwidget field to use the Tcl procedureGidUtils::TkwidgetGetLayername, e.g:

    ...

    QUESTION: your_question

    VALUE: your_layername

    TKWIDGET: GidUtils::TkwidgetGetLayername

    • Material field:

    Declare in the tkwidget field to use the Tcl GidUtils::TkwidgetGetMaterialname e.g:

    ...

    QUESTION: your_question

    VALUE: your_materialname

    TKWIDGET: GidUtils::TkwidgetGetMaterialname

    • Pick point or node field

    Declare in the tkwidget field to use the Tcl procedure GidUtils::TkwidgetPickPointOrNode , e.g.

    ...

    QUESTION: your_question

    VALUE: your_node_id

    TKWIDGET: GidUtils::TkwidgetPickPointOrNode

    • Select filename field

    Declare in the tkwidget field to use the Tcl procedure GidUtils::TkwidgetGetFilenameButton , e.g.

    ...

    QUESTION: your_question

    VALUE: your_filename

    TKWIDGET: GidUtils::TkwidgetGetFilenameButton

    • Vector field

    To pack in a single line the three components of a vector, internally stored in the same question as a list of three real numbers, e.g.

    ...

    QUESTION: your_question

    VALUE: vx vy vz

    TKWIDGET: GidUtils::TkwidgetGetVector3D

    • Text widget instead of entry widget

    To replace the standard single-line entry widget with a multi-line text widget.

    ...

    QUESTION: your_question

    VALUE: your_value

    TKWIDGET: GidUtils::TkwidgetText

    • Configure the entry field widget

    procedure to change some configuration of the ttk::entry widget. GidUtils::TkwidgetEntry CONFIGURE {-<option> <value>}

    ...

    QUESTION: your_question

    VALUE: your_value

    TKWIDGET: GidUtils::TkwidgetEntry CONFIGURE {-width 20}