Projection onto a symmetry class
<!– crosslinks: written by .github/scripts/crosslinks.py from docs/crosslinks.toml; do not edit –>
<!– /crosslinks –>
Given an arbitrary tensor, find the closest one having a prescribed material symmetry — and, if the orientation is unknown, find that too. This page states the problem, derives the closed forms TensND uses at fixed orientation, and describes the optimizer used when the orientation is free.
Implementation: src/tens_projection.jl and, for the orientation search, src/orientation_search.jl. The formulation follows the one of the Echoes C++ library; the general theory of closest tensors of prescribed symmetry is due to Moakher and Norris (2006), and the harmonic-decomposition alternative to Browaeys and Chevrot (2004).
The problem
Let
so project returns the triple
| Returned | Meaning |
|---|---|
| the projected tensor, in the storage type of the class | |
| absolute distance | |
| relative distance |
Because the Kelvin–Mandel map is an isometry (Kelvin–Mandel representation), the whole computation is done on
Fixed orientation: the normal equations
Write a basis
In general this is an TensND never performs one is that in the bases it uses, the Gram matrix is diagonal.
Transverse isotropy
The major-symmetric TI subspace is spanned by the symmetrized Walpole basis ``\mathbb{W}^s=(\mathbb{W}_1,\ \mathbb{W}_2,\ \mathbb{W}_3+\mathbb{W}_4, MarkdownAST.LineBreak()
\mathbb{W}_5,\ \mathbb{W}_6)``, whose Gram matrix is (The Walpole basis)
Each coefficient is therefore an independent quotient,
gives the closed forms implemented in _project_TI_KM:
Every one of them is a plain average of the entries the corresponding
Orthotropy
Same argument with the nine orthotropic generators, which are likewise mutually orthogonal. The projection at fixed frame simply keeps the block-diagonal part and symmetrizes (_project_ORTHO_KM):
everything outside the two blocks being discarded. For an order-2 tensor the same reasoning reduces to keep the diagonal in the material frame.
Cubic symmetry
The cleanest case of all, because the three generators are not merely mutually orthogonal but are projectors summing to the identity. The normal equations degenerate into three traces (_project_CUBIC_KM):
the divisors being the traces of the projectors themselves. Concretely,
At order 2 there is nothing to do: the octahedral group leaves no second-order tensor invariant but a multiple of the identity, so the cubic projection is the isotropic one. See Cubic symmetry.
With a free orientation the treatment is the orthotropic one unchanged: the cube orientation is an ordinary rotation, so the objective
Isotropy
The two-dimensional case, already given in Isotropic tensors:
Free orientation
When the axis or frame is unknown,
with
Condensing out the linear part
For a given
This is literally what _obj_TI4 and _obj_ORTHO4 compute: rotate, project, compare norms. Maximizing the norm of the projection is minimizing the distance, and only two or three angles remain —
Differentiating the normal equations shows that the gradient needs no derivative of
In practice TensND obtains this gradient by automatic differentiation (ForwardDiff through the objective), which is exact to machine precision and removes any risk of the analytic expression drifting from the code.
The search
When the orientation is free, project searches it, with no dependency beyond ForwardDiff:
the objective is screened on a fixed, quasi-uniform set of orientations: 200 axes spread over a hemisphere along a golden-angle spiral for the TI axis; 100 such axes, each with four turns about it, for an orthotropic or a cubic frame — a quarter turn about an axis of the frame maps it onto an equivalent one. An evaluation costs about a third of a microsecond;
Newton's method on the angles refines the three (TI) or four (frames) best screened orientations, the eigenstructure candidate (
_candidate_TI_axis,_candidate_ORTHO_frame— exact whenever the tensor genuinely has the symmetry sought; there is none for the cubic class, every second-order contraction of a cubic tensor being isotropic) and the canonical orientation. The Hessian is exact (ForwardDiff, a or matrix), so the refinement converges quadratically near a minimum; away from one, each eigen-direction is scaled by the absolute value of its curvature and a backtracking line search keeps the objective decreasing;the best objective over every refined orientation is kept.
Three properties follow:
reproducibility — no random step, so repeated calls return bit-identical angles;
no regression — the result is never worse than the projection about any refined orientation, the eigenstructure candidate and the canonical one included;
globality, as measured — on 150 random anisotropic stiffnesses, the minimum found matched, to rounding, that of a dense search (3,000 axes; 7,200 frames, the best of each refined), which a multi-start from a dozen fixed points missed for about one TI tensor in twenty. The test suite repeats the comparison on random tensors.
At order 2 no search is needed. In the frame of the eigenvectors of the symmetric part of
Detecting the symmetry: the cascade
best_sym_tens tries the classes from the most restrictive to the least and returns the first whose relative error falls below a tolerance
The chain is ordered by number of constants — 2, 3, 5, 9 — and not by inclusion, because it cannot be:
The relative criterion is what makes the tolerance dimensionless and independent of the units of the moduli. Two modes:
optimize_angles | TI axis / ORTHO frame / CUBIC frame |
|---|---|
false (default) | taken from the tensor if it is a structured container, otherwise from the Kelvin–Mandel eigenstructure |
true | found by the search above |
The value-level predicates isisotropic, istransverselyisotropic, isorthotropic, iscubic are the same computation with a boolean answer.
Projection is not averaging
Two different operations are easily confused, and only one of them is on this page.
| Projection (this page) | Group average | |
|---|---|---|
| definition | closest element of the subspace | |
| result | best fit in the class | exact invariant part |
| target space | major-symmetric subspace (5 or 9 parameters) | full commutant (8 parameters for TI) |
| discards | everything orthogonal to the subspace | nothing invariant |
For a major-symmetric input the two coincide. For an input that is not major-symmetric — a strain-concentration tensor, typically — they differ: the average preserves the
The choice of distance
Everything above minimizes the Euclidean (Frobenius) distance. That choice is not neutral: it is not invariant under inversion, so projecting a stiffness and projecting its compliance give different materials (Isotropic tensors). Distances that repair this — log-Euclidean, power-Euclidean, arctan-Euclidean — are constructed by Morin et al. (2020). TensND implements the Euclidean one only, so a reported projection should always state which of