Skip to content

ansys/pymaterials-manager

Repository files navigation

PyMaterials Manager

PyAnsys Python PyPI GH-CI Codecov MIT Black

PyMaterials Manager is a Python package for unifying material management across the Ansys portfolio.

PyMaterials Manager is currently a proof of concept, expect things to break. It currently provides the following features:

  • It defines a Material Object that can have different material models
  • The supported material models can be read from a running PyMAPDL instance
  • The supported material models can written to a running PyMAPDL / pyFluent instance
  • Some supported material models can be read from a MatML XML file
  • Some supported material models can be written to a MatML XML file

The following material models are supported:

  • pyMAPDL
    • Simple constant material properties
    • Piecewise linear material properties
    • Polynomial material properties
    • Anisotropic Elasticity
  • pyFluent
    • Simple constant material properties
    • Ideal Gas properties

Installation

Install the ansys-materials-manager package with this code:

pip install ansys-materials-manager

Alternatively, clone and install this package with this code:

git clone https://github.com/ansys/pymaterials-manager
cd pymaterials-manager
pip install .

Testing

This project uses uv for dependency management and pytest for testing.

Install development dependencies and run the unit test suite with:

uv sync
uv run pytest ./tests

To run only the MAPDL integration tests (requires a running MAPDL instance):

uv run pytest ./tests -m mapdl_integration -o addopts="--cov=ansys.materials --cov-report=term --cov-report=xml:.cov/xml"

Use pre-commit

The style checks take advantage of pre-commit. Developers are not forced but encouraged to install this tool by running this command:

python -m pip install pre-commit && pre-commit install

Every time you stage some changes and try to commit them, pre-commit only allows them to be committed if all defined hooks succeed.

Documentation and issues

For comprehensive information on PyMaterials Manager, see the latest release documentation. On the PyMaterials Manager Issues page, you can create issues to submit questions, report bugs, and request new features. This is the best place to post questions and code.

Distribution

To build source and wheel distributions:

uv build
uv run twine check dist/*

About

Python package to unify material management across the Ansys portfolio

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

5 watching

Forks

Packages

 
 
 

Contributors

Languages