[Gmsh] Comparisons in MathEval

Mike B. mb78aa at yahoo.com
Mon Aug 17 03:32:12 CEST 2009


Hi All,

To make my last email clearer, is it possible to use comparisons inside MathEval to choose different characteristic lengths according to the test?. 

As a simple example, this would set use the lc1 characteristic length if the distance to node 1 is smaller than the distance to node 2, and would use lc2 otherwise. However, the MathEval reports an error (it does not accept the comparison operators <, <=, >, >=):

lc1 = 1;
lc2 = 10;

Field[ 1 ] = Attractor;
Field[ 1 ].NodesList = { 1 };

Field[ 1 ] = Attractor;

Field[ 1 ].NodesList = { 2 };


Field[ 3 ] = MathEval;

Field[ 3 ].F = Sprintf( " (F1<F2)*lc1 + (F1>=F2)*lc2 " );

Cheers and thanks,

Mike.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090816/2fe39514/attachment.html>