[Gmsh] Getting a .geo variable into a Field[1].F equation

Mark Starnes mark.starnes at fttech.co.uk
Fri Apr 27 17:06:56 CEST 2012


Awesome.  Thanks a lot!

Best regards,

Mark.


On Fri, Apr 27, 2012 at 08:30:29PM +0530, Praveen C wrote:
> Try
> 
> Field[1].F = Sprintf("%g + Sin(x)", a);
> 
> On Fri, Apr 27, 2012 at 8:22 PM, Mark Starnes <mark.starnes at fttech.co.uk>
> wrote:
> 
>     Hi everyone,
> 
>     Is there a way to reference a variable defined in
>     my geometry file in a Field[].F expression?
> 
>     For example,
> 
>     a = 4;
> 
>     Field[1] = MathEval;
>     Field[1].F = "a + Sin(x)";
> 
>     reports,
> 
>     Error  :  Error [mathex::parseatom()]: invalid token on expression
>     Error  :  a+Sin(x)
>     Error  :   ^
>     Error  :  Field 1: Invalid matheval expression "a+Sin(x)"
> 
>     when I try to mesh.  This is version: 2.4.2
> 
>     Thanks in advance,
> 
>     Mark.
> 
> 
>     --
>     Dr. Mark Starnes
>     Principal Physicist
>     FT Technologies
>     Church Lane
>     Teddington
>     TW11 8PA
> 
>     web:  www.fttech.co.uk
>     DDI:  0208 614 2730
> 
>     _______________________________________________
>     gmsh mailing list
>     gmsh at geuz.org
>     http://www.geuz.org/mailman/listinfo/gmsh
> 
> 

-- 
Dr. Mark Starnes
Principal Physicist
FT Technologies
Church Lane
Teddington
TW11 8PA

web:  www.fttech.co.uk
DDI:  0208 614 2730