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, lines, surfaces, volumes or layers, and what kind of entity they will be transferred over, i.e. over nodes, over face elements or over body elements.

Note: For backwards compatibility, the command over elements is also accepted; this will transfer the condition either to elements or to faces of higher level elements.

Another important feature is that all the conditions can be applied to different entities with different values for all the defined intervals of the problem.

Therefore, a condition can be considered as a group of fields containing the name of the particular condition, the geometric entity over which it is applied, the mesh entity over which it will be transferred, its corresponding properties and their values.

The format of the file is as follows:

CONDITION: condition_name

CONDTYPE: 'over' ('points', 'lines', 'surfaces', 'volumes', 'layer')

CONDMESHTYPE: 'over' ('nodes', 'face elements','face elements multiple', 'body elements')

QUESTION: field_name['#CB#'(...,optional_value_i,...)]

VALUE: default_field_value

...

QUESTION: field_name['#CB#'(...,optional_value_i,...)]

VALUE: default_field_value

END CONDITION

CONDITION: condition_name

...

END CONDITION

Note: #CB# means Combo Box.

Note that this file format does not allow you to put blank lines between the last line of a condition definition, END CONDITION, and the first one of the next condition definition.

Local Axes

QUESTION: field_name['#LA#'('global', 'automatic', 'automatic alternative')]

VALUE: default_field_value

This type of field refers to the local axes system to be used. The position of the values indicates the kind of local axes .

If it only has a single default value, this will be the name of the global axes. If two values are given, the second one will reference a system that will be computed automatically for every node and will depend on geometric constraints, like whether or not it is tangent, orthogonal, etc. If a third value is given, it will be the name of the automatic alternative axes, which are the automatic axes rotated 90 degrees.

All the different user-defined systems will automatically be added to these default possibilities.

To enter only a specific kind of local axes it is possible to use the modifiers #G#,#A#,#L#.

When using these modifiers the position of the values does not indicate the kind of local axes.

Example

QUESTION: Local_Axes#LA#(Option automatic#A#,Option automatic_alt#L#)

VALUE: -Automatic-

Note: 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 reals. GiD treats them as alphanumeric until the moment they are written to the solver input files.

Global axes:

X=1 0 0

Y=0 1 0

Z=0 0 1

Automatic axes :

For surfaces, this axes are calculated from the unitary normal N:

z'=N

if N is coincident with the global Y direction (Nx or Nz > some tolerance) then

x'=Y x N / |Y x N|

else

x'=Z x N / |Z x N|

y'=N x x'

z'=N

For lines, this axes are calculated from the unitary tangent T:

x'=T

if T is coincident with the global Z direction (Nx or Ny > some tolerance) then

y'=Y x x' / |Y x x'|

else

y'=Z x x' / |Z x x'|

z'=x' x y'

Automatic alternative axes:

They are calculated like the automatic case and then swap x and y axes:

x''= y'

y''= - x'

z''= z'

For curves

x'=unitary tangent to the curve on the place where the condition is applied

If this tangent is different of the Z global axe=(0,0,1) then

y'=Y x x'

else

y'=Z x x'

z'=x' x y'

Note: the tangent x' is considered different of (0,0,1) is the first or second component is greater than 1/64

One flag that can optionally be added to a condition is:

CANREPEAT: yes

It is written after CONDMESHTYPE and means that one condition can be assigned to the same entity several times.

Self Calculated #FUNC# fields:

Another type of field that can be included inside a condition is a #FUNC# to do some calculation,

where the key #FUNC#, means that the value of this field will be calculated just when the mesh is generated. It can be considered as a function that evaluates when meshing.

Valid variables for a #FUNC# field are:

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 ).

Example: Creating the conditions file

Here is an example of how to create a conditions file, explained step by step:

  1. First, you have to create the folder or directory where all the problem type files are located, problem_type_name.gid in this case.
  1. 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.
  1. Create the first condition, which starts with the line:

CONDITION: Point-Constraints

The parameter is the name of the condition. A unique condition name is required for this conditions file.

  1. This first line is followed by the next pair:

CONDTYPE: over points

CONDMESHTYPE: over nodes

which declare what entity the condition is going to be applied over. The first line, CONDTYPE:... refers to the geometry, and may take as parameters the sentences "over points", "over lines", "over surfaces" or "over volumes".

The second line refers to the type of condition applied to the mesh, once generated. GiD does not force you to provide this second parameter, but if it is present, the treatment and evaluation of the problem will be more acurate. The available parameters for this statement are "over nodes" and "over elements".

  1. Next, you have to declare a set of questions and values applied to this condition.

QUESTION: Local-Axes#LA#(-GLOBAL-)

VALUE: -GLOBAL-

QUESTION: X-Force

VALUE: 0.0

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

VALUE: 1

QUESTION: X_axis:#CB#(DEFORMATION_XX,DEFORMATION_XY,DEFORMATION_XZ)

VALUE: DEFORMATION_XX

END CONDITION

After the QUESTION: prompt, you have the choice of putting the following kinds of word:

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.

  1. 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 Preprocessing, showing an unfolded Combo Box