// 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 SmpDirectorDeriv1(dNdL []float64, L []float64, a, b, β, ϵ float64) { if SMPUSESRAMP { dNdL[0] = -b * fun.SrampD1(a*L[0], β) * math.Pow(ϵ+fun.Sramp(a*L[0], β), -b-1.0) dNdL[1] = -b * fun.SrampD1(a*L[1], β) * math.Pow(ϵ+fun.Sramp(a*L[1], β), -b-1.0) dNdL[2] = -b * fun.SrampD1(a*L[2], β) * math.Pow(ϵ+fun.Sramp(a*L[2], β), -b-1.0) } else { eps := β dNdL[0] = -b * fun.SabsD1(a*L[0], eps) * math.Pow(ϵ+fun.Sabs(a*L[0], eps), -b-1.0) dNdL[1] = -b * fun.SabsD1(a*L[1], eps) * math.Pow(ϵ+fun.Sabs(a*L[1], eps), -b-1.0) dNdL[2] = -b * fun.SabsD1(a*L[2], eps) * math.Pow(ϵ+fun.Sabs(a*L[2], eps), -b-1.0) } }
// 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 SmpDirector(N, L []float64, a, b, β, ϵ float64) (m float64) { if SMPUSESRAMP { N[0] = a / math.Pow(ϵ+fun.Sramp(a*L[0], β), b) N[1] = a / math.Pow(ϵ+fun.Sramp(a*L[1], β), b) N[2] = a / math.Pow(ϵ+fun.Sramp(a*L[2], β), b) } else { eps := β N[0] = a / math.Pow(ϵ+fun.Sabs(a*L[0], eps), b) N[1] = a / math.Pow(ϵ+fun.Sabs(a*L[1], eps), b) N[2] = a / math.Pow(ϵ+fun.Sabs(a*L[2], eps), b) } m = math.Sqrt(N[0]*N[0] + N[1]*N[1] + N[2]*N[2]) return }
// 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 SmpDirectorDeriv2(d2NdL2 []float64, L []float64, a, b, β, ϵ float64) { var F_i, G_i, H_i float64 for i := 0; i < 3; i++ { if SMPUSESRAMP { F_i = fun.Sramp(a*L[i], β) G_i = fun.SrampD1(a*L[i], β) H_i = fun.SrampD2(a*L[i], β) } else { eps := β F_i = fun.Sabs(a*L[i], eps) G_i = fun.SabsD1(a*L[i], eps) H_i = fun.SabsD2(a*L[i], eps) } d2NdL2[i] = a * b * ((b+1.0)*G_i*G_i - (ϵ+F_i)*H_i) * math.Pow(ϵ+F_i, -b-2.0) } }
// ramp implements the ramp function func (o *ElemP) ramp(x float64) float64 { if o.Macaulay { return fun.Ramp(x) } return fun.Sramp(x, o.βrmp) }