Getting started
Brief description of the package
The package relies on the definition of
bases which can be of the following types (
Tdenotes the scalar type, subtype ofNumber)CanonicalBasis{dim,T}: fundamental canonical basis inRdimin which the metric tensor is the second-order identityRotatedBasis{dim,T}: orthonormal basis inRdimobtained by rotation of the canonical basis by means of one angle ifdim=2or three Euler angles ifdim=3, the metric tensor is again the second-order identityOrthogonalBasis{dim,T}: orthogonal basis inRdimobtained from a given orthonormal rotated basis by applying a scaling factor along each unit vector, the metric tensor is then diagonalBasis{dim,T}: arbitrary basis not entering the previous cases
tensors
- a tensor is determined by a set of data (array or synthetic parameters) corresponding to its
order, a basis and a tuple of variances - depending on the type of basis, the type of tensor can be
TensCanonical{order,dim,T,A},TensRotated{order,dim,T,A},TensOrthogonal{order,dim,T,A}orTens{order,dim,T,A}if the data are stored under the form of an array or aTensorobject (see Tensors.jl) TensISO{order,dim,T,N}: isotropic tensor stored as N scalar parameters (1 for order 2, 2 for order 4)TensWalpole{T,N}: transversely isotropic 4th-order tensor in the Walpole basis (N=5 for major-symmetric, N=6 for general case)TensTI{order,T,N}: transversely isotropic tensor (order 2 or 4)TensOrtho{T}: orthotropic 4th-order tensor with 9 elastic constants in a material frame- Projection functions
proj_tensandbest_sym_tensallow finding the closest tensor of a given symmetry class (ISO, TI, ORTHO) with or without rotation optimization (the latter requiresNLopt)
- a tensor is determined by a set of data (array or synthetic parameters) corresponding to its
coordinate systems
- Symbolic (
CoorSystemSym): a coordinate system contains all information required to perform differential operations on tensor fields: position vectorOMexpressed in the canonical basis, coordinate names, natural basis, normalized basis, Christoffel coefficients - Numerical (
CoorSystemNum): pointwise evaluation of differential operators via automatic differentiation (ForwardDiff), without requiring symbolic setup - Predefined systems are available for both: cartesian, polar, cylindrical, spherical and spheroidal. The user can also define custom systems
- Symbolic (
All types support generic scalar types (Sym, Num, Float64, ForwardDiff.Dual, ...) enabling seamless interoperability between symbolic computation and automatic differentiation.
Detailed manual
Before detailing explanations about the main features of TensND, it is worth recalling that the use of the libraries TensND and SymPy requires starting scripts by
julia> using TensND, SymPyFor numerical computations (without symbolic overhead), SymPy is not required:
julia> using TensNDThe detailed manual is decomposed into the following chapters
Tutorials
Several tutorials demonstrate advanced usage of TensND in various contexts: