[Users] math expression evaluator in Cactus

jtao at cct.lsu.edu jtao at cct.lsu.edu
Thu Oct 12 15:24:35 CDT 2006


Hi,

Considering the following expression where a(x, t), b(x, t) and
c(x, t) are arbitrary functions of x and t.

         / 2         \           / 2         \
         |d          |           |d          |
a(x, t) |--- f(x, t)| + b(x, t) |--- f(x, t)| + c(x, t) = 0
         |  2        |           |  2        |
         \dt         /           \dx         /

A generic solver can be written to deal with this kind of equations.
The thorn gets the expressions of a(x, t), b(x, t) and c(x, t) from
a parameter file.

e.g.
...
coef_a = "(x^2)*exp(t)"
coef_b = "-ln(x/t)"
coef_a = "x*t"
...

A node tree will be built for each expression. coef_[a|b|c] can be
evaluated pointwisely in the code with the node tree.

A single expression can be used too if one defines the finite
difference operators in the code.

My thorn was later rewritten with libmatheval, a GNU project. I am not
sure if anyone has something similar or is interested in this. It will be
great to combine the efforts.

Ideas and suggestions ?

Regards,
Jian




More information about the Users mailing list