Skip to main content
https://img.shields.io/pypi/v/ansys-mapdl-core.svg https://dev.azure.com/pyansys/pyansys/_apis/build/status/pyansys.pymapdl?branchName=master https://zenodo.org/badge/70696039.svg

Documentation and Issues

See the Documentation page for more details, and the Examples gallery for some examples.

Please feel free to post issues and other questions at PyMAPDL Issues. This is the best place to post questions and code.

Project Transition - Legacy Support

This project was formerly known as pyansys, and we’d like to thank all the early adopters, contributors, and users who submitted issues, gave feedback, and contributed code through the years. The pyansys project has been taken up Ansys and will be leveraged in creating new Pythonic, cross-platform, and multi-language service based interfaces for Ansys’s products. Your contributions to pyansys has shaped it into a better solution.

The pyansys project is expanding beyond just MAPDL, and while there are many new features and changes to the original Python module, many steps have been taken to ensure compatibility with legacy code while supporting new features. The original python module has been split up into the following projects and modules:

Please visit the GitHub pages for further details regarding each project.

Installation

The ansys-mapdl-core package currently supports Python 3.6 through Python 3.8 on Windows, Mac OS, and Linux.

Install the latest release from PyPi with:

pip install ansys-mapdl-core

Alternatively, install the latest from PyMAPDL GitHub via:

pip install git+https://github.com/pyansys/pymapdl.git

For a local “development” version, install with:

git clone https://github.com/pyansys/pymapdl.git
cd mapdl
pip install -e .

Dependencies

You will need a local licenced copy of ANSYS to run MAPDL prior and including 2021R1. If you have the latest version of 2021R1, you can connect to a remote instance of MAPDL and do not need MAPDL installed locally and can connect to a remote instance via gRPC.

Getting Started

Launch MAPDL Locally

You can launch MAPDL locally directly from Python using launch_mapdl:

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()

This automatically searches for the latest local version of MAPDL, launches it as a background process, and immediately connects to it. You can then start sending python commands to MAPDL.

Launching Manually or Connecting to a Remote Instance

If you wish to connect to a session of MAPDL on a remote computer (either locally the LAN or through the internet), first ensure you have MAPDL started in gRPC server mode. This example assumes you will be launching an instance locally from Windows, but can be easily adapted to run from Linux, or the LAN provided the necessary ports are open. This example specifies the port with -port 50052, but this option can be left out if you plan on using the default port 50052.

start "MAPDL" "%ANSYS211_DIR%\bin\winx64\ANSYS211.exe" -port 50052 -grpc

Next, connect to the instance of MAPDL from python with:

>>> from ansys.mapdl.core import Mapdl
>>> ip = '127.0.0.1'
>>> mapdl = Mapdl(ip=ip, port=50052, request_instance=False)
>>> print(mapdl)

A successful connection returns:

Product:             ANSYS Mechanical Enterprise
MAPDL Version:       RELEASE  2020 R2           BUILD 20.2TEST  UPDATE 20200601
ansys.mapdl.core Version: 0.57.0

Should you wish to connect to this instance of MAPDL from a remote computer, you substitute ip= with the LAN or WAN address of the computer you wish to connect to. Depending on your network settings, you may have to open local ports or enable port redirection across the WAN.

Basic Usage

You run MAPDL commands via:

mapdl.run('/PREP7')

Nearly all the built-in MAPDL commands have an associated pythonic method mapped to it. For example, /PREP7 is:

mapdl.prep7()

There are also non-mapdl commands such as mapdl.eplot which plot elements using vtk and pyvista rather than relying on MAPDL’s graphics server. Another is mapdl.vget, which leverages gRPC to rapidly exchange binary arrays from MAPDL to Python rather than relying on file IO to exchange data.

Additionally, there are the post_processing, geometry, and mesh properties, which you can use to perform remote (or local) post processing without result file exchange, display geometry properties, or view mesh statistics. Additionally, there’s the parameters property which shows the active MAPDL parameters, and you can use to send or receive arrays between MAPDL and Python.

See the full documentation at PyMAPDL Documentation for more details.

Run on Docker

Run MAPDL within a container on any OS with docker!

See MAPDL on Docker README for details regarding using MAPDL within a container.

Citing this Module

If you use PyMAPDL for research and would like to cite the module and source, you can visit pyansys Zenodo and generate the correct citation. For example, the BibTex citation is:

@software{alexander_kaszynski_2020_4009467,
  author       = {Alexander Kaszynski},
  title        = {{pyansys: Python Interface to MAPDL and Associated
                   Binary and ASCII Files}},
  month        = aug,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {0.43.2},
  doi          = {10.5281/zenodo.4009467},
  url          = {https://doi.org/10.5281/zenodo.4009467}
}

Please visit the link above for the most recent citation as the citation here may not be current.

License and Acknowledgments

PyMAPDL is licensed under the MIT license.

This module, ansys-mapdl-core makes no commercial claim over Ansys whatsoever. This tool extends the functionality of MAPDL by adding a Python interface to the MAPDL service without changing the core behavior or license of the original software. The use of the interactive APDL control of PyMAPDL requires a legally licensed local copy of Ansys.

To get a copy of Ansys, please visit Ansys.

Release files for ansys-mapdl-core 0.59.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansys-mapdl-core 0.59.0
File Size Uploaded
ansys-mapdl-core-0.59.0.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ansys-mapdl-core 0.59.0
File Interpreter ABI Platform
ansys_mapdl_core-0.59.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / ansys-mapdl-core-0.59.0.tar.gz

Download URL ansys-mapdl-core-0.59.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
efb0554558b59c6923665139123fc70a87700d76aa2cd40b90ba8207a11e223a
BLAKE2b-256 checksum
How to use checksums
8643edb480521807bbecdad8191f5609aada4c69a04e8a08e2ff1ee3b7fa420d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

Release files / ansys_mapdl_core-0.59.0-py3-none-any.whl

Download URL ansys_mapdl_core-0.59.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
25822621f3e6e7638f2110fb966bfd782a901a7efe355289766b664ecb796c89
BLAKE2b-256 checksum
How to use checksums
98c9a2b6c01c72cf4dc2ea411efb41572920f6bf3503736ba92dec0ce71bdf87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

Release history Release notifications | RSS feed

0.74.1

2 release files

0.74.0

2 release files

0.73.0

2 release files

0.72.0

2 release files

0.71.3

2 release files

0.71.2

2 release files

0.71.1

2 release files

0.71.0

2 release files

0.70.2

2 release files

0.70.1

2 release files

0.69.3

2 release files

0.69.2

2 release files

0.68.6

2 release files

0.68.4

2 release files

0.68.3

2 release files

0.68.2

2 release files

0.68.0

2 release files

0.67.0

2 release files

0.66.0

2 release files

0.65.1

2 release files

0.64.0

2 release files

0.63.3

2 release files

0.63.0

2 release files

0.62.2

2 release files

0.62.0

2 release files

0.61.6

2 release files

0.61.5

2 release files

0.61.3

2 release files

0.61.2

2 release files

0.61.1

2 release files

0.61.0

2 release files

0.60.5

1 release file

0.60.4

1 release file

0.60.3

1 release file

0.60.2

1 release file

0.60.1

1 release file

0.60.0

1 release file

0.59.5

2 release files

0.59.4

2 release files

0.59.3

2 release files

0.59.2

2 release files

0.59.1

2 release files

This release

0.59.0 This release

2 release files

0.58.8

2 release files

0.58.6

1 release file

0.58.4

2 release files

0.58.3

2 release files

0.58.2

2 release files

0.58.0

2 release files

0.57.6

2 release files

0.57.5

2 release files

0.57.4

2 release files

0.57.3

2 release files

0.57.2

2 release files

0.57.1

2 release files

0.57.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page