Documentation ¶
Overview ¶
tsr implements routines to conduct tensor operations
Index ¶
- Constants
- Variables
- func Add(u [][]float64, α float64, a [][]float64, β float64, b [][]float64)
- func Alloc2() (tensor [][]float64)
- func Alloc4() (tensor [][][][]float64)
- func AlmansiStrain(e, Fi [][]float64)
- func CauchyToPK1(P, σ, F, Fi [][]float64, J float64)
- func CauchyToPK2(S, σ, F, Fi [][]float64, J float64)
- func CheckEigenprojs(a []float64, tolP, tolS float64, ver bool) (λsorted []float64)
- func CheckEigenprojsDerivs(a []float64, tol float64, ver bool, zero float64)
- func Det(a [][]float64) float64
- func Dev(a [][]float64) (deva [][]float64)
- func GenInvs(L, n []float64, a float64) (p, q float64, err error)
- func GenInvsDeriv1(dpdL, dqdL []float64, L, n []float64, dndL [][]float64, a float64) (p, q float64, err error)
- func GenInvsDeriv2(d2pdLdL, d2qdLdL [][]float64, L, n, dpdL, dqdL []float64, p, q float64, ...)
- func GenTvec(t, L, n []float64)
- func GenTvecDeriv1(dtdL [][]float64, L, n []float64, dndL [][]float64)
- func GenTvecDeriv2(i, j, k int, L []float64, dndL [][]float64, d2ndLdL_ijk float64) (res float64)
- func GreenStrain(E, F [][]float64)
- func Inv(ai, a [][]float64) (det float64, err error)
- func L2O(σ1, σ2, σ3 float64) (σa, σb, σc float64)
- func L_strains(ε []float64) (εv, εd float64)
- func LeftCauchyGreenDef(b, F [][]float64)
- func LinStrain(ε, F [][]float64)
- func M2Phi(M float64, typ string) float64
- func M2T(mandel []float64, i, j int) (component float64)
- func M2TT(mandel [][]float64, i, j, k, l int) float64
- func M_Alloc2(ndim int) (a []float64)
- func M_Alloc4(ndim int) (A [][]float64)
- func M_AllocEigenprojs(ncp int) (P [][]float64)
- func M_CharInvs(a []float64) (I1, I2, I3 float64)
- func M_CharInvsAndDerivs(a []float64) (I1, I2, I3 float64, dI1da, dI2da, dI3da []float64)
- func M_Det(a []float64) float64
- func M_DetDeriv(d, a []float64)
- func M_Dev(a []float64) (s []float64)
- func M_Dot(c []float64, a, b []float64, nonsymTol float64) (err error)
- func M_Dy(a, b []float64) (c [][]float64)
- func M_DyAdd(c [][]float64, s float64, a, b []float64)
- func M_EigenProjsDerivAna(dPda [][][]float64, a, λ []float64, P [][]float64) (err error)
- func M_EigenProjsDerivAuto(dPda [][][]float64, a, λ []float64, P [][]float64) (err error)
- func M_EigenProjsDerivNum(dPda [][][]float64, a []float64, h float64) (err error)
- func M_EigenValsNum(λ, a []float64) (err error)
- func M_EigenValsProjsNum(P [][]float64, λ, a []float64) (err error)
- func M_EigenValsVecsNum(Q [][]float64, λ, a []float64) (err error)
- func M_Inv(ai, a []float64, tol float64) (det float64, err error)
- func M_InvDeriv(d [][]float64, ai []float64)
- func M_LodeDeriv1(dwdσ, σ, s []float64, p, q, w float64)
- func M_LodeDeriv2(d2wdσdσ [][]float64, dwdσ, σ, s []float64, p, q, w float64)
- func M_Norm(a []float64) float64
- func M_PrincValsNum(a []float64) (λ0, λ1, λ2 float64, err error)
- func M_Sq(b, a []float64)
- func M_SqDeriv(d [][]float64, a []float64)
- func M_Tr(a []float64) float64
- func M_Ts(Ts [][]float64, s []float64)
- func M_devε(e, ε []float64) (eno, εv, εd float64)
- func M_devσ(s, σ []float64) (sno, p, q float64)
- func M_oct(a []float64) (σa, σb, σc float64)
- func M_p(σ []float64) float64
- func M_pq_smp(σ []float64, a, b, β, ϵ float64) (p, q float64, err error)
- func M_pqw(a []float64) (p, q, w float64)
- func M_pqws(s, a []float64) (p, q, w float64)
- func M_pqθ(a []float64) (p, q, θ float64)
- func M_q(σ []float64) float64
- func M_w(a []float64) (w float64)
- func M_εd(ε []float64) float64
- func M_εv(ε []float64) float64
- func M_θ(a []float64) (θdeg float64)
- func Man2Ten(tensor [][]float64, mandel []float64)
- func Mmatch(c, φ float64, cone string) (M, qy0 float64)
- func O2L(σa, σb, σc float64) (σ1, σ2, σ3 float64)
- func O2Lmat() (L [][]float64)
- func PK1ToCauchy(σ, P, F, Fi [][]float64, J float64)
- func PK2ToCauchy(σ, S, F, Fi [][]float64, J float64)
- func PQW2O(p, q, w float64) (σa, σb, σc float64)
- func Phi2M(φ float64, typ string) float64
- func PlotOct(filename string, σcCte, rmin, rmax float64, nr, nα int, φ float64, F Cb_F_t, ...)
- func PlotRefOct(φ, σc float64, withExtCircle bool)
- func PlotRosette(r float64, full, ref bool, withtext bool, fsz float64)
- func PullBack(res, a, F, Fi [][]float64)
- func PullBackB(res, a, F, Fi [][]float64)
- func PushForward(res, a, F, Fi [][]float64)
- func PushForwardB(res, a, F, Fi [][]float64)
- func RightCauchyGreenDef(C, F [][]float64)
- func SMPderivs1(dpdL, dqdL, L []float64, a, b, β, ϵ float64) (p, q float64, err error)
- func SMPinvs(L []float64, a, b, β, ϵ float64) (p, q float64, err error)
- func SmpCalcμ(φ, a, b, β, ϵ float64) (μ float64)
- func SmpDerivs1(dndL [][]float64, dNdL, N, F, G []float64, L []float64, a, b, β, ϵ float64) (m float64)
- func SmpDerivs2(d2ndLdL [][][]float64, L []float64, a, b, β, ϵ, m float64, ...)
- func SmpDirector(N, L []float64, a, b, β, ϵ float64) (m float64)
- func SmpDirectorDeriv1(dNdL []float64, L []float64, a, b, β, ϵ float64)
- func SmpDirectorDeriv2(d2NdL2 []float64, L []float64, a, b, β, ϵ float64)
- func SmpNormDirectorDeriv1(dmdL []float64, m float64, N, dNdL []float64)
- func SmpNormDirectorDeriv2(d2mdLdL [][]float64, L []float64, a, b, β, ϵ, m float64, ...)
- func SmpUnitDirector(n []float64, m float64, N []float64)
- func SmpUnitDirectorDeriv1(dndL [][]float64, m float64, N, dNdL, dmdL []float64)
- func SmpUnitDirectorDeriv2(d2ndLdL [][][]float64, m float64, N, dNdL, d2NdL2, dmdL, n []float64, ...)
- func Ten2Man(mandel []float64, tensor [][]float64)
- func Tr(a [][]float64) float64
- type Cb_F_t
- type Cb_G_t
- type Cb_isofun_f
- type Cb_isofun_g
- type Cb_isofun_h
- type IsoFun
- func (o *IsoFun) CheckDerivs(A []float64, tol, tol2, tolq, tol3 float64, ver bool, args ...interface{}) (err error)
- func (o *IsoFun) DebugOutput(princOnly bool)
- func (o *IsoFun) Fa(A []float64, args ...interface{}) (res float64, err error)
- func (o *IsoFun) FindIntersect(p0, k float64, ΔL []float64, usek, debug bool, args ...interface{}) (L_at_int []float64)
- func (o *IsoFun) Fp(L []float64, args ...interface{}) (res float64, err error)
- func (o *IsoFun) Ga(dfdA, A []float64, args ...interface{}) (fval float64, err error)
- func (o *IsoFun) Get_bsmp() float64
- func (o *IsoFun) Get_derivs_afterHa(dpdσ, dqdσ []float64)
- func (o *IsoFun) Get_pq() (p, q float64)
- func (o *IsoFun) Gp(L []float64, args ...interface{}) (fval float64, err error)
- func (o *IsoFun) HafterGa(d2fdAdA [][]float64, args ...interface{}) (err error)
- func (o *IsoFun) HafterGp(args ...interface{}) (err error)
- func (o *IsoFun) Init(a, b, β, ϵ, shift float64, ncp int, ffcn Cb_isofun_f, gfcn Cb_isofun_g, ...)
- func (o *IsoFun) PlotFfcn(dirout, fname string, pmin, pmax float64, np int, pq_point []float64, ...)
- func (o *IsoFun) SetPrms(a, b, β, ϵ, shift float64, ffcn Cb_isofun_f, gfcn Cb_isofun_g, ...)
- func (o *IsoFun) Set_bsmp(b float64)
- func (o *IsoFun) String() (l string)
- type NcteM
- func (o *NcteM) D2Mdw2(w float64) float64
- func (o *NcteM) DMdw(w float64) float64
- func (o *NcteM) Deriv1(dMdσ, σ, s []float64, p, q, w float64)
- func (o *NcteM) Deriv2(d2Mdσdσ [][]float64, dMdσ, σ, s []float64, p, q, w float64)
- func (o *NcteM) Init(prms []string, vals []float64)
- func (o *NcteM) M(w float64) float64
- func (o *NcteM) String() (s string)
Constants ¶
const ( EPS = 1e-16 // smallest number satisfying 1.0 + EPS > 1.0 QMIN = 1e-10 // smallest q value to compute qCam invariant MINDET = 1e-20 // minimum determinant of tensor GENINVSQEPS = 1e-6 // EPS tolerance to be added when computing q SMPINVSTOL = 1e-8 // tolerance used in SmpInvs to avoid sqrt(negativenumber) SMPUSESRAMP = false // use smooth abs instead of smooth ramp EV_ALPMIN = 1e-10 // minimum α to be used in eigenprojectors derivatives EV_ZERO = 1e-9 // minimum eigenvalue EV_EQUAL = 1e-4 // relative tolerance for equal eigenvalues )
Variables ¶
var ( // T2MI converts i-j-indices of 3x3 2nd order tensor to I-index in Mandel's representation T2MI = [][]int{ {0, 3, 5}, {3, 1, 4}, {5, 4, 2}, } // TT2MI converts i-j-k-l-indices of 3x3x3x3 4th order tensor to I-index in Mandel's representation TT2MI = [][][][]int{ {{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, {{3, 3, 3}, {3, 3, 3}, {3, 3, 3}}, {{5, 5, 5}, {5, 5, 5}, {5, 5, 5}}}, {{{3, 3, 3}, {3, 3, 3}, {3, 3, 3}}, {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, {{4, 4, 4}, {4, 4, 4}, {4, 4, 4}}}, {{{5, 5, 5}, {5, 5, 5}, {5, 5, 5}}, {{4, 4, 4}, {4, 4, 4}, {4, 4, 4}}, {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}}, } // TT2MJ converts i-j-k-l-indices of 3x3x3x3 4th order tensor to J-index in Mandel's representation TT2MJ = [][][][]int{ {{{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}}, {{{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}}, {{{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}, {{0, 3, 5}, {3, 1, 4}, {5, 4, 2}}}, } // M2Ti converts I-index in Mandel's representation to i-index of 3x3 2nd order tensor M2Ti = []int{0, 1, 2, 0, 1, 0} // M2Tj converts I-index in Mandel's representation to j-index of 3x3 2nd order tensor M2Tj = []int{0, 1, 2, 1, 2, 2} // constants SQ2 = math.Sqrt(2.0) // sqrt(2) SQ3 = math.Sqrt(3.0) // sqrt(3) SQ6 = math.Sqrt(6.0) // sqrt(6) SQ3by2 = math.Sqrt(3.0 / 2.0) // sqrt(3/2) SQ2by3 = math.Sqrt(2.0 / 3.0) // sqrt(2/3) TWOSQ2 = 2.0 * math.Sqrt(2.0) // 2*sqrt(2) == 2^(3/2) // 3x3 2nd order identity tensor It = [][]float64{ {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, } // 3x3 2nd order identity tensor in Mandel's representation Im = []float64{1, 1, 1, 0, 0, 0} // 4th order identity tensor (symmetric) in Mandel's representation IIm = [][]float64{ {1.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 1.0}, } // symmetric-deviatoric projector (3D) in Mandel's representation //Psd3dm = [][]float64{ Psd = [][]float64{ {2.0 / 3.0, -1.0 / 3.0, -1.0 / 3.0, 0.0, 0.0, 0.0}, {-1.0 / 3.0, 2.0 / 3.0, -1.0 / 3.0, 0.0, 0.0, 0.0}, {-1.0 / 3.0, -1.0 / 3.0, 2.0 / 3.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 1.0}, } // isotropic projector (3D) in Mandel's representation //Piso3dm = [][]float64{ Piso = [][]float64{ {1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0, 0.0, 0.0, 0.0}, {1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0, 0.0, 0.0, 0.0}, {1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, } )
Functions ¶
func AlmansiStrain ¶
func AlmansiStrain(e, Fi [][]float64)
Eulerian or Almansi strain tensor: e := 0.5 * (I - inv(F)^t * inv(F)) Symmetric
func CauchyToPK1 ¶
Cauchy stress => first Piola-Kirchhoff: P := σ * inv(F)^t * J
func CauchyToPK2 ¶
Cauchy stress => second Piola-Kirchhoff: S := inv(F) * σ * inv(F)^t * J
func CheckEigenprojs ¶
CheckEigenprojs checks eigen projectors
func CheckEigenprojsDerivs ¶
CheckEigenprojsDerivs checks the derivatives of eigen projectors w.r.t defining tensor
func GenInvsDeriv1 ¶
func GenInvsDeriv1(dpdL, dqdL []float64, L, n []float64, dndL [][]float64, a float64) (p, q float64, err error)
GenInvsDeriv1 computes the first order derivatives of p and q w.r.t L (shifted eigenvalues)
Note: L are the eigenvalues (shifted or not)
func GenInvsDeriv2 ¶
func GenInvsDeriv2(d2pdLdL, d2qdLdL [][]float64, L, n, dpdL, dqdL []float64, p, q float64, dndL [][]float64, d2ndLdL [][][]float64, a float64)
GenInvsDeriv2 computes the second order derivatives of p and q w.r.t L (shifted eigenvalues)
Note: L are the eigenvalues (shifted or not)
func GenTvec ¶
func GenTvec(t, L, n []float64)
GenTvec computes the t vector (stress vector on SMP via Cauchy's rule: t = L dot n)
Note: L are the eigenvalues (shifted or not)
func GenTvecDeriv1 ¶
GenTvecDeriv1 computes the first derivative dt/dL
Note: L are the eigenvalues (shifted or not)
func GenTvecDeriv2 ¶
GenTvecDeriv2 computes the second derivative d²t/dLdL
Note: L are the eigenvalues (shifted or not)
func GreenStrain ¶
func GreenStrain(E, F [][]float64)
Lagrangian or Green strain tensor: E := 0.5 * (Ft * F - I) Symmetric
func L_strains ¶
L_strains compute strain invariants given principal values
ε -- principal values [3]
func LeftCauchyGreenDef ¶
func LeftCauchyGreenDef(b, F [][]float64)
Left Cauchy-Green deformation tensor: b := F * Ft Symmetric and positive definite: det(b) = det(F)^2
func LinStrain ¶
func LinStrain(ε, F [][]float64)
Linear strain tensor: ε := 0.5 * (H + Ht) = 0.5 * (F + Ft) - I
func M2Phi ¶
M2Phi calculates φ (friction angle at compression (degrees)) given M (max q/p at compression)
func M2T ¶
M2T converts Mandel components to 3x3 second order tensor components, i.e. correcting off-diagonal values that were multiplied by SQ2
func M2TT ¶
M2TT converts Mandel components to 3x3x3x3 fourth order tensor components, i.e. correcting all values that were multiplied by 2 or SQ2
func M_Alloc4 ¶
M_Alloc4 allocates a 4th order tensor in Mandel's representation ((2*ndim)x(2*ndim))
func M_AllocEigenprojs ¶
M_AllocEigenprojs allocates new eigenprojectors P[3][ncp].
P[0] = {P0_0, P0_1, P0_2, P0_3, P0_4, P0_5} P[1] = {P1_0, P1_1, P1_2, P1_3, P1_4, P1_5} P[2] = {P2_0, P2_1, P2_2, P2_3, P2_4, P2_5}
func M_CharInvs ¶
M_CharInvs computes the characteristic invariants of a 2nd order symmetric tensor
func M_CharInvsAndDerivs ¶
M_CharInvsAndDerivs computes the characteristic invariants of a 2nd order symmetric and their derivatives
func M_Det ¶
M_Det calculates the determinant a 2nd order tensor represented in Mandel's basis
Note: this function also works for principal values with len(a) = 3
func M_DetDeriv ¶
func M_DetDeriv(d, a []float64)
M_DetDeriv computes the derivative of the determinant of a w.r.t a
d := dDet(a)/da == dI3(a)/da
func M_Dot ¶
M_Dot multiplies two second order symmetric tensors (the result may be non-symmetric) An error is returned in case the result is non-symmetric
c = a dot b => cij = aik * bkj
func M_EigenProjsDerivAna ¶
M_EigenProjsDerivAna returns the derivatives of the eigenprojectors w.r.t its defining tensor using the analytical formula.
Input: a -- (perturbed) tensor 'a' (in Mandel basis) λ -- eigenvalues of 'a' P -- eigenprojectors of 'a' Output: dPda -- the derivatives of P w.r.t 'a'
func M_EigenProjsDerivAuto ¶
M_EigenProjsDerivAuto computes the derivatives of the eigenprojectors of tensor a w.r.t. to itself by automatically calling the numerical or the analytical formulae depending on whether the eigenvalues are zero/repeated or not
Note: this function should work for non-perturbed tensors with zero/repeated eigenvalues. Input: a -- tensor 'a' (in Mandel basis) λ -- eigenvalues of 'a' P -- eigenprojectors of 'a' Output: dPda -- the derivatives of P w.r.t 'a'
func M_EigenProjsDerivNum ¶
M_EigenProjsDerivNum returns the derivatives of the eigenprojectors w.r.t its defining tensor using the finite differences method.
Input: a -- tensor in Mandel basis h -- step size for finite differences Output: dPda -- derivatives [3][ncp][ncp]
func M_EigenValsNum ¶
M_EigenValsNum returns the eigenvalues of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation
func M_EigenValsProjsNum ¶
M_EigenValsProjsNum computes the eigenvalues and eigenprojectors of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation.
func M_EigenValsVecsNum ¶
M_EigenValsVecs returns the eigenvalues and eigenvectors of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation.
func M_InvDeriv ¶
M_InvDeriv computes the derivative of the inverse of a tensor with respect to itself
ai := inv(a) d := dai/da
func M_LodeDeriv1 ¶
M_LodeDeriv1 computes the first derivative of w w.r.t σ
Note: only dwdσ is output
func M_LodeDeriv2 ¶
M_LodeDeriv2 computes the first and second derivatives of w w.r.t. σ
Note: d2wdσdσ and dwdσ output
func M_PrincValsNum ¶
M_PrincValsNum returns the (sorted, ascending) eigenvalues of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation.
func M_Sq ¶
func M_Sq(b, a []float64)
M_Sq returns the square of a tensor in Mandel's representation
b = a² = a single-dot a
func M_devε ¶
M_devε returns the deviator of ε (e := dev(ε)), the norm of the deviator (eno) and the εv, εd invariants
Note: this function also works for principal values with len(ε) = len(e) = 3
func M_devσ ¶
M_devσ returns the deviator of σ (s := dev(σ)), the norm of the deviator (sno) and the p, q invariants
Note: this function also works for principal values with len(σ) = len(s) = 3
func M_oct ¶
M_oct computes octahedral values of a 2nd order symmetric tensor with Mandel components
Note: the (p,q,w) stress invariants are firstly computed; thus, it is more efficient to compute (p,q,w) first and then use 'PQW2O'
func M_pq_smp ¶
M_pq_smp computes p and q SMP invariants of 2nd order symmetric tensor (Mandel components)
Note: 1) σ is a 2D or 3D symmetric tensor (len(σ)==4 or 6) 2) this function creates a number of local arrays => not efficient
func M_pqws ¶
M_pqws returns p, q, w invariants and the deviatoric stress s := dev(σ)
Note: this function also works for principal values with len(a) = len(s) = 3
func Mmatch ¶
Mmatch computes M=q/p and qy0 from c and φ corresponding to the strength that would be modelled by the Mohr-Coulomb model matching one of the following cones:
cone == "cmp" : compression cone (outer) == "ext" : extension cone (inner) == "psa" : plane-strain Note: p, q, and M are Cambridge (conventional) quantities
func O2Lmat ¶
func O2Lmat() (L [][]float64)
O2Lmat computes L[I:{1,2,3}][A:{a,b,c}] = dσI/dσA => σI = L * σA
func PK1ToCauchy ¶
First Piola-Kirchhoff => Cauchy stress: σ := P * Ft / J
func PK2ToCauchy ¶
Second Piola-Kirchhoff => Cauchy stress: σ := F * S * Ft / J
func Phi2M ¶
Phi2M calculates M = max q/p at compression (φ: friction angle at compression (degrees)). type = {"oct", "cam", "smp"}
func PlotOct ¶
func PlotOct(filename string, σcCte, rmin, rmax float64, nr, nα int, φ float64, F Cb_F_t, G Cb_G_t, notpolarc, simplec, only0, grads, showpts, first, last bool, ferr float64, args ...interface{})
PlotOct plots a function cross-section and gradients projections on octahedral plane
func PlotRefOct ¶
PlotRefOct plots reference failure criterions in octahedral plane:
Drucker-Prager and Mohr-Circles
func PlotRosette ¶
PlotRosette plots rosette in octahedral plane
func PullBack ¶
func PullBack(res, a, F, Fi [][]float64)
Pull-back (type A/cov): res := push-back(a) = Ft * a * F
func PullBackB ¶
func PullBackB(res, a, F, Fi [][]float64)
Pull-back (type B/contra): res := pull-back(a) = inv(F) * a * inv(F)^t
func PushForward ¶
func PushForward(res, a, F, Fi [][]float64)
Push-forward (type A/cov): res := push-forward(a) = inv(F)^t * a * inv(F)
func PushForwardB ¶
func PushForwardB(res, a, F, Fi [][]float64)
Push-forward (type B/contra): res := push-forward(a) = F * a * Ft
func RightCauchyGreenDef ¶
func RightCauchyGreenDef(C, F [][]float64)
Right Cauchy-Green deformation tensor: C := Ft * F Symmetric and positive definite: det(C) = det(F)^2
func SMPderivs1 ¶
SMPderivs1 computes the 1st order derivatives of SMP invariants
Note: internal variables are created => not efficient
func SMPinvs ¶
SMPinvs computes the SMP invariants, after the internal computation of the SMP unit director
Note: internal variables are created => not efficient
func SmpDerivs1 ¶
func SmpDerivs1(dndL [][]float64, dNdL, N, F, G []float64, L []float64, a, b, β, ϵ float64) (m float64)
SmpDerivs1 computes the first derivative and other variables
Note: m, dNdL, N, F and G are output
func SmpDerivs2 ¶
func SmpDerivs2(d2ndLdL [][][]float64, L []float64, a, b, β, ϵ, m float64, N, F, G, dNdL []float64, dndL [][]float64)
SmpDerivs2 computes the second order derivative
Note: m, N, F, G, dNdL and dndL are input
func SmpDirector ¶
SmpDirector computes the director (normal vector) of the spatially mobilised plane
Notes: 1) the norm of N is returned => m := norm(N) 2) if !SMPUSESRAMP, β==eps and must be a small quantity
func SmpDirectorDeriv1 ¶
SmpDirectorDeriv1 computes the first order derivative of the SMP director
Notes: Only non-zero components are returned; i.e. dNdL[i] := dNdL[i][i]
func SmpDirectorDeriv2 ¶
SmpDirectorDeriv2 computes the second order derivative of the SMP director
Notes: Only the non-zero components are returned; i.e.: d²NdL2[i] := d²N[i]/dL[i]dL[i]
func SmpNormDirectorDeriv1 ¶
SmpNormDirectorDeriv1 computes the first derivative of the norm of the SMP director
Note: m, N and dNdL are input
func SmpNormDirectorDeriv2 ¶
func SmpNormDirectorDeriv2(d2mdLdL [][]float64, L []float64, a, b, β, ϵ, m float64, N, dNdL, d2NdL2, dmdL []float64)
SmpNormDirectorDeriv2 computes the second order derivative of the norm of the SMP director
Note: m, N, dNdL, d2NdL2 and dmdL are input
func SmpUnitDirectorDeriv1 ¶
SmpUnitDirectorDeriv1 computes the first derivative of the SMP unit normal
Note: m, N, dNdL and dmdL are input
func SmpUnitDirectorDeriv2 ¶
func SmpUnitDirectorDeriv2(d2ndLdL [][][]float64, m float64, N, dNdL, d2NdL2, dmdL, n []float64, d2mdLdL, dndL [][]float64)
SmpUnitDirectorDeriv2 computes the second order derivative of the unit director of the SMP d²n[i]/dL[j]dL[k]
Note: m, N, dNdL, d2NdL2, dmdL, n, d2mdLdL and dndL are input
Types ¶
type Cb_isofun_g ¶
type Cb_isofun_h ¶
type IsoFun ¶
type IsoFun struct { // eigenvalues/projectors L, Ls []float64 // eigenvalues and shifted eigenvalues P [][]float64 // eigenprojectors N []float64 // SMP director and unit director Frmp, Grmp []float64 // ramp function values DfdL []float64 // first derivative of f // for second derivatives Acpy []float64 // copy of tensor 'A' DgdL [][]float64 // second derivative of f // contains filtered or unexported fields }
IsoFun handles isotropic functions and their derivatives
func (*IsoFun) CheckDerivs ¶
func (o *IsoFun) CheckDerivs(A []float64, tol, tol2, tolq, tol3 float64, ver bool, args ...interface{}) (err error)
CheckDerivs check derivatives computed by isotropic function
func (*IsoFun) DebugOutput ¶
DebugOutput outputs debug information
func (*IsoFun) Fa ¶
Fa evaluates the isotropic function @ A (a second order tensor in Mandel's basis)
func (*IsoFun) FindIntersect ¶
func (o *IsoFun) FindIntersect(p0, k float64, ΔL []float64, usek, debug bool, args ...interface{}) (L_at_int []float64)
FindIntersect find point on surface using Newton's method
func (*IsoFun) Ga ¶
Ga computes f and dfdA @ A (a second order tensor in Mandel's basis)
Notes: 1) eigenvalues are stored in L and eigenprojectors are stored in P 2) DfdL is calculated and is availabe for external use
func (*IsoFun) Get_derivs_afterHa ¶
Get_derivs_afterHa returns the derivatives of SMP invariants after a call to HafterGa
func (*IsoFun) Gp ¶
Gp computes f and DfdL @ L (principal values) Notes:
- L is input => shifted and copied into to internal Ls for use in Hp
- output is stored in DfdL
func (*IsoFun) HafterGa ¶
HafterGa computes d2fdada after G is called
Input: dfdA -- df/da args -- extra arguments Output: d2fdAdA -- d²f/dAdA Notes: 1) DgdL==d2fdLdL is calculated and is availabe for external use
func (*IsoFun) HafterGp ¶
HafterGp computes d2fdLdL == dgdL after Gp was called Notes:
- output is stored in DgdL
func (*IsoFun) Init ¶
func (o *IsoFun) Init(a, b, β, ϵ, shift float64, ncp int, ffcn Cb_isofun_f, gfcn Cb_isofun_g, hfcn Cb_isofun_h)
Init initialises the isotropic function structure
func (*IsoFun) PlotFfcn ¶
func (o *IsoFun) PlotFfcn(dirout, fname string, pmin, pmax float64, np int, pq_point []float64, args_contour, args_point string, extra_before, extra_after func(), args ...interface{})
Plots Ffcn
func (*IsoFun) SetPrms ¶
func (o *IsoFun) SetPrms(a, b, β, ϵ, shift float64, ffcn Cb_isofun_f, gfcn Cb_isofun_g, hfcn Cb_isofun_h)
SetPrms set parameters
type NcteM ¶
type NcteM struct { Mfix bool // derived Sinφ float64 Tanφ float64 Mcs float64 // contains filtered or unexported fields }
NcteM implements Argyris-Sheng et al M(w) non-constant M coefficient
func (*NcteM) Deriv2 ¶
Deriv2 returns the first and second derivatives of M w.r.t σ
Note: d2Mdσdσ and dMdσ output