Git Product home page Git Product logo

mfkiwl / kanapy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from icams/kanapy

0.0 1.0 0.0 247.02 MB

Kanapy is a python package for generating three-dimensional synthetic polycrystals based on characteristic microstructural features.

Home Page: https://icams.github.io/Kanapy/

License: GNU Affero General Public License v3.0

Shell 0.11% JavaScript 0.10% C++ 46.21% Python 2.79% C 1.37% Objective-C 0.01% Fortran 6.12% MATLAB 13.00% OpenEdge ABL 0.01% XSLT 0.12% M 0.01% CSS 0.07% TeX 0.14% Mercury 0.01% Cuda 0.60% Makefile 0.01% HTML 27.79% CMake 1.58%

kanapy's Introduction

image image image image

Kanapy is a python package for generating complex three-dimensional (3D) synthetic polycrystalline microstructures that are built based on statistical information about grain geometry, given as grain size distribution and aspect ratio of grains, and crystallographic texture, given in form of orientation distribution functions (ODF) and misorientation distribution functions (MDF). Kanapy offers tools to analyze the geometry and texture of microstructures given by EBSD maps to generate 3D synthetic microstructures mimicking real ones in a statistical sense. 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 using several algorithms implemented in MTEX for texture analysis.

Features

  • Kanapy is used through a Command Line Interface (CLI).
  • Possibility to analyze experimental microstructures based on MTEX functions.
  • Generation of microstructure geometry based on statistical features as grain size distribution and grain aspect ratio distribution.
  • Crystallographic texture reconstruction using orientations from experimental data in form of Orientation Distribution Function (ODF).
  • Optimal orientation assignment based on measured Misorientation Distribution Function (MDF) that maintains correct statistical description of high-angle or low-angle grain boundary characteristics.
  • Independent execution of individual modules through easy data storage and handling.
  • In-built hexahedral mesh generator for complex polycrystalline microstructures.
  • Efficient generation of space filling structures by particle dynamics method.
  • Collision handling of particles through a two-layer collision detection method employing the Octree spatial data structure and the bounding sphere hierarchy.
  • Flexibility in the choice of the particle packing time step to be sent for voxelization (meshing).
  • Option to generate spherical particle position- and radius files that can be read by the Voronoi tessellation software Neper.
  • Option to generate input files for the commercial finite-element software Abaqus.
  • High-performance for the critical part of the geometry code using Python-C++ bindings.

Installation

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

Note, that you also need "cmake" and a C++ compiler, as g++, installed on your system, and the system paths set properly.

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

$ git clone https://github.com/ICAMS/Kanapy.git ./kanapy
$ cd kanapy
$ conda env create -f environment.yml
$ conda activate knpy
(knpy) $ pip install -e .

Kanapy is now installed along with all its dependencies. If you intend to use Kanapy's texture module, a MATLAB installation is required because the texture module is based on MTEX functions. If MATLAB is available on your system, the texture module is initialized by the command

(knpy) $ kanapy setupTexture

Running tests

Kanapy uses pytest to perform all its unit testing.

(knpy) $ kanapy runTests          

Documentation

Open kanapy/docs/index.html in a browser to access the complete documentation for kanapy.

The documentation is also available online on GitHub Pages: https://icams.github.io/Kanapy/

The documentation for kanapy is generated using Sphinx. You can create or update your local documentation with the command

(knpy) $ kanapy genDocs                    

The updated HTML documentation can then be found at kanapy/docs/builds/html.

Dependencies

For Linux/Mac OS, Kanapy requires a working C/C++ compiler on your machine. The gcc toolchain will work well. For Windows, Kanapy is installed as a pre-built distribution (.whl file). In either case, the lightweight header-only library pybind11 is used to create Python bindings for the code written in C++. The C++ function will be complied by linking the Eigen library (present in the directory kanapy/libs/). CMake builds this extension.

Kanapy's texture module requires MATLAB to be installed on your machine. Make sure to use MATLAB v2015a and above. The module uses a local version of MTEX contained in kanapy/libs and does not interfere with other installations of MTEX.

Core dependencies

Below are the listed dependencies for running kanapy:

  • NumPy for array manipulation.
  • Scipy for functionalities like Convexhull.
  • pybind11 for creating python bindings for C++ code.
  • Eigen for C++ linear algebra operations.
  • pytest for running kanapy unit tests.
  • sphinx for generating documentation.
  • MATLAB for texture module.
  • MTEX for texture module.

Optional dependencies

  • Matplotlib for plotting and visualizing.
  • OVITO for visualizing simulation data.

Citation

The preferred way to cite Kanapy is:

@article{Biswas2020,
  doi = {10.5281/zenodo.3662366},
  url = {https://doi.org/10.5281/zenodo.3662366},
  author = {Abhishek Biswas and Mahesh R.G. Prasad and Napat Vajragupta and Alexander Hartmaier},
  title = {Kanapy: Synthetic polycrystalline microstructure generator with geometry and texture},
  journal = {Zenodo},
  year = {2020}
}

Related works and applications

  • Prasad et al., (2019). Kanapy: A Python package for generating complex synthetic polycrystalline microstructures. Journal of Open Source Software, 4(43), 1732. https://doi.org/10.21105/joss.01732
  • Biswas, Abhishek, R.G. Prasad, Mahesh, Vajragupta, Napat, & Hartmaier, Alexander. (2020, February 11). Kanapy: Synthetic polycrystalline microstructure generator with geometry and texture (Version v2.0.0). Zenodo. http://doi.org/10.5281/zenodo.3662366
  • Biswas, A., Prasad, M.R.G., Vajragupta, N., ul Hassan, H., Brenne, F., Niendorf, T. and Hartmaier, A. (2019), Influence of Microstructural Features on the Strain Hardening Behavior of Additively Manufactured Metallic Components. Adv. Eng. Mater., 21: 1900275. http://doi.org/10.1002/adem.201900275
  • Biswas, A., Vajragupta, N., Hielscher, R. & Hartmaier, A. (2020). J. Appl. Cryst. 53, 178-187. https://doi.org/10.1107/S1600576719017138
  • Biswas, A., Prasad, M.R.G., Vajragupta, N., Kostka, A., Niendorf, T. and Hartmaier, A. (2020), Effect of Grain Statistics on Micromechanical Modeling: The Example of Additively Manufactured Materials Examined by Electron Backscatter Diffraction. Adv. Eng. Mater., 22: 1901416. http://doi.org/10.1002/adem.201901416
  • R.G. Prasad, M., Biswas, A., Geenen, K., Amin, W., Gao, S., Lian, J., Röttger, A., Vajragupta, N. and Hartmaier, A. (2020), Influence of Pore Characteristics on Anisotropic Mechanical Behavior of Laser Powder Bed Fusion--Manufactured Metal by Micromechanical Modeling. Adv. Eng. Mater., https://doi.org/10.1002/adem.202000641

License

Kanapy is made available under the GNU AGPLv3 license.

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. Our goal is to build a complete synthetic microstructure generation tool for research and industry use.

Authors

Mahesh R.G Prasad, Abhishek Biswas, Golsa Tolooei Eshlaghi, Napat Vajragupta, Alexander Hartmaier
ICAMS / Ruhr-Universität Bochum, Germany

Disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

kanapy's People

Contributors

ahartmaier avatar arfon avatar bilawal51 avatar biswas1984 avatar golsatolooeieshlaghi avatar grld avatar jan-janssen avatar mrgprasad avatar toloogt2 avatar

Watchers

 avatar

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.