You are on page 1of 27

ANSYS-Mode

for GNU Emacs, an introductory


Tutorial

H. Dieter Wilhelm1 July 19, 2012

dieter@duenenhof-wilhelm.de

1 / 25

GNU Emacs editor support for working with ANSYS FEA


This project supports your workows with the FEA (Finite Element Analysis) suite ANSYS (registered TM, ANalysis SYStem). It provides `ANSYS-Mode', an add-on to the GNU Emacs editor for investigating and coding APDL (Ansys Parametric Design Language) les. The mode oers 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 targeted for ANSYS users with little Emacs experience. GNU (Gnu's Not Unix) Emacs is an up-to-date, powerful and extensible - yet free - editor. High quality software available for every operating system where ANSYS is running. In the following C-c or M-c means typing the <CTRL> or <ALT> key together with the <c> key.
2 / 25

Download ANSYS-Mode together with the Emacs editor


Remarkably there are

no

costs and license restrictions also for commercial use

Most convenient is taking the pre-congured ANSYS-Mode in conjunction with the latest Emacs editor binary for Windows 32/64 bit from the Google Code download page.

3 / 25

Install ANSYS-Mode together with Emacs


Extract the former zip archive to an arbitrary location on your le system. Optionally you might install Emacs shortcut icons for the system tray with addpm.exe in Emacs' bin folder.

In this list runemacs.exe is the actual editor executable.


4 / 25

Open an APDL macro le with Emacs


Start the Emacs editor and open fontication.mac in the site-lisp folder (or any other APDL le with the extensions mac, inp, dat or anf. Otherwise additionally type M-x ansys-mode and <RET>).

5 / 25

Explore the ANSYS-Mode menu


Everything should work if ANSYS is installed in its default folder C:Program Files under Win64, otherwise you might congure system dependent stu, like opening the ANSYS help browser with C-c C-h. (All described features can be executed by the ANSYS-Mode menu or with keyboard shortcuts.)

6 / 25

Use the ANSYS-Mode APDL command help


Please type M-? (alternatively: C-c ?) on a code line and you will see the APDL command's description together with its parameter syntax. You can continue working, this temporary overlay (here in yellow) remains visible during your editing.

7 / 25

Select and insert templates from the menu into your code
Screenshot with the ANSYS Classics GUI (left) and Emacs (right) on Win64

8 / 25

Preview the extensible APDL code templates


Besides your regular APDL le you are able to inspect and insert interesting code snippets from a preview window (see below and next slide).

9 / 25

Take a short-cut to the code template preview


Type C-c C-s to select a template name, use the <TAB> key to complete or open a completion window of available subjects.

10 / 25

Check auto-insertion and outline your code (tree view)


Create an APDL le with the sux `.mac' and let Emacs auto-insert a skeleton with `outline' headings. Collapse the content to a tree view with C-c @ C-t and open all (C-c @ C-a) again.

11 / 25

Utilise completions of all APDL symbols (around 2000)


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.

12 / 25

Open a summary window of your APDL variables


Type C-c C-v to receive a summary window (see below) of all your variables denitions (also implicit) in the current APDL le.

13 / 25

Structure your variable assignments


Move the cursor to a variable denition paragraph or mark (here in yellow) some denitions and type C-c C-a to align them.

14 / 25

Use the Emacs integrated, programmable RPN calculator


Type C-x * * to open the calculator, type y for copying results directly into the APDL le. q to quit the `Emacs Calc' windows.

15 / 25

Debug your code interactively with the solver (Unix only)


You can run the ANSYS solver/interpreter under Emacs and send code lines from the APDL window (above) with C-c C-c directly to this process. Below you get an interactive solver output window and on the left hand side the corresponding ANSYS graphics.

16 / 25

Display the license status and graphics (also PDF) on UNIX


In Emacs' mid-section you see the license state (C-c C-l) and left Emacs window (below) a thumbnail view of images from a folder.

17 / 25

Arrange the ANSYS-Mode windows to your needs


The image shows an Emacs 23.2 frame (in reversed colour mode and compiled with the GTK+ toolkit under Linux) with a ripped o ANSYS menu eld

18 / 25

Congure system dependent aspects and user options


The mode comes pre-congured for a default installation of ANSYS 14.0 for Win64. If a functionality is missing please adjust either:
The well commented conguration le default.el

. . . and restart Emacs.

19 / 25

Congure system dependent aspects and user options


The mode comes pre-congured for a default installation of ANSYS 14.0 for Win64. If a functionality is missing please adjust either:
The well commented conguration le default.el Or change the settings with Emacs' customisation system

. . . and restart Emacs.

19 / 25

Get to know Emacs and check out its tutorial


Newcomers to Emacs should take the guided online tour to get a background of its capabilities and re up the interactive tutorial (C-h t) which is translated to various languages.

20 / 25

Use the ANSYS-Mode built-in documentation


Please type C-h m for the ANSYS-Mode help, especially for the usage and keybindings of this mode. In the beginning is also a brief introduction of basic Emacs concepts.

21 / 25

Read further ANSYS-Mode documentation


Hands-on APDL tutorial: You will nd this more in-depth tutorial included in the mode's archives on Google Code's download page or online. Installation: More detailed instructions are necessary if you are not using the mode bundled with Emacs for Windows. Please have a look in the README le. For an online version see the ANSYS-Mode page at the EmacsWiki. News and project history: They are placed in the mode's accompanying NEWS le Licensing and costs: This is free and open software, there are no costs and eectively no restrictions for you using Emacs and ANSYS-Mode also commerically. Both are under the GPL (Gnu Puplic License) described in the LICENSE le.
22 / 25

Search for help, report bugs and issues


Besides the documentation, have a look in the section `Issues and bug reports' at Google's Code site or email to the maintainer. Please use the ANSYS-Mode bug report functionality (C-c C-b), which might provide helpful status information.

23 / 25

Use ANSYS-Mode appropriate to your APDL needs


The relevance of APDL remains tall: `WorkBench' operates from the user, for a

exclusively

the ANSYS solver

with it! While for many applications WorkBench is taking over the code authoring part Write APDL only for

true understanding of this tool the study of APDL is still prerequisite. repetitive tasks and command snippets, extending WB.

Basic APDL viewer Navigating in input les, discerning relevant information through highlighting, analysing APDL commands with the built-in help. Earnest APDL editor Shortcut keybindings, outlining, code templates, completions, auto-indentation, abbreviations, auto-insertion. Advanced APDL environment Solver communication/feedback - hybrid between coding and debugging (UNIX only), retrieving license states, error le viewing, abort le handling, extending APDL templates, . . .
24 / 25

Last slide of the ANSYS-Mode tutorial


Hint for the curious:

25 / 25

Last slide of the ANSYS-Mode tutorial


Hint for the curious: Thank you for your time getting acquainted with ANSYS-Mode! Have fun. . .

25 / 25

You might also like