Git Product home page Git Product logo

apdl-mode's Introduction

Table of Contents

  1. Introduction
  2. Some Highlights
  3. Installation
  4. First Step
  5. Configuration and Customisation
  6. Bugs and Problems
  7. News
  8. Further Resources
  9. Acknowledgements
  10. Todos
  11. GNU GPL v3 License

The GNU-Emacs major mode for the scripting language APDL

APDL-Mode version 20.7.0

img img

Copyright (C) 2006 - 2021 H. Dieter Wilhelm, GPL V3

img

Introduction

APDL, Ansys Parametric Design Language is the solver scripting language of the mechanical FEA, Finite Element Analysis suite Ansys, ANalysis SYStem, registered TM.

APDL-Mode, is - in conjunction with the GNU-Emacs editor - an advanced APDL environment with features like, browsing the APDL reference documentation, keyword completion and abbreviations, code templates and code outlining / folding, dedicated highlighting, solver communication (GNU-Linux only), license reporting, etc. Please convince yourself in the APDL-Mode in-depth documentation.

With the advent of the modern Ansys GUIs - like `WorkBench' or `Discovery' - the usage of APDL as a wholesale modelling language has waned for highly variable tasks which are expensive to script. But, nevertheless, APDL is here to stay: `WorkBench' operates exclusively the Ansys solver with it! It assembles and sends APDL input (.dat) files to the solver. For a true understanding of the GUI's inner workings a study of their APDL code is prerequisite! Moreover, WorkBench is not supporting all MAPDL solver features. So "Command (APDL)" objects are used to enhance the GUI's modelling capabilities.

APDL-Mode is equally useful for studying solver (.dat) files which were created by WorkBench. And, especially, for writing WorkBench `Command' objects and inspecting longer command snippets from other sources. Accessing the Ansys APDL reference documentation without detour - this alone - is worth using APDL-Mode.

When you "Export" (or "Import") such a WorkBench "Command (APDL)" object, it becomes associated with a file on disk and is accessible for any kind of editor. If you modify this file, the "File Status" in Workbench changes and you can pull-in the updated content with the "Refresh" button.

img

Some Highlights

In-built APDL command help with argument counter

Especially for commands with a large number of arguments it is cumbersome to count the arguments, M-? facilitates this for you and visualises dynamically at which parameter position your cursor currently is.

img

Pin-pointing the relevant Ansys documentation

You can browse (with C-c C-b on a code line) the relevant Ansys manual entry directly without the detour of searching in the Ansys online help. This works not only for all APDL commands but also for element names and more general manual topics!

Since Ansys v191 the online help is the default. APDL-Mode is using your default browser but to be able to access the online help you must register or you must start the online help once from any licensed Ansys product. I recommend installing the local Ansys documentation, access time is much shorter. You can download the "help installer" from their Customer Portal.

The image below is showing a manual entry in GNU-Emacs' EWW browser. You are able to consult the manuals side-by-side your APDL code.

img

Please check the APDL-Mode configuration documentation on how to configure EWW as default browser or inspect the project's configuration example.

Command Object Templates and Code Highlighting Example

You are learning and also coding APDL best by example! APDL-Mode provides coding examples, here called templates, for the most often used subjects. Moreover you are able to compile your own WorkBench / Discovery AIM Command templates and have them all immediately available in APDL-Mode for inspection and inclusion.

APDL-Mode is helping you with code colourisation to distinguish valid commands, user variables, element names, comments, APDL functions and further subjects.

Below image shows GNU-Emacs with a ripped off APDL-Mode menu, the APDL variable buffer, the APDL file itself and an APDL template preview.

img

Code outlining for inspecting WorkBench solver (.dat) files

APDL-Mode hides the normally uninteresting but usually very large number blocks.

img

The image below shows the unhidden content.

img

Installation

Copyright (C) 2006 - 2021 H. Dieter Wilhelm, GPL V3

Please install the GNU-Emacs Editor first, for all functionality APDL-Mode requires version 25.1 (released in 2016) but its sources can be used with older versions (Emacs-24). If you are new to this editor please check its tutorial in the `Help' menu, or read at least the APDL-Mode introduction.

Melpa Installation

APDL-Mode is now available on the GNU-Emacs packages archive Melpa for Emacs version 25.1 or newer.

img img

Please add

(package-initialize)
(add-to-list 'package-archives
      '("melpa" . "https://melpa.org/packages/") t)

to your initialisation file. Activate this code (for example by restarting Emacs), then type `M-x install-package', answer the prompt with "apdl-mode" and conclude this command with .

(You might also install it with GNU-Emacs' package interface `M-x list-packages', find `apdl-mode', mark it with `i' and install it with `x'.)

If you prefer the stable package archive instead of the development versions, exchange above package source with

(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)

Manual Installation

If you are behind a corporate firewall and you are not able to install APDL-Mode from Emacs' package menu, you can download and install its package manually:

  • Download the latest APDL-Mode's tar package from Melpa or - for a released package - from the Github release page under Assets.
  • Install the package within Emacs: Please type `M-x package-install-file ' and select your downloaded tar file.

That's it.

Hint: If you are getting an error message "package.el is not yet initialised", you are using Emacs' packaging system for the first time. It is necessary to initialise this machinery once, please type: `M-: (package-initialize) ' (it's an 'ALT + :' colon!) and then apply `M-x package-install-file ' again.

Development and Source Code Installation

Please clone the APDL-Mode git archive in a directory of your choice:

git clone https://github.com/dieter-wilhelm/apdl-mode.git

or download the GitHub ZIP archive and add the following line

(require 'apdl-mode)

to your initialisation file (the source directory must be set in the `load-path' variable as well).

First Step

Please type `M-x apdl' which opens a buffer in APDL-Mode where you can inspect the menu bar's `APDL' and `MAPDL' entries. For existing APDL files please type `M-x apdl-mode' if the mode is not activated already, please see in 5, the section regarding preconfigured file suffixes.

For further guidance please select the APDL menu `APDL-Mode Documentation' (or type `C-c C-h') and `Describe APDL-Mode' (or type `C-h m') for the list of its keybindings. You might also check the introductory APDL-Mode tutorial.

Configuration and Customisation

Most functionality is working without user configuration for standard Ansys installations. APDL-Mode is intelligent enough to figure out installation dependent things. It chooses - by default - the highest installed Ansys MAPDL version on the system for interactions with Ansys executables (for example, starting an MAPDL batch run).

APDL-Mode's default configuration enables GNU-Emacs to open any files with suffixes ".mac", ".dat" and ".inp" in APDL mode (indicated by `APDL' in Emacs' status line), the programming mode for the APDL language.

Please consult the APDL-Mode configuration documentation for advanced options or check the accompanying configuration example.

Bugs and Problems

APDL-Mode was tested using Ansys v201 and v211 under Windows 10 and 11 with Emacs-29.1. Under GNU-Linux the mode was developed and checked under both Emacs-24.3 and Emacs-29.1

Feedback is always welcome. If you have issues while installing and running this mode or want to suggest improvements you have the following options:

  1. Write an email to the mode maintainer. Please trigger a bug report form from the APDL-Mode menu or by calling the function `apdl-submit-bug-report'. Even if you have not configured Emacs to send emails, please copy the content of the mail template for the maintainer.

  2. You might issue bug reports or feature requests at APDL-Mode's issues site

  3. And you can leave comments and hints at the APDL-Mode page of the Emacs Wiki.

News

For further news please have a look into the NEWS file.

Further Resources

If you want to read further details regarding the APDL scripting, GNU-Emacs and other APDL editors please read the RESOURCES file.

Acknowledgements

My acknowledgements to Tim Read and Geoff Foster for their ansys-mod.el from 1997 which triggered the idea to APDL-Mode in 2006.

Parts of APDL-Mode were based on octave-mod.el: Copyright (C) 1997 Free Software Foundation, Inc. Authors: Kurt Hornik and John Eaton.

I received, moreover, support and feedback from many individuals. Thank you very much to all of them and also to the wonderful people which are crafting

GNU-Emacs!

Todos

Please check the TODO file.

GNU GPL v3 License

The GNU General Public License version 3. There are no costs and no usage restrictions even in commercial application, please convince yourself with the LICENSE file.

apdl-mode's People

Contributors

conao3 avatar dieter-wilhelm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apdl-mode's Issues

Can't start ansys-mode due to error

I did the following:
1. Copied the four .el files to /home/igurin/Ansys/utility/ansys-mode/
2. Created a new file called start-ansys-mode.el in the same directory with the 
following contents:

(add-to-list 'load-path "/home/igurin/Ansys/utility/ansys-mode")
(add-to-list 'auto-mode-alist '("\\.mac\\'" . ansys-mode))
(add-to-list 'auto-mode-alist '("\\.dat\\'" . ansys-mode))
(add-to-list 'auto-mode-alist '("\\.inp\\'" . ansys-mode))
(autoload 'ansys-mode "ansys-mode" nil t)

3. Selected the entirety of start-ansys-mode.el and did (M-x eval-region RET)
4. Went to a short sample buffer in the same session and did (M-x ansys-mode 
RET)

I get the following in the minibuffer:
"Symbol's value as variable is void: insert-pair-alist"

System configuration:
ANSYS mode version 13.0.1
Emacs version 21.4.1
Red Hat Enterprise Linux version 5

Original issue reported on code.google.com by [email protected] on 22 Feb 2012 at 11:56

Readme.txt

Remove Readme.txt. Create README from ansys-mode100.el and makefile.


Original issue reported on code.google.com by [email protected] on 3 Dec 2006 at 7:19

long startup coused by wrong quatation mark

starting emacs take a long time if I add ansys-mode to my init.el file. It gives me the waring
.emacs.d/lisp/ANSYS-Mode/ansys-mode.el: (lamda (arg1 arg2) ...) quoted with ' rather than wth #'

this is my init.el:
;; Ansys-Mode
(add-to-list 'load-path "~/.emacs.d/lisp/ANSYS-Mode")
(require 'ansys-mode)
(add-to-list 'auto-mode-alist '("\\.inp$" . ansys-mode))
(add-to-list 'auto-mode-alist '("\\.dat$" . ansys-mode))
(add-to-list 'auto-mode-alist '("\\.mac$" . ansys-mode))

I'am using GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) under windows 7.
Inside ~/.emacs.d/lisp/ANSYS-Mode are the following el files:

  • ansys-keyword.el
  • ansys-mode.el
  • ansys-process.el
  • ansys-template.el

C-c,C-b failed for local help files with eww

I tried to open the apdl help documention, using"C-c C-b" with eww, but it failed to open it and reterned wrong file adress as

Loading http://file%3a%2f%2f%2fd%3a/Program%20Files/ANSYS%20Inc/v171/commonfiles/help/en-us/help/ans_elem/Hlp_C_MP.html...

I think this issue comes from that APDL-mode gives the wrong file path to eww. Because I tried to manually edit the address as

http://file:///d:/Program Files/ANSYS Inc/v171/commonfiles/help/en-us/help/ans_elem/Hlp_C_MP.html

and it worked out in the outside browser (MP command help is showed).

BTW, I am using ANSYS 17.1, which contains local help documention. And I'm sure I set the correct path, as

(setq apdl-ansys-help-path "D:/Program Files/ANSYS Inc/v171/commonfiles/help/en-us/help/")

For some reason, the characters '/ ' -> '%2f' ' : '->'%3a' ' ' ->'%20' , when the path is transfered to eww.

Following is the 'Bug Report'

====================================================================================
Emacs : GNU Emacs 29.1 (build 2, x86_64-w64-mingw32)
of 2023-08-02
Package: APDL-Mode

current state:

(setq
apdl-mode-version "20.7.0"
apdl-mode-update "2021-10-23"
apdl-mode-install-directory "c:/Users/Lee/AppData/Roaming/.emacs.d/elpa/apdl-mode-20211023.1831/"
apdl-initialised-flag t
apdl-current-ansys-version "v171"
apdl-is-unix-system-flag nil
apdl-parameter-help-duration "30"
apdl-hide-region-before-string "![ ... hidden"
apdl-hide-region-after-string " region ... ]"
apdl-hide-region-propertize-markers t
apdl-highlighting-level 2
apdl-dynamic-highlighting-flag t
apdl-indicate-empty-lines-flag nil
apdl-comment-padding " "
apdl-comment-add 1
apdl-code-comment-column 15
apdl-auto-indent-flag t
apdl-indent-comment-suffix ""
apdl-ruler-wide-flag nil
apdl-require-spaces-flag nil
apdl-blink-matching-block-flag t
apdl-blink-matching-delay 0.7
apdl-block-offset 2
apdl-outline-string "@"
apdl-mode-hook '(apdl-outline-minor-mode)
apdl-align-rules-list '((apdl-align-= (regexp . "\(\s-\)=")
(modes quote (apdl-mode)) (justify . t) (tab-stop))
(apdl-align-text-column
(regexp . "=\(\s-
[0-9]+\|\s-\)")
(modes quote (apdl-mode)) (justify . t) (tab-stop))
(apdl-align-comment
(regexp . "[0-9.)]+\(\s-
\)\!")
(modes quote (apdl-mode)) (tab-stop))
)
apdl-license-occur-regexp '("granta" "electronics" "spaceclaim" "cfd" "disc"
"aim_mp" "stba" "struct" "mpba" "ane3" "^ansys"
"anshpc" "^preppost" "mech_"
"[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")
apdl-job "file"
apdl-license-categories '("ansys" "struct" "ane3" "ansysds" "ane3fl"
"preppost")
apdl-license "preppost"
apdl-no-of-processors 3
apdl-blink-delay 0.3
apdl-blink-region-flag t
apdl-username "Lee"
apdl-ansys-install-directory "D:/Program Files/ANSYS Inc/v171"
apdl-ansys-program "D:/Program Files/ANSYS Inc/v171"
apdl-ansys-launcher "D:/Program Files/ANSYS Inc/v171/winx64/launcher"
apdl-ansys-wb "D:/Program Files/ANSYS Inc/v171/Framework/bin/Linux64/runwb2"
apdl-ansys-help-program "D:/Program Files/ANSYS Inc/v171/commonfiles/help/HelpViewer/AnsysHelpViewer.exe"
apdl-ansys-help-path "D:/Program Files/ANSYS Inc/v171/commonfiles/help/en-us/help/"
apdl-lmutil-program "D:/Program Files/ANSYS Inc/shared_files/licensing/linx64/lmutil"
apdl-license-file "ANSYSLI_NOFLEX=1"
apdl-ansysli-servers "ANSYSLI_NOFLEX=1"
apdl-wb-custom-template-directory "c:/Users/Lee/AppData/Roaming/.emacs.d/elpa/apdl-mode-20211023.1831/"
)

ansys-next-code-line

What steps will reproduce the problem?
1. M-n
2. C-n

What is the expected output? What do you see instead?

C-n skips into a wrong column

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 2 Dec 2006 at 10:33

Newly created parameter color does not update

Newly created parameter highlight does not work sometimes.

so the parameter color should change in order to distinguish itself with other words. when I was creating a new parameter, its color changes in its definition line. However, in the next line, I then type the same parameter name again. the color does not change until I reopen this document.

Desktop (please complete the following information):
windows 10, Emacs 27.1. I installed APDL-Mode from Melpa.

C-c,C-b shellExecute failed for local help files

Describe the bug
I installed the Ansys v211 and APDL-mode. I am trying to use the C-c C-b to look up definition of the command. however, it gave me : "ShellExecute failed: the system cannot find the file specified". Can you tell me how to fix this issue?

windows 10

Error in block regions

What steps will reproduce the problem?
1. Open a output file created in ANSYS Mechanical 
2.
3.

What is the expected output? What do you see instead?
The nblock and eblock regions are not closed

What version of the product are you using? On what operating system?
ANSYSv15.0.7 on Windows 8

Please provide any additional information below.
This is a recent issue, Used to work fine with 15.0 

For information about GNU Emacs and the GNU system, type C-h C-a.
Loading d:/Users/nish/.emacs.d/ansys-keyword.el (source)...done
Loading d:/Users/nish/.emacs.d/ansys-template.el (source)...done
Loading d:/Users/nish/.emacs.d/ansys-process.el (source)...done
(lambda (arg1 arg2) ...) quoted with ' rather than with #'

Original issue reported on code.google.com by [email protected] on 30 Sep 2014 at 4:49

Attachments:

Cannot access local help via Tramp with apdl-browse-ansys-help

Hi,

Thank you for this wonderful package. I've recently installed it from melpa and ran into a problem when trying to access the help functionality through the C-c C-b keybinding.
To give some context, I'm writing APDL on a linux server through tramp. I've set the Installation directory successfully and when I hit C-c C-b over a FINISH command, apdl-mode doesn't find the local html file and eww returns
url-file: File does not exist: file:////ssh:myname@myremote:/ansys_inc/v140/commonfiles/help/en-us/help/ans_cmd/Hlp_C_FINISH.html
I think the problem are the trailing forward (///) slashes that preced the ssh command, because the file Hlp_C_FINISH.html and its path exist/are correct. Thanks in advance for any help.

README


The resource http://www.ansyssolutions.com mentioned in README is invalid.

Original issue reported on code.google.com by [email protected] on 29 Mar 2011 at 5:54

stucking after input `/`

I met a problem that emacs stucks each time after typing /. How could I detect the real reason for this problem. Thank you for your response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.