These files generate the conditions and material properties, as well as the general problem and intervals data to be transferred to the mesh, at the same time giving you the chance to define geometrical drawings or symbols to represent some conditions on the screen.
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Conditions file (.cnd)
Files with extension .cnd contain all the information about the conditions that can be applied to different entities. The condition can adopt different field values for every entity. This type of information includes, for instance, all the displacement constraints and applied loads in a structural problem or all the prescribed and initial temperatures in a thermial analysis.
An important characteristic of the conditions is that they must define what kind of entity they are going to be applied over, i.e. over points, over lines, over surfaces, over volumes, over layers or over groups, and what kind of mesh entity they will be transferred over, i.e. over nodes, over face elements or over body elements.
- Over nodes This means that the condition will be transferred to the nodes contained in the geometrical entity where the condition is assigned.
- Over face elements ?multiple? If this condition is applied to a line that is the boundary of a surface or to a surface that is the boundary of a volume, this condition is transferred to the higher elements, marking the affected face. If it is declared as multiple, it can be transferred to more than one element face (if more than one exists). By default it is considered as single, and only one element face will be marked.
- Over body elements If this condition is applied to lines, it will be transferred to line elements. If assigned to surfaces, it will be transferred to surface elements. Likewise, if applied to volumes, it will be transferred to volume elements.
...
e.g.
QUESTION: Surface_number#FUNC#(NumEntity)
VALUE: 0
In the above example, NumEntity is one of the possible variables of the function. It will be substituted by the label of the geometrical entity from where the node or element is generated.
QUESTION: X_press#FUNC#(Cond(3,REAL)*(x-Cond(1,REAL))/ (Cond(2,REAL)-Cond(1,REAL)))
VALUE: 0
In this second example, the x variable is used, which means the x-coordinate of the node or of the center of the element. Others fields of the condition can also be used in the function. Variables y and z give the y- and z-coordinates of this point.
Note: There are other options available to expand the capabilities of the Conditions window (see Special fields).
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Conditions file (.cnd)>Example: Creating the conditions file
Here is an example of how to create a conditions file, explained step by step:
- First, you have to create the folder or directory where all the problem type files are located, problem_type_name.gid in this case.
- Then create and edit the file (problem_type_name.cnd in this example) inside the recently created directory (where all your problem type files are located). As you can see, except for the extension, the names of the file and the directory are the same.
- Create the first condition, which starts with the line:
...
The VALUE: prompt must be followed by one of the optional values, if you have declared them in the previous QUESTION: line. If you do not observe this format, the program may not work correctly.
In the previous example, the X-Force QUESTION takes the value 0.0. Also in the example, the X-Constraint QUESTION includes a Combo Box statement (#CB#), followed by the declaration of the choices 1 and 0. In the next line, the value takes the parameter 1. The X_axis QUESTION declares three items for the combo box: DEFORMATION_XX,DEFORMATION_XY,DEFORMATION_XZ, with the value DEFORMATION_XX chosen.
Beware of leaving blank spaces between parameters. If in the first question you put the optional values (GLOBAL, -AUTO) (note the blank space after the comma) there will be an error when reading the file. Take special care in the Combo Box question parameters, so as to avoid unpredictable parameters.
- The conditions defined in the .cnd file can be managed in the Conditions window (found in the Data menu) in the Preprocessing component of GiD.
Conditions window in GiD Preprocessing
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Problem and intervals data file (.prb)
Files with the extension .prb contain all the information about general problem and intervals data. The general problem data is all the information required for performing the analysis and it does not concern any particular geometrical entity. This differs from the previous definitions of conditions and materials properties, which are assigned to different entities. An example of general problem data is the type of solution algorithm used by the solver, the value of the various time steps, convergence conditions and so on.
Within this data, one may consider the definition of specific problem data (for the whole process) and intervals data (variable values along the different solution intervals). An interval would be the subdivision of a general problem that contains its own particular data. Typically, one can define a different load case for every interval or, in dynamic problems, not only variable loads, but also variation in time steps, convergence conditions and so on.
The format of the file is as follows:
PROBLEM DATA
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
...
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
END PROBLEM DATA
INTERVAL DATA
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
...
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
END INTERVAL DATA
All the fields must be filled with words, where a word is considered as a string of characters without any blank spaces. The strings signaled between quotes are literal and the ones inside brackets are optional. The interface is case-sensitive, so any uppercase letters must be maintained. The default_field_value entry and various optional_value_i entries can be alphanumeric, integers or real numbers, depending on the type.
Note: There are other options available to expand the capabilities of the Problem Data window (see Special fields).
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Problem and intervals data file (.prb)>Example: Creating the PRB data file
Here is an example of how to create a problem data file, explained step by step:
- Create and edit the file (problem_type_name.prb in this example) inside the problem_type_name directory (where all your problem type files are located). Except for the extension, the names of the file and the directory must be the same.
...
- Start the file with the line:
PROBLEM DATA
- Then add the following lines:
QUESTION: Unit_System#CB#(SI,CGS,User)
VALUE: SI
QUESTION: Title
VALUE: Default_title
The first question defines a combo style menu called Unit_System, which has the SI option selected by default. The second question defines a text field called Title, and its default value is Default_title.
- To end the file, add the following line:
END PROBLEM DATA
- The whole file is as follows:
PROBLEM DATA
QUESTION: Unit_System#CB#(SI,CGS,User)
VALUE: SI
QUESTION: Title
VALUE: Default_title
END PROBLEM DATA
- The options defined in the .prb file can be managed in the Problem Data window (found in the Data menu) in the Preprocessing component of GiD.
Problem Data window in GiD Preprocessing
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Materials file (.mat)
Files with the extension .mat include the definition of different materials through their properties. These are base materials as they can be used as templates during the Preprocessing step for the creation of newer ones.
You can define as many materials as you wish, with a variable number of fields. None of the unused materials will be taken into consideration when writing the data input files for the solver. Alternatively, they can be useful for generating a materials library.
Conversely to the case of conditions, the same material can be assigned to different levels of geometrical entity (lines, surfaces or volumes) and can even be assigned directly to the mesh elements.
In a similar way to how a condition is defined, a material can be considered as a group of fields containing its name, its corresponding properties and their values.
The format of the file is as follows:
MATERIAL: material_name
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
...
QUESTION: field_name['#CB#'(...,optional_value_i,...)]
VALUE: default_field_value
END MATERIAL
MATERIAL: material_name
...
END MATERIAL
All the fields must be filled with words, where a word is considered as a string of characters without any blank spaces. The strings signaled between quotes are literal and the ones within brackets are optional. The interface is case-sensitive, so any uppercase letters must be maintained. The default_field_value entry and various optional_value_i entries can be alphanumeric, integers or real numbers, depending on their type.
Note: There are other options available to expand the capabilities of the Materials window (see Special fields).
PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Materials file (.mat)>Example: Creating the materials file
Here is an example of how to create a materials file, explained step by step:
- Create and edit the file (problem_type_name.mat in this example) inside the problem_type_name directory (where all your problem type files are located). As you can see, except for the extension, the names of the file and the directory are the same.
- Create the first material, which starts with the line:
...
MATERIAL: Air
QUESTION: Density
VALUE: 1.01
END MATERIAL
MATERIAL: AISI_4340_Steel
QUESTION: YOUNG_(Ex)
VALUE: 21E+9
QUESTION: SHEAR_MODUL
VALUE: 8.07E+9
QUESTION: POISSON_(NUXY)
VALUE: 0.3
QUESTION: ALPX
VALUE: 0.0000066
QUESTION: DENSITY_(DENS)
VALUE: 0.785
END MATERIAL
MATERIAL: Concrete
QUESTION: Density
VALUE: 2350
END MATERIAL
- The materials defined in the .mat file can be managed in the Materials window (found in the Data menu) in the Preprocessing component of GiD.
...
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
...
Options corresponding to books
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.
...
Example, when Some_check is 0 the next field Type is hidden.
QUESTION: Some_check#CB#(1,0)
VALUE: 0
DEPENDENCIES: (0,HIDE,Type,#CURRENT#)
DEPENDENCIES: (1,RESTORE,Type,#CURRENT#)
QUESTION: Type#CB#(OPTION_1,OPTION_2)
VALUE: OPTION_1
Example with titlestate:
...
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
- TKWIDGET: TkWidget
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.
...
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
...