Skip to content

Easy-to-use Python package for the conversion between various matrix representations of second-order and fourth-order tensors

License

Notifications You must be signed in to change notification settings

tianyikillua/tensorconvert

Repository files navigation

Conversion between tensor representations

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub Code style: black Documentation

This package provides an easy-to-use API to represent symbolic second-order and fourth-order tensors. Various representations frequently used in physics are provided and conversion between them can be obtained.

Compared to mechkit, the scope of this package is not limited to continuum mechanics since these representations can be used for other domains.

The API is inspired from scipy.spatial.transform.Rotation:

  • Representing an existing tensor is performed by as_... methods.
  • Initializing from a representation uses from_... methods.

Thanks to the Fluent API, as_... methods can be applied directly after from_... methods. For example, to convert a fourth-order tensor represented by Mandel notation to Voigt notation, we can do

FourthOrderTensor(...).from_mandel(...).to_voigt()

Installation

sympy is a strong dependency of this package since all tensor representations are sympy objects.

The package is still being developed. You can use pip to install the current main version.

pip install -U git+https://github.com/tianyikillua/tensorconvert.git@main

Documentation

Refer to the documentation for the API and the examples using tensorconvert.

About

Easy-to-use Python package for the conversion between various matrix representations of second-order and fourth-order tensors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages