Page 1 of 1

Problem with functions in data tree

Posted: Fri Aug 23, 2019 12:21 am
by dsvivass
Hi,
I'm trying to use functions in my problem type, but they don't work, even using the example of the customization manual, it is supposed to appear like this
Captura de Pantalla 2019-08-22 a la(s) 18.00.40.png
Captura de Pantalla 2019-08-22 a la(s) 18.00.40.png (23.47 KiB) Viewed 15723 times
But data tree shows this,
Captura de Pantalla 2019-08-22 a la(s) 18.00.25.png
Captura de Pantalla 2019-08-22 a la(s) 18.00.25.png (53.79 KiB) Viewed 15723 times
This is the code as it is in the text. in the .spd file

<value n="dens" pn="Density" min_two_pnts="1" help="Density of Steel" unit_magnitude="M/L^3" units="kg/m^3" function="[density_function]" function_func="" v="1.0">
<function>
<functionVariable n="interpolator_func" pn="Interpolation function" variable="x" units="°C">
<value n="point" pn="Point" v="20.0,7830.0"/>
<value n="point" pn="Point" v="600.0,7644.0"/>
</functionVariable>
</function>
</value>

<procs>
<proc n='density_function' args='args'>
<![CDATA[
MyDensityFunction $domNode $args
]]>
</proc>
</procs>

In the .tcl file

proc MyDensityFunction { domNode args } {
set result [join [list scalar
  • ] ,]
    return $result
    }