mrgprasad / kanapy

Synthetic microstructure generator. Online documentation:
https://mrgprasad.github.io/kanapy/index.html
GNU Affero General Public License v3.0
20 stars 7 forks source link
ellipsoid-packing finite-element-analysis materials-science microstructure-generator

.. highlight:: shell

.. image:: https://joss.theoj.org/papers/10.21105/joss.01732/status.svg :target: https://doi.org/10.21105/joss.01732

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3662366.svg :target: https://doi.org/10.5281/zenodo.3662366

.. image:: https://img.shields.io/badge/Platform-Linux%2C%20MacOS%2C%20Windows-critical

.. image:: https://img.shields.io/travis/mrgprasad/kanapy.svg :target: https://travis-ci.org/mrgprasad/kanapy

.. image:: https://codecov.io/gh/mrgprasad/kanapy/branch/master/graph/badge.svg :target: https://codecov.io/gh/mrgprasad/kanapy

.. image:: https://img.shields.io/badge/License-GNU%20AGPLv3-blue :target: https://www.gnu.org/licenses/agpl-3.0.html

.. image:: https://img.shields.io/github/v/release/mrgprasad/kanapy

Kanapy is a python package for generating complex synthetic polycrystalline microstructures. The general implementation is done in Python with the performance critical part for the geometry module implemented in C++. The Python bindings for the code written in C++ are generated using the lightweight header-only library pybind11. The C++ part of the implementation utilizes the Eigen library for efficient linear algebra calculations. The texture module of Kanapy is implemented as MATLAB functions. It also utilizes several algorithms implemented in MTEX_ for texture analysis.

.. _Python: http://www.python.org .. _pybind11: https://pybind11.readthedocs.io/en/stable/ .. _Eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page .. _MATLAB: https://www.mathworks.com/products/matlab.html .. _MTEX: https://mtex-toolbox.github.io/

.. figure:: /docs/figs/Kanapy_graphical_abstract.png :align: center

Features

.. _Neper: http://neper.sourceforge.net/ .. _Abaqus: https://www.3ds.com/products-services/simulia/products/abaqus/

.. role:: bash(code) :language: bash

Installation

The preferred method to install kanapy is through Anaconda or Miniconda Python distributions. If you do not have any, we suggest installing miniconda_.

.. _miniconda: https://docs.conda.io/en/latest/miniconda.html

Once done, create a virtual environment for Kanapy installation and clone the repository to a desired location and install.

.. code-block:: console

$ conda create -y -n knpy python=3.6 pip git
$ conda activate knpy    
(knpy) $ git clone https://github.com/mrgprasad/kanapy.git <location to clone>/kanapy-master
(knpy) $ cd kanapy-master/
(knpy) $ conda install -y -c conda-forge --file requirements.txt    
(knpy) $ pip install -e .

Kanapy is now installed along with all its dependencies. If you intend to use Kanapy's texture module, link Kanapy with MATLAB and MTEX installations by running: :bash:kanapy setupTexture and follow the instructions.

.. _MATLAB: https://www.mathworks.com/products/matlab.html .. _MTEX: https://mtex-toolbox.github.io/

Running tests

Kanapy uses pytest to perform all its unit testing.

.. code-block:: console

(knpy) $ kanapy runTests          

Documentation build

Documentation for kanapy is generated using Sphinx. The HTML documentation can be found at ../kanapy-master/docs/builds/html/index.html

.. code-block:: console

(knpy) $ kanapy genDocs                    

Citation

The preferred way to cite Kanapy is:

.. code-block:: bibtex

@article{Prasad2019, doi = {10.21105/joss.01732}, url = {https://doi.org/10.21105/joss.01732}, year = {2019}, publisher = {The Open Journal}, volume = {4}, number = {43}, pages = {1732}, author = {Mahesh R.G. Prasad and Napat Vajragupta and Alexander Hartmaier}, title = {Kanapy: A Python package for generating complex synthetic polycrystalline microstructures}, journal = {Journal of Open Source Software} }

Related works and applications

License

Kanapy is made available under the GNU AGPLv3 license_.

.. _license: https://www.gnu.org/licenses/agpl-3.0.html

About

The name kanapy is derived from the sanskrit word káṇa_ meaning particle. Kanapy is primarily developed at the Interdisciplinary Center for Advanced Materials Simulation (ICAMS), Ruhr-University Bochum - Germany <http://www.icams.de/content/>__. Our goal is to build a complete synthetic microstructure generation tool for research and industry use.

.. _káṇa: https://en.wiktionary.org/wiki/%E0%A4%95%E0%A4%A3