Altair Feko  2021.1.1 Documentation
Altair Feko 2021.1.1 Documentation

  1. Home
  2. Scripts and Application Programming Interface (API)

    CADFEKO and POSTFEKO have a powerful, fast, lightweight scripting language integrated into the application allowing you to create models, get hold of simulation results and model configuration information as well as manipulation of data and automate repetitive tasks.

  3. Scripting Basics

    The scripting capability is powerful and help your work to be completed faster, but you first need to learn the basics of Lua and scripting in Feko.

  4. Lua Language Essentials

    Learn the basic Lua language concepts by viewing small extracts of executable Lua code.

  • Release Notes
  • Get Started
  • Examples
  • Introduction to Feko
  • CADFEKO
  • POSTFEKO
  • EDITFEKO
  • Feko Solution Methods
  • Optimisation in Feko
  • Feko Utilities
  • Description of the Output File of Feko
  • Feko Application Macros
  • Scripts and Application Programming Interface (API)
  • Appendix
Index
Altair Feko  2021.1.1 Documentation

Altair Feko 2021.1.1 Documentation
  • Release Notes

    See what's new in the latest release.

  • Get Started

    The Feko Getting Started Guide contains step-by-step instructions on how to get started with Feko.

  • Examples

    The Feko Example Guide contains a collection of examples that teaches you Feko concepts and essentials.

  • Introduction to Feko

    Feko is a comprehensive electromagnetic solver with multiple solution methods that is used for electromagnetic field analyses involving 3D objects of arbitrary shapes.

  • CADFEKO

    CADFEKO is used to create and mesh the geometry or model mesh, specify the solution settings and calculation requests in a graphical environment.

  • POSTFEKO

    POSTFEKO, the Feko post processor, is used to display the model (configuration and mesh), results on graphs and 3D views.

  • EDITFEKO

    EDITFEKO is used to construct advanced models (both the geometry and solution requirements) using a high-level scripting language which includes loops and conditional statements.

  • Feko Solution Methods

    One of the key features in Feko is that it includes a broad set of unique and hybridised solution methods. Effective use of Feko features requires an understanding of the available methods.

  • Optimisation in Feko

    Feko offers state-of-the-art optimisation engines based on generic algorithm (GA) and other methods, which can be used to automatically optimise the design and determine the optimum solution.

  • Feko Utilities

    The Feko utilities consist of PREFEKO, OPTFEKO, ADAPTFEKO, the Launcher utility, Updater and the crash reporter.

  • Description of the Output File of Feko

    Feko writes all the results to an ASCII output file .out as well as a binary output file .bof for usage by POSTFEKO. Use the .out file to obtain additional information about the solution.

  • Feko Application Macros

    A large collection of application macros are available for CADFEKO and POSTFEKO.

  • Scripts and Application Programming Interface (API)

    CADFEKO and POSTFEKO have a powerful, fast, lightweight scripting language integrated into the application allowing you to create models, get hold of simulation results and model configuration information as well as manipulation of data and automate repetitive tasks.

    • Introduction to Scripting and the API

      The scripting language that has been integrated with CADFEKO and POSTFEKO is called Lua. Lua has a syntax that is similar to Python and Matlab (or Octave) and is easy to learn and use.

    • Script Editor

      The script editor allows you to create scripts based on the Lua language to control CADFEKO, POSTFEKO and other applications as well as manipulation of data to be viewed and analysed further in POSTFEKO.

    • Macro Recording

      Use macro recording to record actions in a script. Play the script back to automate the process or view the script to learn the Lua-based scripting language by example. Macro recording allows you to perform repetitive actions faster and with less effort.

    • Scripting Basics

      The scripting capability is powerful and help your work to be completed faster, but you first need to learn the basics of Lua and scripting in Feko.

      • Lua Language Essentials

        Learn the basic Lua language concepts by viewing small extracts of executable Lua code.

        • Comments

          There are two methods to add a comment to Lua code.

        • Variable Assignments

          Variable assignments in Lua are case sensitive.

        • Strings

          Simple string assignment and concatenation can be performed directly in Lua. More advanced string manipulation is available using the string module (included as part of the Feko installation).

        • Boolean and Nil

          Variables can be assigned the boolean values, true or false. Boolean arithmetic can be performed on boolean values using not, and and or.

        • Tables

          Tables in Lua can be dictionaries or arrays.

        • IF Statement

          An if statement executes a block of code if a specified condition is true.

        • WHILE Loop

          A While loop performs a test at the beginning of every loop.

        • REPEAT Loops

          A repeat loop performs the test condition at the end of every loop and will execute at least one loop.

        • FOR Loops

          A For loop is used to iterate over a predefined set of numbers, iterate over the key and value pairs of a dictionary or the values of an array.

        • Functions

          A function is a group of statements that carry out a specific task (procedure) or a function can calculate and return values.

        • Batch Modification of API Objects

          Some API objects allow batch modification of properties. Objects that support batch modification will have a SetProperties method that accepts a dictionary (Lua table) of properties.

        • Default Lua Modules Included By Default

          A number of Lua modules are included by default.

        • Useful Lua Modules Not Included By Default

          The Feko installation also includes a number of modules that are not included by default with all Lua distributions, but are useful for many scripting applications

        • Global Keywords Recognised in the Lua Editor

          A selection of global keywords recognised in the Lua editor, as well as additional functionality are highlighted.

        • API Scripts that Run In Both CADFEKO and POSTFEKO

          Scripts can be written such that they work both in CADFEKO and POSTFEKO.

        • External Lua Modules

          External Lua modules can be installed and included in the Lua search path.

    • Script Types

      There are two types of scripts that are supported in Feko, API scripts and result scripts. POSTFEKO supports both types of scripts, while CADFEKO only supports API scripts. It is important to use the correct script type in POSTFEKO to ensure that the desired result is achieved.

    • Custom Dialogs (Forms)

      During the execution of an automation script, custom dialogs can be used that allows the script to be more interactive. When used in conjunction with the custom command library, it is possible to extend the user interface for a variety of custom workflows.

    • Application Macros

      An application macro is a reference to an automation script, an icon file and associated metadata.

    • Application Macro Library

      The application macro library allows commonly used application macros to be stored in a repository.

  • Appendix

    Reference information is provided in the appendix.

Altair Feko  2021.1.1 Documentation
Altair Feko 2021.1.1 Documentation

  1. Home
  2. Scripts and Application Programming Interface (API)

    CADFEKO and POSTFEKO have a powerful, fast, lightweight scripting language integrated into the application allowing you to create models, get hold of simulation results and model configuration information as well as manipulation of data and automate repetitive tasks.

  3. Scripting Basics

    The scripting capability is powerful and help your work to be completed faster, but you first need to learn the basics of Lua and scripting in Feko.

  4. Lua Language Essentials

    Learn the basic Lua language concepts by viewing small extracts of executable Lua code.

  • Release Notes
  • Get Started
  • Examples
  • Introduction to Feko
  • CADFEKO
  • POSTFEKO
  • EDITFEKO
  • Feko Solution Methods
  • Optimisation in Feko
  • Feko Utilities
  • Description of the Output File of Feko
  • Feko Application Macros
  • Scripts and Application Programming Interface (API)
  • Appendix
Index

Lua Language Essentials

Learn the basic Lua language concepts by viewing small extracts of executable Lua code.

These examples should not be considered an exhaustive description of the Lua language, but rather as a very basic introduction.

View the following resource for more information:
  • Lua 5.1 Reference Manual1
  • Programming in Lua2
  • Lua-users wiki3
1 http://www.lua.org/manual/5.1/
2 http://www.lua.org/pil/
3 http://lua-users.org/wiki/
  • Comments
    There are two methods to add a comment to Lua code.
  • Variable Assignments
    Variable assignments in Lua are case sensitive.
  • Strings
    Simple string assignment and concatenation can be performed directly in Lua. More advanced string manipulation is available using the string module (included as part of the Feko installation).
  • Boolean and Nil
    Variables can be assigned the boolean values, true or false. Boolean arithmetic can be performed on boolean values using not, and and or.
  • Tables
    Tables in Lua can be dictionaries or arrays.
  • IF Statement
    An if statement executes a block of code if a specified condition is true.
  • WHILE Loop
    A While loop performs a test at the beginning of every loop.
  • REPEAT Loops
    A repeat loop performs the test condition at the end of every loop and will execute at least one loop.
  • FOR Loops
    A For loop is used to iterate over a predefined set of numbers, iterate over the key and value pairs of a dictionary or the values of an array.
  • Functions
    A function is a group of statements that carry out a specific task (procedure) or a function can calculate and return values.
  • Batch Modification of API Objects
    Some API objects allow batch modification of properties. Objects that support batch modification will have a SetProperties method that accepts a dictionary (Lua table) of properties.
  • Default Lua Modules Included By Default
    A number of Lua modules are included by default.
  • Useful Lua Modules Not Included By Default
    The Feko installation also includes a number of modules that are not included by default with all Lua distributions, but are useful for many scripting applications
  • Global Keywords Recognised in the Lua Editor
    A selection of global keywords recognised in the Lua editor, as well as additional functionality are highlighted.
  • API Scripts that Run In Both CADFEKO and POSTFEKO
    Scripts can be written such that they work both in CADFEKO and POSTFEKO.
  • External Lua Modules
    External Lua modules can be installed and included in the Lua search path.

(c) 2021. Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support