User sub routines (Groovy) : What is that ?


User sub routines allow to extend the scope of application of Flux.

They provide the opportunity to define new physical properties (sources, materials,…) based on settings chosen by user.

Thus, user is able to model non-standard physical phenomena.

Type of customizable entities

User sub routines allow to customize three type of entities in Flux:

  • I/O parameters, using the file “ PhysicalParameter.groovy

  • non-hysteretic properties of materials, using the file “ MaterialLaw.groovy

  • hysteretic properties of materials, using the file “ HysteresysMaterialLaw.groovy


User sub routines are written in Groovy. This is the name of an object oriented programming language intended to the Java platform.

Groovy uses a Java-like syntax and is directly compiled into bytecode by a Java compiler.

As this bytecode is the same used by Java, Groovy is entirely compatible with the JVM and so it can:

  • use the Java library
  • be used into Java classes

For futher informations, the reader can visit the official web site: /

Templates and Groovy examples

Once Flux is installed:

  • templates of Groovy files are stocked by default in the directory:

    C:\Program Files\Altair\2018.0\Flux_2018.0\Resources\UserFunction\Template

  • three examples using Groovy files into Flux projects are available in the directory:

    C:\Program Files\Altair\2018.0\Flux_2018.0\Resources\UserFunction\Examples