Skip to content

Expression functions

Knut Morten Okstad edited this page Jun 4, 2019 · 3 revisions

Expression functions

IFEM allows for specification of boundary conditions, analytic solutions and numerous other properties as symbolic expressions. This page is an overview of the available symbols.

Available variables

  • x - The x-coordinate in evaluation point
  • y - The y-coordinate in evaluation point
  • z - The z-coordinate in evaluation point
  • t - The physical time t

Available mathematical functions

  • sqrt(x)
  • sin(x), cos(x), tan(x)
  • asin(x), acos(x), atan(x), atan2(y,x)
  • sinh(x), cosh(x), tanh(x)
  • log(x)
  • ln(x)
  • exp(x)
  • logn(x,n)
  • ceil(x)
  • floor(x)
  • deg(x) - convert from radians to degrees
  • rad(x) - convert from degrees to radians
  • pow(x,n)

Available commonly used constants

  • PI - The value of π
  • E - The base e of the natural logarithm

Available logical constructs

  • if(condition,iftrue,iffalse)
  • clip(value,lowbound,upperbound)
  • clamp(value,lowerclamp,upperclamp)

These can be used in combination with

The available conditions

  • and(x,y)
  • or(x,y)
  • not(x)
  • equal(x,y) - (x=y)
  • above(x,y) - (x > y)
  • below(x,y) - (x < y)

Vector functions

For vectorial functions, separate the components using a '|' character