Introductory Tutorial for APDL-Mode
Introduction
Introducing APDL-Mode – an APDL Environment
This project supports your APDL workflows with the FEA suite Ansys.
It provides an editor mode for GNU Emacs for investigating and coding APDL. The mode offers also managing and communication capabilities for various Ansys processes, like interactive code debugging with the solver or inquiring the license manager status, etc. Some features are quite sophisticated but its documentation is accessible for Ansys users with little APDL and Emacs experience.
GNU-Emacs is a modern, powerful and extensible - yet free - editor. High quality software available for every operating system where Ansys is running.
Installation
Install GNU-Emacs and APDL-Mode
There are no costs and restrictions even in commercial application. Please install GNU Emacs then APDL-Mode from Melpa or download an archive from the APDL-Mode's releases page.
Install APDL-Mode in Emacs: Please type: M-x
package-install-file <RET>
and select the downloaded tar archive.
Usage
Open an Emacs Buffer under APDL-Mode
Start the editor and open doc/example.mac or any other APDL file
(with the extensions mac, ans, inp, dat or anf, otherwise
type M-x apdl
and <RET>).
In the following M-x or C-c means typing <ALT> or <CTRL> key together with the `x' or `c' key.
Explore the APDL-Mode Menus
Browsing the APDL help with C-c C-b is much faster than searching with the Ansys Help Viewer or online.
Selected APDL-Mode Features
Easily Inspect WorkBench Solver Files (doc/example.dat)
APDL-Mode hides the normally uninteresting but usually very large number blocks. On the right hand side is the unhidden content. If APDL-Mode is not yet configured for .dat files please type:
M-x apdl-mode
Check Your Cursor Position in the Argument List
For commands with a large number of arguments it is cumbersome to count the arguments, M-h facilitates this for you and visualises dynamically at which argument position the cursor is.
Select and Insert Templates from the Menu into Your Code
Screenshot with the Ansys Classics GUI on the left and Emacs on the right on Win64
Preview the Extensible APDL Code Templates
Before inserting an entire template you are able to inspect its content in a preview window (C-c C-s) and might just copy the most relevant snippets, please see below and next slide.
Select an Interesting Template from a Completion Window
Type C-c C-s to choose a template name, use the <TAB> key to complete or to open the completion window of available items.
Check Auto-Insertion and Outline Your Code (Tree View)
Create a new APDL file with the suffix .mac and let Emacs auto-insert a skeleton with `outline' headings. Collapse and cycle through "tree views" with <SHIFT>+<TAB> (Emacs 28).
Utilise completions of all (~2000) APDL symbols
Move the cursor behind a character - here `c' - or word fragment and type <ESC> <TAB> or C-M-i for completing up to date APDL command-, element- and function names.
Open a Summary Window of Your APDL Variables
Type C-c C-v to receive a summary window of all your variable definitions. With an argument (C-u C-c C-v) you will get the current value of your variable at the cursor (Linux only, right).
Structure Your Variable Assignments
Move the cursor to a variable definition paragraph or mark, here in yellow, some definitions and type C-c C-a to align them.
Use the Emacs Integrated, Programmable RPN Calculator
Type C-x * *
to open the calculator, type y
for pasting results
directly into the APDL file. And q
to quit the `Calc' windows.
Display the License Status and Preview Images
In Emacs' lower-half you see the license status (C-c C-l). All described features can be executed through the APDL-Mode menu or with keyboard shortcuts.
Debug Your Code Interactively with the Solver (GNU-Linux)
You can run the Ansys solver under Emacs and send code lines from above APDL window with C-c C-j (C-c C-c for whole regions) directly to this process. Below you see the interactive solver output and on the left hand side the corresponding Ansys images.
Arrange the APDL-Mode Windows to Your Needs
The image shows an Emacs 23.2 frame (in reversed colour mode and compiled with the GTK+ toolkit under GNU-Linux) with a ripped off APDL-Mode menu field
Configuration
Configure User Options and System Dependent Aspects
Please check the mode settings with Emacs' customisation system (no programming necessary) use the menu and
Documentation and Licensing
Get to Know Emacs and Its Excellent Documentation
Newcomers to Emacs should take the guided online tour to get a background of its capabilities and fire up the interactive tutorial (C-h t) which is translated to various languages.
\href{https://www.gnu.org/software/emacs/tour/}{% \includegraphics[width=5cm]{./tour_of_Emacs.png}% }
Use the APDL-Mode Built-in Help
Please type C-c C-h for the mode manual (there is also a brief introduction of basic Emacs concepts) and C-h m, especially for APDL-Mode's keybindings.
You Might Read Further APDL-Mode Documentation
- Licensing and costs:
- This is free and open software, there are no costs and effectively no restrictions for you using Emacs and APDL-Mode - even - commerically. Both are under the GPL, the Gnu Puplic License copied in the LICENSE.org file.
- Configuration:
- More detailed instructions might be necessary if you are not using default Ansys installations. Please have a look in the INSTALLATION.org file. The online documentation is at APDL-Modes's documentation site.
- Hands-on tutorial and reference:
- You will find these in-depth documentation included in the mode's archives on GitHub's releases page or read online.
- News and project history:
- They are placed in the mode's accompanying NEWS.org file
Help and Bugs
Search for Help, Report Bugs and Issues
Besides the documentation, have a look in the GitHub's issues site or send an email to the maintainer. Please use the APDL-Mode bug report functionality, which might provide helpful status information.
Summary
Use APDL-Mode Appropriate to Your Needs
- The relevance of APDL remains: `WorkBench' and `AIM' operate exclusively the Ansys solver with it! For a true understanding the study of APDL is prerequisite. Furthermore, code APDL only for repetitive tasks or WB/AIM snippets.
Navigating in WB solver input files, discerning relevant information through highlighting, quickly analysing APDL commands with the built-in help or pin-pointing the reference help in a browser.
Specific shortcut keybindings, outlining, code templates, completions, auto-indentation, abbreviations, auto-insertion.
Solver communication/feedback - hybrid between coding and debugging (GNU-Linux only), retrieving license states, error file viewing, abort file handling, extending APDL templates, …