The GNU-Emacs major mode for the programming language APDL
Copyright (C) 2006 - 2020 H. Dieter Wilhelm, GPL V3
APDL (ANSYS Parametric Design Language) is the solver scripting language of the FEA (Finite Element Analysis) suite ANSYS (ANalysis SYStem, registered TM).
APDL-Mode (formerly ANSYS-Mode) is - in conjunction with the GNU-Emacs editor - an advanced APDL environment with features like, pin-pointing the APDL reference documentation, keyword completion, code templates, dedicated highlighting, solver communication (GNU-Linux only), license reporting, etc. Over the years it has accumulated lots of features for writing and debugging FEA complete models in APDL code. Please convince yourself with the APDL-Mode in-depth documentation.
With the advent of the modern ANSYS GUIs - like `WorkBench’ or `AIM’ - the usage of APDL as a wholesale modelling language has diminished for non automated tasks. But APDL is here to stay: `WorkBench’ and `AIM’ operate exclusively the ANSYS solver with it! They are producing and sending APDL input (.dat) files to the solver. For a true understanding of the GUIs’ inner workings a study of their APDL code is prerequisite! Moreover, the GUIs are not supporting all solver features. So “Command (APDL)” snippets are used to enhance the GUIs’ modelling capabilities.
Nowadays I find APDL-Mode mostly useful for studying solver (.dat) files which were created by WorkBench. Likewise for writing WorkBench `Command’ snippets and inspecting longer snippets from other sources. Accessing swiftly the ANSYS APDL reference documentation alone is worth using APDL-Mode!
When you “Export” or “Import” such a WorkBench Command (APDL) object it becomes associated with a file and thus is also editable with a third party editor.
When you are now editing the file the “File Status” in Workbench changes and you can pull-in the updated content with the “Refresh” button.
Especially for commands with a large number of arguments it is cumbersome to count the arguments, C-? facilitates this for you and visualises dynamically at which parameter position your cursor currently is.
You can trigger (C-c C-b) the relevant ANSYS manual entry directly from your APDL-Mode session without the detour of searching in the ANSYS Help Viewer or waiting for the ANSYS online help. This works not only for APDL commands but also element names and other manual topics. (To that end you must have installed the local ANSYS documentation and configured APDL-Mode.) The topics are shown in a web browser.
The image below is showing a manual entry in GNU-Emacs’s EWW browser. You are able to consult the manual side-by-side with your APDL code.
APDL-Mode hides the normally uninteresting but usually very large number blocks.
The image below shows the unhidden content.
The image shows GNU-Emacs with a ripped off APDL-Mode menu field, the APDL variable buffer, the APDL file itself and an APDL template preview. You are able to collect your most often used command snippets into Emacs’ template system and have them available immediately.
- Install GNU-Emacs (if you are new to this editor please check the tutorial in its `Help’ menu, please really do it ;-). You should use at least Emacs version 25.1.
- Download APDL-Mode’s tar package from the Github release page.
- Install the package in Emacs: Please type `M-x
package-install-file <RET>’ and select the downloaded tar file.
That’s it.
Hint: If you are getting an error message “package.el is not yet initialized”, you are using Emacs’ packaging system for the very first time and it is necessary to initialise this machinery first, please type: `M-: (package-initialize) <RET>’ and then apply `M-x package-install-file <RET>’ again.
Please type `M-x apdl’ which opens a buffer in APDL-Mode and you can inspect the menu bar’s `APDL’ and `ANSYS’ entries. Please select `Describe APDL-Mode’ (or type `C-h m’), which will display the mode’s help with further guidance.
You might also check the introductory APDL-Mode tutorial (A-M_introductory_tutorial.org) as well.
The complete documentation of APDL-Mode is available online
Please read the file apdl-config.org and adjust the acompanying example file apdl-config.el.
Please have a look into the NEWS file
The GPL 3, please read the LICENSE file
Acknowledgements to Tim Read and Geoff Foster for their ansys-mod.el from 1997 which triggered the idea in 2006 to start apdl-mode.
Parts of APDL-Mode were base on octave-mod.el: Copyright (C) 1997 Free Software Foundation, Inc. Author: Kurt Hornik Author: John Eaton
- Emacs Stackexchange, the question and answer site.
- EmacsWiki, an encyclopedia for GNU-Emacs
- The ANSYS APDL plug-in from the Ansys store, published in 2017 (and not maintained since then?)
- Simple APDL syntax highlighting extensions are available for various editors, gvim, nedit, … to name a few, please have a look at ANSYS.net.
- A commercial competitor of apdl-mode: The Pedal script editor for Windows, project disbanded in 2015.
- A free Windows APDL editor, site not maintained since 2011
- The ANSYS reference manuals
- The ANSYS homepage with the ANSYS Portal and Learning Hub
- Xansys, an ANSYS online community (forum registration is necessary)
- The PADT Focus site.
- A general ANSYS repository ANSYS.net
- AUC, the ANSYS User Club eV. in Germany
Please read the TODO file