image accueil du logo de la rubrique
You are here : Typhon CFD Solver » CFD Tools » Maths » Symbolic functions

Symbolic functions

D 28 April 2011    


A set of modules and routines aims at defining and computing symbolic expressions.

Available operators

Available binary operators are + - * / ^

Available unary operators are

  • inv
  • sqr, sqrt
  • ln, log
  • sin, cos, tan, asin, acos, atan
  • sinh, cosh, tanh
  • abs, step, ramp

How to use in fortran routines

1. define a fortran symbolic function

use FCT_NODE
type(st_fct_node) :: fctnode

2. parse a string to a symbolic function

use FCT_PARSER
character(len=100) :: str
integer :: info
str="sqrt(X*X+Y*Y)"
call convert_to_funct(str, fctnode, info)

3. define variables in FCT environment

use FCT_ENV
type(st_fct_env) :: env
call new_fct_env(env)
call fct_env_set_real(env, "X", 2.)
call fct_env_set_real(env, "Y", 3.)

4. compute symbolic functions using environment values

use FCT_EVAL
real :: result
call fct_eval_real(env, fctnode, result)

Search