General description

All the rules that apply to filename.bas files are also valid for other files with the .bas extension. Thus, everything in this section will refer explicitly to the file filename.bas. Any information written to this file, apart from the commands given, is reproduced exactly in the output file (the data input file for the numerical solver). The commands are words that begin with the character * . (If you want to write an asterisk in the file you should write ** .) The commands are inserted among the text to be literally translated. Every one of these commands returns one (see Single value return commands ) or multiple (see Multiple values return commands ) values obtained from the preprocessing component. Other commands mimic the traditional structures to do loops or conditionals (see Specific commands ). It is also possible to create variables to manage some data. Comparing it to a classic programming language, the main differences will be the following:

The arguments that appear in a command are written immediately after it and inside parenthesis. If there is more than one, they will be separated by commas. The parentheses might be inserted without any argument inside, which is useful for writing something just after the command without inserting any additonal spaces. The arguments can be real numbers or integers, meaning the word REAL or the word INT (both in upper- or lowercase) that the value to which it points has to be considered as real or integer, respectively. Other types of arguments are sometimes allowed, like the type of element, described by its name, in the command *set elem , or a chain of characters inserted between double quotes " for the C-instructions strcmp and strcasecmp. It is also sometimes possible to write the name of the field instead of its ordering number.

EXAMPLE:

Below is an example of what a .bas file can be. There are two commands (*nelem and *npoin ) which return the total number of elements and nodes of a project.

%%%% Problem Size %%%%

Number of Elements & Nodes:

*nelem *npoin

This .bas file will be converted into a project_name.dat file by GiD. The contents of the project_name.dat file could be something like this:

%%%% Problem Size %%%%

Number of Elements & Nodes:

5379 4678

(5379 being the number of elements of the project, and 4678 the number of nodes).