tsr

package
v0.0.0-...-1b5bcbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

tsr implements routines to conduct tensor operations

Index

Constants

View Source
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

View Source
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 Add

func Add(u [][]float64, α float64, a [][]float64, β float64, b [][]float64)

Add adds two second order tensors according to:

u := α*a + β*b

func Alloc2

func Alloc2() (tensor [][]float64)

Alloc2 allocates a 3x3 2nd order tensor

func Alloc4

func Alloc4() (tensor [][][][]float64)

Alloc4 allocates a 3x3x3x3 4th order tensor

func AlmansiStrain

func AlmansiStrain(e, Fi [][]float64)

Eulerian or Almansi strain tensor: e := 0.5 * (I - inv(F)^t * inv(F)) Symmetric

func CauchyToPK1

func CauchyToPK1(P, σ, F, Fi [][]float64, J float64)

Cauchy stress => first Piola-Kirchhoff: P := σ * inv(F)^t * J

func CauchyToPK2

func CauchyToPK2(S, σ, F, Fi [][]float64, J float64)

Cauchy stress => second Piola-Kirchhoff: S := inv(F) * σ * inv(F)^t * J

func CheckEigenprojs

func CheckEigenprojs(a []float64, tolP, tolS float64, ver bool) (λsorted []float64)

CheckEigenprojs checks eigen projectors

func CheckEigenprojsDerivs

func CheckEigenprojsDerivs(a []float64, tol float64, ver bool, zero float64)

CheckEigenprojsDerivs checks the derivatives of eigen projectors w.r.t defining tensor

func Det

func Det(a [][]float64) float64

Det computes the determinant of a second order tensor

func Dev

func Dev(a [][]float64) (deva [][]float64)

Dev returns the second order deviatoric tensor

func GenInvs

func GenInvs(L, n []float64, a float64) (p, q float64, err error)

GenInvs returns the SMP invariants

Note: L are the eigenvalues (shifted or not)

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

func GenTvecDeriv1(dtdL [][]float64, L, n []float64, dndL [][]float64)

GenTvecDeriv1 computes the first derivative dt/dL

Note: L are the eigenvalues (shifted or not)

func GenTvecDeriv2

func GenTvecDeriv2(i, j, k int, L []float64, dndL [][]float64, d2ndLdL_ijk float64) (res float64)

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 Inv

func Inv(ai, a [][]float64) (det float64, err error)

Inv computes the inverse of a second order tensor

ai := Inv(a)

func L2O

func L2O(σ1, σ2, σ3 float64) (σa, σb, σc float64)

L2O converts principal values (σ1,σ2,σ3) to octahedral values (σa,σb,σc)

func L_strains

func L_strains(ε []float64) (εv, εd float64)

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

func M2Phi(M float64, typ string) float64

M2Phi calculates φ (friction angle at compression (degrees)) given M (max q/p at compression)

func M2T

func M2T(mandel []float64, i, j int) (component float64)

M2T converts Mandel components to 3x3 second order tensor components, i.e. correcting off-diagonal values that were multiplied by SQ2

func M2TT

func M2TT(mandel [][]float64, i, j, k, l int) float64

M2TT converts Mandel components to 3x3x3x3 fourth order tensor components, i.e. correcting all values that were multiplied by 2 or SQ2

func M_Alloc2

func M_Alloc2(ndim int) (a []float64)

M_Alloc2 allocates a 2th order tensor in Mandel's representation (2*ndim)

func M_Alloc4

func M_Alloc4(ndim int) (A [][]float64)

M_Alloc4 allocates a 4th order tensor in Mandel's representation ((2*ndim)x(2*ndim))

func M_AllocEigenprojs

func M_AllocEigenprojs(ncp int) (P [][]float64)

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

func M_CharInvs(a []float64) (I1, I2, I3 float64)

M_CharInvs computes the characteristic invariants of a 2nd order symmetric tensor

func M_CharInvsAndDerivs

func M_CharInvsAndDerivs(a []float64) (I1, I2, I3 float64, dI1da, dI2da, dI3da []float64)

M_CharInvsAndDerivs computes the characteristic invariants of a 2nd order symmetric and their derivatives

func M_Det

func M_Det(a []float64) float64

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_Dev

func M_Dev(a []float64) (s []float64)

M_Dev calculates the deviator a 2nd order tensor represented in Mandel's basis

func M_Dot

func M_Dot(c []float64, a, b []float64, nonsymTol float64) (err error)

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_Dy

func M_Dy(a, b []float64) (c [][]float64)

M_Dy returns the dyadic product between a and b

c := a dy b

func M_DyAdd

func M_DyAdd(c [][]float64, s float64, a, b []float64)

M_DyAdd adds the dyadic product between a and b scaled by s

c += s * a dy b

func M_EigenProjsDerivAna

func M_EigenProjsDerivAna(dPda [][][]float64, a, λ []float64, P [][]float64) (err error)

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

func M_EigenProjsDerivAuto(dPda [][][]float64, a, λ []float64, P [][]float64) (err error)

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

func M_EigenProjsDerivNum(dPda [][][]float64, a []float64, h float64) (err error)

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

func M_EigenValsNum(λ, a []float64) (err error)

M_EigenValsNum returns the eigenvalues of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation

func M_EigenValsProjsNum

func M_EigenValsProjsNum(P [][]float64, λ, a []float64) (err error)

M_EigenValsProjsNum computes the eigenvalues and eigenprojectors of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation.

func M_EigenValsVecsNum

func M_EigenValsVecsNum(Q [][]float64, λ, a []float64) (err error)

M_EigenValsVecs returns the eigenvalues and eigenvectors of tensor 'a' (2nd order symmetric tensor in Mandel's basis) using Jacobi rotation.

func M_Inv

func M_Inv(ai, a []float64, tol float64) (det float64, err error)

M_Inv computes the inverse of a 2nd order symmetric tensor 'a'

func M_InvDeriv

func M_InvDeriv(d [][]float64, ai []float64)

M_InvDeriv computes the derivative of the inverse of a tensor with respect to itself

ai := inv(a)
d  := dai/da

func M_LodeDeriv1

func M_LodeDeriv1(dwdσ, σ, s []float64, p, q, w float64)

M_LodeDeriv1 computes the first derivative of w w.r.t σ

Note: only dwdσ is output

func M_LodeDeriv2

func M_LodeDeriv2(d2wdσdσ [][]float64, dwdσ, σ, s []float64, p, q, w float64)

M_LodeDeriv2 computes the first and second derivatives of w w.r.t. σ

Note: d2wdσdσ and dwdσ output

func M_Norm

func M_Norm(a []float64) float64

M_Norm calculates the norm of a 2nd order tensor represented in Mandel's basis

func M_PrincValsNum

func M_PrincValsNum(a []float64) (λ0, λ1, λ2 float64, err error)

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_SqDeriv

func M_SqDeriv(d [][]float64, a []float64)

M_SqDeriv (Mandel) derivative of square of a tensor

d = derivative of a² w.r.t a

func M_Tr

func M_Tr(a []float64) float64

M_Tr calculates the trace a 2nd order tensor represented in Mandel's basis

func M_Ts

func M_Ts(Ts [][]float64, s []float64)

M_Ts computes Ts = Psd:(ds²/ds):Psd

func M_devε

func M_devε(e, ε []float64) (eno, εv, εd float64)

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σ

func M_devσ(s, σ []float64) (sno, p, q float64)

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

func M_oct(a []float64) (σa, σb, σc float64)

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_p

func M_p(σ []float64) float64

M_p returns the hydrostatic pressure == negative of the mean pressure == - tr(σ) / 3

func M_pq_smp

func M_pq_smp(σ []float64, a, b, β, ϵ float64) (p, q float64, err error)

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_pqw

func M_pqw(a []float64) (p, q, w float64)

M_pqw returns p, q and w invariants

func M_pqws

func M_pqws(s, a []float64) (p, q, w float64)

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 M_pqθ

func M_pqθ(a []float64) (p, q, θ float64)

M_pqθ returns p, q and θ invariants

func M_q

func M_q(σ []float64) float64

M_q returns von Mises' equivalent stress

func M_w

func M_w(a []float64) (w float64)

M_w returns the Lode invariant -1 ≤ w := sin(3θ) ≤ 1

func M_εd

func M_εd(ε []float64) float64

M_εd returns the deviatoric strain

func M_εv

func M_εv(ε []float64) float64

M_εv returns the volumetric strain

func M_θ

func M_θ(a []float64) (θdeg float64)

M_θ returns the Lode invariant -30° ≤ θ := asin(w) / 3 ≤ 30°

func Man2Ten

func Man2Ten(tensor [][]float64, mandel []float64)

Man2Ten returns the 3x3 2nd order tensor from its Mandel representation

func Mmatch

func Mmatch(c, φ float64, cone string) (M, qy0 float64)

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 O2L

func O2L(σa, σb, σc float64) (σ1, σ2, σ3 float64)

O2L converts octahedral values (σa,σb,σc) to principal values (σ1,σ2,σ3)

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

func PK1ToCauchy(σ, P, F, Fi [][]float64, J float64)

First Piola-Kirchhoff => Cauchy stress: σ := P * Ft / J

func PK2ToCauchy

func PK2ToCauchy(σ, S, F, Fi [][]float64, J float64)

Second Piola-Kirchhoff => Cauchy stress: σ := F * S * Ft / J

func PQW2O

func PQW2O(p, q, w float64) (σa, σb, σc float64)

PQW2O converts p,q,w to octahedral values (σa,σb,σc)

func Phi2M

func Phi2M(φ float64, typ string) float64

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

func PlotRefOct(φ, σc float64, withExtCircle bool)

PlotRefOct plots reference failure criterions in octahedral plane:

Drucker-Prager and Mohr-Circles

func PlotRosette

func PlotRosette(r float64, full, ref bool, withtext bool, fsz float64)

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

func SMPderivs1(dpdL, dqdL, L []float64, a, b, β, ϵ float64) (p, q float64, err error)

SMPderivs1 computes the 1st order derivatives of SMP invariants

Note: internal variables are created => not efficient

func SMPinvs

func SMPinvs(L []float64, a, b, β, ϵ float64) (p, q float64, err error)

SMPinvs computes the SMP invariants, after the internal computation of the SMP unit director

Note: internal variables are created => not efficient

func SmpCalcμ

func SmpCalcμ(φ, a, b, β, ϵ float64) (μ float64)

SmpCalcμ computes μ=q/p to satisfy Mohr-Coulomb criterion @ compression

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

func SmpDirector(N, L []float64, a, b, β, ϵ float64) (m float64)

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

func SmpDirectorDeriv1(dNdL []float64, L []float64, a, b, β, ϵ float64)

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

func SmpDirectorDeriv2(d2NdL2 []float64, L []float64, a, b, β, ϵ float64)

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

func SmpNormDirectorDeriv1(dmdL []float64, m float64, N, dNdL []float64)

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 SmpUnitDirector

func SmpUnitDirector(n []float64, m float64, N []float64)

SmpUnitDirector computed the unit normal of the SMP

Note: m and N are input

func SmpUnitDirectorDeriv1

func SmpUnitDirectorDeriv1(dndL [][]float64, m float64, N, dNdL, dmdL []float64)

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

func Ten2Man

func Ten2Man(mandel []float64, tensor [][]float64)

Ten2Man returns the Mandel representation of a 3x3 2nd order tensor

func Tr

func Tr(a [][]float64) float64

Tr returns the trace of a second order tensor

Types

type Cb_F_t

type Cb_F_t func(A []float64, args ...interface{}) (fval float64, err error)

type Cb_G_t

type Cb_G_t func(dfdA, A []float64, args ...interface{}) (fval float64, err error)

type Cb_isofun_f

type Cb_isofun_f func(p, q float64, args ...interface{}) float64

Callbacks

type Cb_isofun_g

type Cb_isofun_g func(p, q float64, args ...interface{}) (dfdp, dfdq float64)

type Cb_isofun_h

type Cb_isofun_h func(p, q float64, args ...interface{}) (d2fdp2, d2fdq2, d2fdpdq float64)

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

func (o *IsoFun) DebugOutput(princOnly bool)

DebugOutput outputs debug information

func (*IsoFun) Fa

func (o *IsoFun) Fa(A []float64, args ...interface{}) (res float64, err error)

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) Fp

func (o *IsoFun) Fp(L []float64, args ...interface{}) (res float64, err error)

Fp evaluates the isotropic function @ L (principal values)

func (*IsoFun) Ga

func (o *IsoFun) Ga(dfdA, A []float64, args ...interface{}) (fval float64, err error)

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_bsmp

func (o *IsoFun) Get_bsmp() float64

Accessors

func (*IsoFun) Get_derivs_afterHa

func (o *IsoFun) Get_derivs_afterHa(dpdσ, dqdσ []float64)

Get_derivs_afterHa returns the derivatives of SMP invariants after a call to HafterGa

func (*IsoFun) Get_pq

func (o *IsoFun) Get_pq() (p, q float64)

func (*IsoFun) Gp

func (o *IsoFun) Gp(L []float64, args ...interface{}) (fval float64, err error)

Gp computes f and DfdL @ L (principal values) Notes:

  1. L is input => shifted and copied into to internal Ls for use in Hp
  2. output is stored in DfdL

func (*IsoFun) HafterGa

func (o *IsoFun) HafterGa(d2fdAdA [][]float64, args ...interface{}) (err error)

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

func (o *IsoFun) HafterGp(args ...interface{}) (err error)

HafterGp computes d2fdLdL == dgdL after Gp was called Notes:

  1. 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

func (*IsoFun) Set_bsmp

func (o *IsoFun) Set_bsmp(b float64)

func (*IsoFun) String

func (o *IsoFun) String() (l string)

String returns information of this object

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) D2Mdw2

func (o *NcteM) D2Mdw2(w float64) float64

D2Mdw2 implements d²M/dw²

func (*NcteM) DMdw

func (o *NcteM) DMdw(w float64) float64

DMdw implements dM/dw

func (*NcteM) Deriv1

func (o *NcteM) Deriv1(dMdσ, σ, s []float64, p, q, w float64)

Deriv1 returns the first derivative of M w.r.t σ

Note: only dMdσ is output

func (*NcteM) Deriv2

func (o *NcteM) Deriv2(d2Mdσdσ [][]float64, dMdσ, σ, s []float64, p, q, w float64)

Deriv2 returns the first and second derivatives of M w.r.t σ

Note: d2Mdσdσ and dMdσ output

func (*NcteM) Init

func (o *NcteM) Init(prms []string, vals []float64)

Init initialises this object

func (*NcteM) M

func (o *NcteM) M(w float64) float64

M implements M(w)

func (*NcteM) String

func (o *NcteM) String() (s string)

String returns a string representing this structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL