|
|
|||||
|
|
|||||
APREPRO Predefined Variables |
|||||
|
A few commonly used variables are predefined in APREPRO. These are listed below. The default output format is specified as a C language format string, see your C language documentation for more information. The default format and comment variables are defined with a leading underscore in their name so they can be redefined without generating an error message. |
|||||
|
Predefined Variables |
|||||
|
Name |
Value |
Description |
|||
|
PI |
3.14159265358979323846 |
p |
|||
|
PI_2 |
1.57079632679489661923 |
p/2 |
|||
|
SQRT2 |
1.41421356237309504880 |
|
|||
|
DEG |
57.2957795130823208768 |
180 /p degrees per radian |
|||
|
RAD |
0.01745329251994329576 |
p/180 radians per degree |
|||
|
E |
2.71828182845904523536 |
base of natural logarithm |
|||
|
GAMMA |
0.57721566490153286060 |
euler-mascheroni constant1 |
|||
|
PHI |
1.61803398874989484820 |
golden ratio ( |
|||
|
VERSION |
Varies, string value |
current version of CUBIT |
|||
|
_ FORMAT |
"%.10g" |
default output format |
|||
|
_C_ |
"#" |
default comment character |
|||
|
|
|||||
|
1The euler-mascheroni constant is defined as the limit of 1 + 1/2 + ... + 1/s - log(s) as s approaches infinity. |
|||||
|
Note that the output format is used to output both integers and floating point numbers. Therefore, it should use the %g format descriptor which will use either the decimal (%d), exponential (%e), or float (%f) format, whichever is shorter, with insignificant zeros suppressed. The table below illustrates the effect of different format specifications on the output of the variable PI and the value 1.0 . See the documentation of your C compiler for more information. For most cases, the default value is sufficient. |
|||||
|
Effect of Various Output Format Specifications |
|||||
|
Format |
PI Output |
1.0 Output |
|||
|
%.10g |
3.141592654 |
1 |
|||
|
%.10e |
3.1415926536e+00 |
1.0000000000e+00 |
|||
|
%.10f |
3.1415926536 |
1.0000000000 |
|||
|
%.10d |
1413754136 |
0000000000 |
|||
|
The comment character should be set to the character that the program which will read the processed file uses as a comment character. The default value of "$" is the comment character used by the SEACAS codes at Sandia National Laboratories. The -c command line option * automatically changes the value of the comment variable to match the character specified on the command line. |
|||||
|
|
|||||