AceGen

 

The Mathematica package AceGen is used for the automatic derivation of formulae needed in numerical procedures. Symbolic derivation of the characteristic quantities (e.g. gradients, tangent operators, sensitivity vectors,…) leads to exponential behavior of derived expressions, both in time and space. A new approach, implemented in AceGen, avoids this problem by combining several techniques: symbolic and algebraic capabilities of Mathematica, automatic differentiation technique, automatic code generation, simultaneous optimization of expressions and theorem proving by a stochastic evaluation of the expressions. The multi-language capabilities of AceGen can be used for a rapid prototyping of numerical procedures in script languages of general problem solving environments like Mathematica or Matlab© as well as to generate highly optimized and efficient compiled language codes in FORTRAN or C. Through a unique user interface the derived formulae can be explored and analyzed.

 

The AceGen package also provides a collection of prearranged modules for the automatic creation of the interface between the automatically generated code and the numerical environment where the code would be executed. The AceGen package directly supports several numerical environments such as: MathLink connection to Mathematica, AceFEM is a research finite element environment based on Mathematica, FEAP© is a research finite element environment written in FORTRAN, ELFEN© and ABAQUS© are the commercial finite element environments written in FORTRAN etc.. The multi-language and multi-environment capabilities of AceGen package enable generation of numerical codes for various numerical environments from the same symbolic description. The use of AceGen offers a general approach to symbolic description of direct and sensitivity analysis of the most important formulations that appear in description of problems by finite element method (steady state, transient, coupled and coupled transient problems). The AceGen package rejects the traditional assumption that transition from symbolic codes to type-compiled codes is impracticable and that the symbolically generated codes are intrinsically too slow for large-scale numerical computations.

 

Unique features found in the product

Simultaneous expression optimization

  • AceGen extends the use of Mathematica to problems where direct use of Mathematica leads to expression swell (e.g. nonlinear finite elements, gradients of complicated functions needed within optimization procedures, etc.). It rejects the traditional assumption that transition from symbolic codes to type-compiled codes is impracticable and that the symbolically generated codes are intrinsically too slow for large-scale numerical computations.
  • A new approach, implemented in AceGen, avoids the expression swell problem by combining several techniques: symbolic and algebraic capabilities of Mathematica, automatic differentiation technique, automatic code generation, simultaneous optimization of expressions and theorem proving by a stochastic evaluation of the expressions.
  • Optimization of expressions and generation of control structures (Do, If) is performed over multiple notebook cells. The appropriate intermediate variables are selected automatically.
  • AceGen is appropriate for large problems where also intermediate expressions can be subjected to the uncontrolled swell.

Enhanced automatic differentiation

  • AceGen includes the forward and backward mode of automatic differentiation technique with several unique enhancements with respect to the standard automatic differentiation (AD) technique.
  • AD procedure can be initiated at any time and at any point of derivation of the formulae and as many times as required.
  • The standard implementation of automatic differentiation as code-to-code translation is replaced by the method that consistently extends the current code rather than produces a new one.
  • For the reason of efficiency, the results of all previous uses of AD are accounted for when AD is used several times inside the same subroutine.
  • AceGen offers differentiation with respect to indexed variables.

Multi - language and multi - environment code generation

  • AceGen offers multi-language code generation (Fortran/Fortran90, C, Mathematica language, Matlab language) and automatic interface to general numerical environments (MathLink connection to Mathematica, Matlab) and specialized finite element environments (AceFEM, FEAP, ELFEN, ABAQUS, …)
  • Multi-language and multi-environment capability enables that once the problem is formulated in AceGen it can be directly exported to various commercial numerical environments. Practice shows that at the research stage of the derivation of a new numerical software, different languages and different platforms are the best means for the assessment of specific performances and, of course, failures of the numerical model. Using the classical approach, re-coding of the element in different languages would be extremely time consuming and is never done. With the AceGen concepts re-coding comes practically for free, since the code is automatically generated for several languages and for several platforms from the same basic symbolic description.

Code efficiency and portability

  • One of the advantages of the AceGen approach is also that the symbolic description of the numerical procedure is complete in a sense that almost no external pre-arranged subroutines are called from the generated code. No other data are accessed apart form those provided through the list of parameters of the user subroutine. Code, generated on these principles, is a bit longer than it would be if the reusable parts of the code were used. However, there are advantages of this approach in numerical efficiency, portability of the generated code to different operational systems and to different numerical environments and easy parallelization.
  • In many industrial sectors numerical simulations have become part of everyday practice. The development of new numerical models has therefore become an inseparable part of specific industrial projects and is no longer a long-term research task as it was the case previously. The use of AceGen offers on-demand generation of numerical procedures.

 

References or list of publications related to the product

  • KORELC, Jože, WRIGGERS, Peter. Automation of finite element methods. Switzerland: Springer, 2016. XXVI.  http://link.springer.com/book/10.1007%2F978-3-319-39005-5, doi: 10.1007/978-3-319-39005-5. http://www.springer.com/-/1/AVXo2wyFKEAfyFF0Zyqj
  • HUDOBIVNIK, Blaž, KORELC, Jože. Closed-form representation of matrix functions in the formulation of nonlinear material models. Finite Elements in Analysis and Design, 2016, 111:19-32
  • KORELC, Jože. Automation of primal and sensitivity analysis of transient coupled problems. Comput. mech., 2009,  44:631-649.
  • Korelc J., (2002), Multi-language and Multi-environment Generation of Nonlinear Finite Element Codes,  Engineering with Computers, 2002, vol. 18, n. 4,str. 312-327
  • Korelc, J. (1997), Automatic generation of finite-element code by simultaneous optimization of expressions, Theoretical Computer Science, 187, 231-248.
  • Korelc J. (1996), Symbolic Approach in Computational Mechanics and its Application to the Enhanced Strain Method, Doctoral Dissertation, Institut of Mechanics, TH Darmstadt, Germany.