**function#
Description#
This command modifies nodal positions according to the given function. These functions are as described in the chapter on functions and scripting. Function transforms can be applied to the whole structure (default), to nset(s), and to the nodes of an elset or elsets.
Syntax#
**function
\(~\,\) *func func(x,y,z);
\(~\,\) *xtrans func(x,y,z);
\(~\,\) *ytrans func(x,y,z);
\(~\,\) *ztrans func(x,y,z);
\(~\,\) *nset nset1 … nsetN
\(~\,\) *elset elset1 … elsetN
*funcused for function definitions which are henceforth available. One can use a “learn” command line option as well to specify an external file with function definitions.
Note
This command can be specified by a string starting with
*func, e.g.*function_defis used in some tests as shown in the example below.*xtrans *ytrans *ztransfunctions which specify a coordinate reassignment in \(x\), \(y\), or \(z\) directions. Note that these are absolute values (trans stands for transform, not translate), so an actual translation of 0.40 in the \(z\) direction would use
*ztrans z-0.40;*nsetspecify nset(s) for the function to be applied to.
*elsetspecify elset(s) for the function to be applied to.
Example#
The following are the function statements from the example $Z7PATH/test/Mesher_test/INP/func-xform.inp
**function
*elset pipe1
*function_def R:= 6.366197722 + z;
*function_def theta:=y/6.366197722;
*function_def Z:=R(z)*cos(theta(y))-6.366197722;
*function_def Y:=R(z)*sin(theta(y));
*ztrans Z(y,z);
*ytrans Y(y,z);
...
**function
*elset weld
*elset pipe2
*function_def f1:= (z>=1.0)*1.0 + (z<1.0)*(z>0.0)*z + (z<=0.0)*0.0;
*function_def f2:= (z>=0.2)*1.0 + (z<0.2)*(z>0.0)*(z*z/0.04);
*ztrans f1(z)*z + (1.-f1(z))*Z(y,z);
*ytrans f2(z)*y + (1.-f2(z))*Y(y,z);