Documentation for TensND

Symbolic and numerical tensor calculations in arbitrary coordinate systems.

Introduction

TensND.jl is a Julia package for tensor calculations of any order and dimension in arbitrary coordinate systems. It supports both symbolic computation (via SymPy and Symbolics.jl) and numerical evaluation (via ForwardDiff automatic differentiation).

Key features

  • Basis types: canonical, rotated, orthogonal, and fully general non-orthogonal bases
  • Tensor algebra: products, contractions, change of basis, variance (covariant/contravariant) management
  • Structured tensor types: isotropic (TensISO), transversely isotropic (TensWalpole, TensTI), orthotropic (TensOrtho) with compact parametric storage and efficient algebra
  • Symmetry projection: find the closest ISO, TI, or ORTHO tensor via Frobenius distance minimization; rotation-optimized via NLopt
  • Differential operators: gradient, symmetric gradient, divergence, Laplacian, Hessian in curvilinear coordinate systems (symbolic and numerical)
  • Generic type system: works with Float64, symbolic types (Sym, Num), and ForwardDiff.Dual numbers for automatic differentiation

The implementation is inspired by the Maple library Tens3d developed by Jean Garrigues.

Installation

The package can be installed with the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> add TensND

Or, equivalently, via the Pkg API:

julia> import Pkg; Pkg.add("TensND")

For rotation-optimized tensor projections, also install the optional dependency:

pkg> add NLopt

Manual outline

Tutorials

Citing TensND.jl

@misc{TensND.jl,
  author  = {Jean-François Barthélémy},
  title   = {TensND.jl},
  url     = {https://github.com/jfbarthelemy/TensND.jl},
  version = {v0.1.1},
  year    = {2021},
  month   = {8}
}

References

  1. Tens3d — Maple tensor library by Jean Garrigues
  2. Walpole basis decomposition — blog post by S. Brisard
  3. Hoenig, A. (1978). The behavior of a flat elliptical crack in an anisotropic elastic body. International Journal of Solids and Structures, 14, 925-934.