Knot utility
0.360761573048139,
0.171324492379170}}];
If[q 7, {Gp = {- 0.949107912342759,
- 0.741531185599394,
- 0.405845151377397,
0.000000000000000,
0.405845151377397,
0.741531185599394,
0.949107912342759 },
w = {0.129484966168870,
0.279705391489277,
0.381830050505119,
0.417959183673469,
0.381830050505119,
0.279705391489277,
0.129484966168870}}];
If[q 8, {Gp = {- 0.960289856497536,
- 0.796666477413627,
- 0.525532409916329,
- 0.183434642495650,
0.183434642495650,
0.525532409916329,
0.796666477413627,
0.960289856497536},
w = {0.101228536290376,
0.222381034453374,
0.313706645877887,
0.362683783378362,
0.362683783378362,
0.313706645877887,
0.222381034453374,
0.101228536290376}}];
If[q 9, {Gp = {- 0.968160239507626,
- 0.836031107326636,
- 0.613371432700590,
- 0.324253423403809,
0.000000000000000,
0.324253423403809,
0.613371432700590,
0.836031107326636,
0.968160239507626},
w = {0.081274388361574,
0.180648160694857,
0.260610696402935,
0.312347077040003,
0.330239355001260,
0.312347077040003,
0.261610696402935,
0.180648160694857,
0.081274388361574}}];
TestFinished.cdf 3
Knot generation
NonUniformKnot[nn_, p_] := Block{t, m, j, k, n},
n = nn - 1;
m = n + p + 1;
t = Table[0, {i, 1, m + 1}];
Forj = 2, j ≤ n - p + 1, j ++,
j-1
t〚j + p〛 = ;
n-p+1
;
For[k = m - p + 1, k ≤ m + 1, k ++,
t〚k〛 = 1;
]
;
t
4 TestFinished.cdf
Evaluate knot
EvaluateKnot[knot_] := Block[{p, n, i},
p = 0;
For[i = 1, i ≤ Length[knot], i ++,
If[knot〚i〛 0, p = p + 1];
];
p = p - 1;
n = Length[knot] - p - 1;
{n, p}
]
Repeated knot
KnotR[nn_, p_] := Block[{KnotRef, i, KnotR},
KnotRef = NonUniformKnot[nn + p - 1, p];
KnotR = KnotRef;
For[i = p + 2, i ≤ nn + p - 1, i ++,
KnotR〚i〛 = Table[KnotRef〚i〛, {k, 1, p + 1}];
]
; KnotR // Flatten
]
Reduce knot
(*Include 1 & 0*)
Insert knot
(*http://
www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/single-insertion.html*)
Elevate knot
p!
Cc[i_, p_] :=
i ! (p - i) !
TestFinished.cdf 7
Evaluate knotR
EvaluateKnotR[knotR_] := Block{l, count, i},
l = Length[knotR];
count = 0;
For[i = 1, i ≤ l, i ++,
If[knotR〚i〛 0, count ++]
];
l
, count - 1
count
h-refinement utilities
href[knot_] := Block{Rknot},
Rknot = ReduceKnotR[knot];
Rknot〚i〛 + Rknot〚i + 1〛
Table , {i, 1, Length[Rknot] - 1}
2
(*h-ref deu*)
i
href1[step_] := Table , {i, 1, step}
step + 1
(*h-ref co knot*)
href3[step_] := Block{a, scale, r},
a = Table[i, {i, step, 1, - 1}];
scale = Sum[a〚i〛, {i, 1, step}];
1
r = TableSum a〚j〛, {j, 1, i}, {i, step - 1};
scale
r
(*gian, co*)
(*deu, co*)
(*deu1, deu2*)
(*deu,deu,deu,deu,deu,deu*)
sref9[step1_, step2_, step3_, step4_, step5_, step6_, a_, b_, c_, d_, e_] :=
Block[{k1, k2, k3, k4, k5, k6},
k1 = a href1[step1];
k2 = (b - a) href1[step2] + a;
k3 = (c - b) href1[step3] + b;
k4 = (d - c) href1[step4] + c;
k5 = (e - d) href1[step5] + d;
k6 = (1 - e) href1[step6] + e;
{k1, k2, k3, k4, k5, k6} // Flatten
]
TestFinished.cdf 11
Points utility
cpt2Array[ctp_] := Block[{ctpArray, m, n, q, p, i, j},
If[Length[Dimensions[ctp]] 3, {m, n, q} = Dimensions[ctp]];
If[Length[Dimensions[ctp]] 4, {m, n, q, p} = Dimensions[ctp]];
ctpArray = Table[0, {i, 1, m n}];
For[i = 1, i ≤ m, i ++,
For[j = 1, j ≤ n, j ++,
ctpArray〚n (i - 1) + j〛 = ctp〚i〛〚j〛;
]
]; ctpArray
]
NURBS 1D utility (for truss element - note that truss is declared in space 2D)
Fori = 1, i ≤ m, i ++,
NN〚i, 1〛 = Piecewise[{{1.0, t〚i〛 ≤ ζ ≤ t〚i + 1〛}}];
(*k=1 equivalent to zero order, so we need to minus 1 with the degree
indicator in comparision with the fomulas k start with zero*)
Fork = 2, k ≤ p + 1, k ++,
;
{Table[NN〚i〛〚p + 1〛, {i, 1, m}], Table[dNN〚i〛〚p + 1〛, {i, 1, m}]}
(*k = 1 equivalent to zero order,
so we need to plus 1 in order to get the right order of output functions*)
14 TestFinished.cdf
Getting the value of the NonUniform B-Spline functions and its derivative
GetNUBS[knot_, ζ_] :=
Block{m, p, NN, dNN, t, term1N, term2N, term1DN, term2DN, k, i, II},
{m, p} = EvaluateKnot[knot];
NN = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
dNN = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
t = knot;
ForII = 1, II ≤ p + 1, II ++,
Fori = 1, i ≤ m, i ++,
NN〚i, 1〛 = Piecewise[{{1.0, t〚i〛 ≤ ζ ≤ t〚i + 1〛}}];
Fork = 2, k ≤ p + 1, k ++,
;
{Table[NN〚i〛〚p + 1〛, {i, 1, m}], Table[dNN〚i〛〚p + 1〛, {i, 1, m}]}
(*k = 1 equivalent to zero order,
so we need to plus 1 in order to get the right order of output functions*)
TestFinished.cdf 15
The NonUniform B-Spline functions and its high order derivative (for non-local
strain model)
NUBSHD[knot_, ζ_] :=
Block{m, p, NN, d1N, d2N, d3N, t, term1N, term2N, term1DN, term2DN, k, i, II},
{m, p} = EvaluateKnot[knot];
NN = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
d1N = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
d2N = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
d3N = Table[0, {i, 1, m + 1}, {j, 1, m + 1}];
t = knot;
ForII = 1, II ≤ p + 1, II ++,
Fori = 1, i ≤ m, i ++,
NN〚i, 1〛 = Piecewise[{{1, t〚i〛 ≤ ζ ≤ t〚i + 1〛}}];
(*k=1 equivalent to zero order, so we need to minus 1 with the degree
indicator in comparision with the fomulas k start with zero*)
Fork = 2, k ≤ p + 1, k ++,
;
{Table[NN〚i〛〚p + 1〛, {i, 1, m}], Table[d1N〚i〛〚p + 1〛, {i, 1, m}],
Table[d2N〚i〛〚p + 1〛, {i, 1, m}], Table[d3N〚i〛〚p + 1〛, {i, 1, m}]}
(*k = 1 equivalent to zero order, so we need to plus 1 in
order to get the right order of output functions*)
16 TestFinished.cdf
Getting the NonUniform B-Spline functions and its high order derivative (for
non-local strain model)
TestFinished.cdf 17
t = knot;
ForII = 1, II ≤ p + 1, II ++,
Fori = 1, i ≤ m, i ++,
NN〚i, 1〛 = Piecewise[{{1, t〚i〛 ≤ ζ ≤ t〚i + 1〛}}];
NNp〚i, 1〛 = Piecewise[{{1, t〚i〛 ≤ ζζ ≤ t〚i + 1〛}}];
Fork = 2, k ≤ p + 1, k ++,
;
{Table[NN〚i〛〚p + 1〛, {i, 1, m}], Table[d1N〚i〛〚p + 1〛, {i, 1, m}],
Table[d2N〚i〛〚p + 1〛, {i, 1, m}], Table[d3N〚i〛〚p + 1〛, {i, 1, m}]}
(*k = 1 equivalent to zero order, so we need to plus 1 in
order to get the right order of output functions*)
18 TestFinished.cdf
Assembly 1D
Assembly1D[Ke_, NInBC_] := Block[{m, i, j, k, n1, n2, m1, m2, Kt},
m = Max[NInBC];
Kt = Table[{{0, 0}, {0, 0}}, {i, 1, m}, {j, 1, m}];
{n1, n2} = Dimensions[NInBC];
For[i = 1, i ≤ n1, i ++,
For[j = 1, j ≤ n2, j ++,
For[k = 1, k ≤ n2, k ++,
If[NInBC〚i, j〛 ≠ - 1 && NInBC〚i, k〛 ≠ - 1,
Kt〚NInBC〚i〛〚j〛〛〚NInBC〚i〛〚k〛〛 = Kt〚NInBC〚i〛〚j〛〛〚NInBC〚i〛〚k〛〛 + Ke〚i〛〚j〛〚k〛];
]
]
];
Kt(*//ArrayFlatten*)
]
Getting the stiffness matrix in 1D (neglect the vertical displacement if the truss
system is 1D)
K1D[Kspace_] :=
Table[Kspace〚i, j〛, {i, 1, Length[Kspace], 2}, {j, 1, Length[Kspace], 2}];
NURBS 2D utility
;
{N2D, DNURBSζ1, DNURBSζ2}
TestFinished.cdf 23
;
{N2D, DNURBSζ1, DNURBSζ2}
24 TestFinished.cdf
Getting DOF2
DOF2[NN_] := Block{Nresult, i},
Nresult = Table[0, {i, 1, 2}, {j, 1, 2 Length[NN]}];
Fori = 1, i ≤ 2 Length[NN], i = i + 2,
i+1
Nresult〚1〛〚i〛 = NN ;
2
i+1
Nresult〚2〛〚i + 1〛 = NN ;
2
;
Nresult
Matrix Ultity - Change the matrix (support domain or macro element) into the
vector form
DomainVector[S_] := Block[{Nv, m, n, i, j, Sv},
{m, n} = {Dimensions[S]〚1〛, Dimensions[S]〚2〛};
Sv = Table[0, {i, 1, m n}];
For[i = 1, i ≤ m, i ++,
For[j = 1, j ≤ n, j ++,
Sv〚n (i - 1) + j〛 = S〚i〛〚j〛;
]
]; Sv
]
TestFinished.cdf 25
First Jacobian
GetJ1[ctp_, ζ1_, ζ2_] := Block[{ctpn, NN, Xa, DXζ1, DXζ2, NNe, Ne, DNζ1, DNζ2,
DNeζ1, DNeζ2, DNNeζ1, DNNeζ2, DetJ1, δζ1δX1, δζ1δX2, δζ2δX1, δζ2δX2},
ctpn = ctp // Flatten;
{NNe, DNNeζ1, DNNeζ2} = GetNURBS2D[knot1, knot2, ζ1, ζ2];
Ne = NVector[NNe];
DNeζ1 = NVector[DNNeζ1];
DNeζ2 = NVector[DNNeζ2];
DNζ1 = DOF2[DNeζ1];
DNζ2 = DOF2[DNeζ2];
DXζ1 = DNζ1.ctpn;
DXζ2 = DNζ2.ctpn;
(*First Jacobian*)
DetJ1 = DXζ1〚1〛 * DXζ2〚2〛 - DXζ1〚2〛 * DXζ2〚1〛;
DetJ1
]
TestFinished.cdf 29
Ne = NVector[NNe];
DNeζ1 = NVector[DNNeζ1];
DNeζ2 = NVector[DNNeζ2];
DNζ1 = DOF2[DNeζ1];
DNζ2 = DOF2[DNeζ2];
DXζ1 = DNζ1.ctpn;
DXζ2 = DNζ2.ctpn;
Ne = NVector[NNe];
DNeζ1 = NVector[DNNeζ1];
DNeζ2 = NVector[DNNeζ2];
DNζ1 = DOF2[DNeζ1];
DNζ2 = DOF2[DNeζ2];
DXDζ1 = DNζ1.ctpn;
DXDζ2 = DNζ2.ctpn;
Ne = NVector[NNe];
DNeζ1 = NVector[DNNeζ1];
DNeζ2 = NVector[DNNeζ2];
DNζ1 = DOF2[DNeζ1];
DNζ2 = DOF2[DNeζ2];
DXζ1 = DNζ1.ctpn;
DXζ2 = DNζ2.ctpn;
Function for changing the improved ϵeqivalent of the whole system to the
improved ϵeqivalent of system of element
Getϵeqims[ϵimeqs_, ϵInBC_] := Block[{m1, m2, ϵeqe, i, j},
{m1, m2} = Dimensions[ϵInBC];
ϵeqe = Table[0, {i, 1, m1}, {j, 1, m2}];
For[i = 1, i ≤ m1, i ++,
For[j = 1, j ≤ m2, j ++,
If[ϵInBC〚i, j〛 ≠ - 1, ϵeqe〚i, j〛 = ϵimeqs〚ϵInBC〚i, j〛〛]
];
]; ϵeqe
]
Forj = 1, j ≤ p, j ++,
ζ〚i〛 + 1 ζ〚j〛 + 1
{BB, J1} = GetB2D , , Xe;
2 2
ϵ〚i, j〛 = BB.(ue // Flatten);
;
;
NVector[ϵ]
34 TestFinished.cdf
Fori = 1, i ≤ p, i ++,
Forj = 1, j ≤ p, j ++,
ζ〚i〛 + 1 ζ〚j〛 + 1
{BB, J1} = GetB2D , , Xe〚k〛;
2 2
ζ〚i〛 + 1 ζ〚j〛 + 1
NN = GetN2D , ;
2 2
u〚i, j〛 = NN.(ue〚k〛 // Flatten);
ϵ〚i, j〛 = BB.(ue〚k〛 // Flatten);
;
;
us〚k〛 = NVector[u];
ϵs〚k〛 = NVector[ϵ];
; {us, ϵs}
GetϵeGP[uelement_, Xe_, p_] := Block{ζ, α, BB1, BB2, BB3, BB, BBt, ii, jj, ϵ, J1},
ϵ = Table[0, {i, 1, p}, {j, 1, p}];
{ζ, α} = Gausspoint[p];
Forii = 1, ii ≤ p, ii ++,
Forjj = 1, jj ≤ p, jj ++,
ζ〚ii〛 + 1 ζ〚jj〛 + 1
{BB, J1} = GetB2D , , Xe;
2 2
ϵ〚ii, jj〛 = BB.(uelement // Flatten);
;
;
NVector[ϵ]
TestFinished.cdf 35
Forjj = 1, jj ≤ p, jj ++,
ζ〚ii〛 + 1 ζ〚jj〛 + 1
NN = GetN1D ; ,
2 2
ϵ〚ii, jj〛 = Sum[NN〚k〛 ϵeqim〚k〛, {k, 1, Length[ϵeqim]}];
;
;
; NVector[ϵ]
Geometry
Original geometry
LL = 10 10-3 ;(*Length of the bar*)
ctp =
aa 3 aa aa 3 aa
LL, + Δaa, LL, , {LL, aa}, LL - bb, , LL - bb, , {LL - bb, aa},
2 4 2 4
aa 1 3 aa aa 1 aa
cc, , cc, , {0, aa}, cc, , cc, , {0, 0},
2 2 4 2 2 4
aa aa aa aa
LL - bb, , LL - bb, , {LL - bb, 0}, LL, - Δaa, LL, , {LL, 0};
2 4 2 4
Graphics[{Line[ctp], Line[Transpose[ctp]]}]
Dimensions[ctp]
{6, 3, 2}
36 TestFinished.cdf
H-refinement
k1 = NonUniformKnot[6, 1]; k2 = NonUniformKnot[3, 1];
k1
1 2 3 4
0, 0, , , , , 1, 1
5 5 5 5
k2
1
0, 0, , 1, 1
2
(*href*)
1 2 3 4
{ctpn, knot1n} = KnotInsertM2Dyctp, k1, sref58, 31, 6, 31, 8, , , , ;
5 5 5 5
1
{ctpn, knot2n} = KnotInsertM2Dxctpn, k2, sref28, 8, ;
2
(*
(*Get double*)
{ctpn,knot1n}=KnotInsertM2Dx[ctpn,knot1n,KnotReduce[knot1n]];
{ctpn,knot2n}=KnotInsertM2Dy[ctpn,knot2n,KnotReduce[knot2n]];
*)
knot2n // N
{0., 0., 0.0555556, 0.111111, 0.166667, 0.222222,
0.277778, 0.333333, 0.388889, 0.444444, 0.5, 0.555556, 0.611111,
0.666667, 0.722222, 0.777778, 0.833333, 0.888889, 0.944444, 1., 1.}
TestFinished.cdf 37
knot1n // N
{0., 0., 0.0222222, 0.0444444, 0.0666667, 0.0888889, 0.111111, 0.133333,
0.155556, 0.177778, 0.2, 0.20625, 0.2125, 0.21875, 0.225, 0.23125, 0.2375,
0.24375, 0.25, 0.25625, 0.2625, 0.26875, 0.275, 0.28125, 0.2875, 0.29375,
0.3, 0.30625, 0.3125, 0.31875, 0.325, 0.33125, 0.3375, 0.34375, 0.35, 0.35625,
0.3625, 0.36875, 0.375, 0.38125, 0.3875, 0.39375, 0.4, 0.428571, 0.457143,
0.485714, 0.514286, 0.542857, 0.571429, 0.6, 0.60625, 0.6125, 0.61875, 0.625,
0.63125, 0.6375, 0.64375, 0.65, 0.65625, 0.6625, 0.66875, 0.675, 0.68125,
0.6875, 0.69375, 0.7, 0.70625, 0.7125, 0.71875, 0.725, 0.73125, 0.7375, 0.74375,
0.75, 0.75625, 0.7625, 0.76875, 0.775, 0.78125, 0.7875, 0.79375, 0.8, 0.822222,
0.844444, 0.866667, 0.888889, 0.911111, 0.933333, 0.955556, 0.977778, 1., 1.}
EvaluateKnot[knot1n]
{90, 1}
Dimensions[ctpn]
{90, 19, 2}
ctpv = DomainVector[ctpn];
Dimensions[ctpv]
{1710, 2}
Graphics[{Line[ctpn], Line[Transpose[ctpn]]}]
Dimensions[ctpn]〚1〛
90
Dimensions[ctpn]〚2〛
19
Discretization geometry
NDomain = NURBS2DDomain[knot1n, knot2n];
m2D = macro2D[knot1n, knot2n];
DomainIn = N2DIndex[NDomain, m2D];
Dimensions[ctpe]
{1602, 4, 2}
Show[Domain, BC]
0.0012
0.0010
0.0008
0.0006
0.0004
Show[Domain, PC]
0.0012
0.0010
0.0008
0.0006
0.0004
uhIndexE = GetNIndex2D[DomainIndexE];
TestFinished.cdf 39
External force
GetForceE[NindexEBC_, BC_, PIndex_, PValues_] := Block[{PM, m, n, fexte, i, j, k},
{m, n} = Dimensions[NindexEBC];
PM = PIndex;
For[j = 1, j ≤ Length[PIndex], j ++,
For[i = 1, i ≤ Length[BC], i ++,
If[BC〚i〛 < PIndex〚j〛, PM〚j〛 = PM〚j〛 - 1]
];
];
fexte = Table[0, {i, 1, m}, {j, 1, n}];
For[k = 1, k ≤ Length[PIndex], k ++,
For[i = 1, i ≤ m, i ++,
For[j = 1, j ≤ n, j ++,
If[NindexEBC〚i, j〛 PM〚k〛, fexte〚i, j〛 = PValues〚k〛]
];
];
];
fexte
]
fuextee =
GetForceE[uhIndexEBC, ubcIndex, Table[PIndex〚i〛, {i, 1, Length[PIndex]}], {1, - 1}];
Interface points
aa
{InterfaceInd, InterfacePoints} = FindNodeΔX1.1 cc, LL - bb, , ctpn;
2
40 TestFinished.cdf
InterfaceInd
{172, 191, 210, 229, 248, 267, 286, 305, 324, 343, 362, 381, 400, 419, 438, 457, 476, 495,
514, 533, 552, 571, 590, 609, 628, 647, 666, 685, 704, 723, 742, 761, 932, 951, 970, 989,
1008, 1027, 1046, 1065, 1084, 1103, 1122, 1141, 1160, 1179, 1198, 1217, 1236, 1255,
1274, 1293, 1312, 1331, 1350, 1369, 1388, 1407, 1426, 1445, 1464, 1483, 1502, 1521}
Show[Domain, InC]
0.0012
0.0010
0.0008
0.0006
0.0004
0.0002
Length[InterfaceInd]
64
nn
ctpIe = Table0, i, 1, ;
4
i+1
DoIntIndE1D = {InterfaceInd〚i〛,
2
InterfaceInd〚i + 1〛, InterfaceInd〚nn - i〛, InterfaceInd〚nn - i + 1〛};
i+1 i+1 i+1
IntIndE2D = 2 IntIndE1D - 1, 2 IntIndE1D // Flatten // Sort;
2 2 2
i+1 i+1 nn
ctpIe = ctpvIntIndE1D , i, 1, , 2;
2 2 2
{IntIndE2D, ctpIe}
(*Manipulate[
Show[Concrete,Graphics[{PointSize[0.02],Point[ctpv〚i〛]}]],{i,1,1170}]*)
PreProcessing
CrossProduct[A_, B_] := Table[A〚i〛 B〚j〛, {i, 1, Length[A]}, {j, 1, Length[B]}]
Assembly functions
Assembly functions
AssemblyK[Ke_, InBC1_, InBC2_] := Block[{m, n, i, j, k, n1, n2, n3, m1, m2, Kt},
m = Max[InBC1];
n = Max[InBC2];
Kt = Table[0, {i, 1, m}, {j, 1, n}];
{n1, n2} = Dimensions[InBC1];
{n1, n3} = Dimensions[InBC2];
For[i = 1, i ≤ n1, i ++,
For[j = 1, j ≤ n2, j ++,
For[k = 1, k ≤ n3, k ++,
If[InBC1〚i, j〛 ≠ - 1 && InBC2〚i, k〛 ≠ - 1,
Kt〚InBC1〚i〛〚j〛〛〚InBC2〚i〛〚k〛〛 += Ke〚i〛〚j〛〚k〛;
];
];
];
];
Kt
]
42 TestFinished.cdf
External force
Assemblyf[fϵe_, InBC_] := Block[{m, i, j, k, n1, n2, m1, m2, fϵt},
m = Max[InBC];
fϵt = Table[0, {i, 1, m}];
{n1, n2} = Dimensions[InBC];
For[i = 1, i ≤ n1, i ++,
For[j = 1, j ≤ n2, j ++,
If[InBC〚i, j〛 ≠ - 1, fϵt〚InBC〚i〛〚j〛〛 += fϵe〚i〛〚j〛];
]
]
;
fϵt
]
h = 0.5 10-3 ;
(*Plane strain*)
EE 1-2ν
CC = {1 - ν, ν, 0}, {ν, 1 - ν, 0}, 0, 0, ;
(1 + ν) (1 - 2 ν) 2
Kn = 5 1010 ; Ks = Kn;
tult = 106 ;
Gn = 100;
tult
uns = ; uss = uns;
Kn
Gn
unc = 2 ; usc = unc;
tult
Solving process
External loading
R = Assemblyf[fuextee, uhIndexEBC];
Max[Abs[R]]
Max[Abs[fuextee]]
1
TestFinished.cdf 43
Intial value
GetKInitialS[ctpe_, ctpIe_, CC_] :=
Block{k, p, J1, ii, jj, ζG, α, Kuue, Kde, , B2D, Bc, LL, D, ζN},
p = 2;
{ζG, α} = Gausspoint[p];
Forii = 1, ii ≤ p, ii ++,
Forjj = 1, jj ≤ p, jj ++,
1 + ζG〚ii〛 1 + ζG〚jj〛
{B2D, J1} = GetB2D , , ctpe〚k〛; (*3x8*)
2 2
1
Kuue〚k〛 = Kuue〚k〛 + J1 h α〚ii〛 α〚jj〛 Transpose[B2D].CC.B2D;
4
;
;
;
ζN = {0, 1};
Fork = 1, k ≤ Length[ctpIe], k ++,
Forii = 1, ii ≤ p, ii ++,
{Bc, LL} = GetB1D[ζN〚ii〛, ctpIe〚k〛]; (*2x8*)
1
Kde〚k〛 = Kde〚k〛 + LL h Transpose[Bc].D.Bc;
2
;
;
{Kuue, Kde}
For[i = 1, i ≤ n, i ++,
For[ii = 1, ii ≤ p, ii ++,
{BB, LL} = GetB1D[ζp〚ii〛, ctpIe〚i〛];
w〚i, ii〛 = BB.(uIn〚i〛 // Flatten);
];
];
w
]
TestFinished.cdf 45
;
;
{ωs, ωn, qs, qn}
46 TestFinished.cdf
(*{u0eGP,ϵ0e}=GetuϵeGP[u0e,ctpe,p];*)
{u0, u0e, wIn, ωs, ωn, qs, qn}
]
sc = 0.01;
{u0, u0e, w0e, ω0s, ω0n, q0s, q0n} = GetInitial[ sc, Kuut, Kdt];
Max shear damage :0
Forii = 1, ii ≤ p, ii ++,
D = {{Ks (1 - ωs〚k, ii〛), 0}, {0, Kn (1 - ωn〚k, ii〛)}};
DD = {{- Ks wIne〚k, ii, 1〛 qs〚k, ii〛, 0}, {0, - Kn wIne〚k, ii, 2〛 qn〚k, ii〛}};
LL
Kde〚k〛 = Kde〚k〛 + h Transpose[Bc].D.Bc;
2
LL
Kdde〚k〛 = Kdde〚k〛 + h Transpose[Bc].DD.Bc;
2
;
;
{Kde, Kdde}
Δu = Inverse[Kt].Pt;
Norm[Δu]
RR = ;
Norm[u0]
Print["Convergence criterion :", RR];
u1 = u0 + Δu;
u1, λ1, u1e, w1e, ωs, ωn, qs, qn, u1eIn, Sλ, s, RR1, RR2, K1112, K2122, S2},
{Kde, Kdde} = GetK[ctpIe, w0e, ω0s, ω0n, q0s, q0n];
{Kdt, Kddt} = AssemblyCO[Kde, Kdde, IntIndE2DBC, uhIndexEBC];
Sλ = 104 ;
Max[Abs[K11], Abs[K12]]
S2 = ;
Max[Abs[K21], Abs[K22]]
P1 = λ0 R - (Kuut + Kdt).u0;
P2 = S2 (s0 - s);
Pt = {P1, P2} // Flatten;
Δ = Inverse[Kt].Pt;
Norm[Δu]
RR1 = ;
Norm[u0]
Norm[Δλ]
RR2 = ;
Norm[λ0]
u1 = u0 + Δu;
λ1 = λ0 + Δλ;
{u1, u1e, w1e, ωs, ωn, qs, qn, λ1, RR1, RR2}
{u0, u0e, w0e, ω0s, ω0n, q0s, q0n, λ0} = {u1, u1e, w1e, ω1s, ω1n, q1s, q1n, λ1};
Print["-------------------"];
};
;
{u1, u1e, w1e, ω1s, ω1n, q1s, q1n, λ1}
Max[Abs[K11], Abs[K12]]
SF = ;
Max[Abs[K21], Abs[K22]]
1
τ= R.(u0 λpre - upre λ0);
2
1
K21 = (R λpre);
2
1
K22 = - R.upre;
2
K1112 = Join[K11, Transpose[{K12}], 2];
K2122 = SF {K21, K22} // Flatten;
Kt = Join[K1112, {K2122}, 1];
P1 = λ0 R - (Kuut + Kdt).u0;
P2 = SF (τ0 - τ);
Pt = {P1, P2} // Flatten;
Δ = Inverse[Kt].Pt;
Norm[Δu]
RR1 = ;
Norm[u0]
Norm[Δλ]
RR2 = ;
Norm[λ0]
u1 = u0 + Δu;
λ1 = λ0 + Δλ;
{u1, u1e, w1e, ωs, ωn, qs, qn, λ1, RR1, RR2}
52 TestFinished.cdf
{u0, u0e, w0e, ω0s, ω0n, q0s, q0n, λ0} = {u1, u1e, w1e, ω1s, ω1n, q1s, q1n, λ1};
Print["-------------------"];
};
;
{u1, u1e, w1e, ω1s, ω1n, q1s, q1n, λ1}
Iteration data
(*pure newton raphson*)
usys = {0 u0e, u1e, u2e, u3e, u4e, u5e, u6e, u7e, u8e, u9e, u10e, u11e, u12e,
u13e, u14e, u15e, u16e, u17e, u18e, u19e, u20e, u21e, u22e, u23e, u24e,
u25e, u26e, u27e, u28e, u29e, u30e, u31e, u32e, u33e, u34e, u35e, u36e,
u37e, u38e, u39e, u40e, u41e, u42e, u43e, u44e, u45e, u46e, u47e, u48e,
u49e, u50e, u51e, u52e, u53e, u54e(*,u55e,u56e,u57e,u58e,u59e,u60e*)};
λsys = {0, λ1, λ2, λ3, λ4, λ5, λ6, λ7, λ8, λ9, λ10, λ11, λ12, λ13, λ14, λ15, λ16,
λ17, λ18, λ19, λ20, λ21, λ22, λ23, λ24, λ25, λ26, λ27, λ28, λ29, λ30, λ31,
λ32, λ33, λ34, λ35, λ36, λ37, λ38, λ39, λ40, λ41, λ42, λ43, λ44, λ45, λ46,
λ47, λ48, λ49, λ50, λ51, λ52, λ53, λ54(*,λ55,λ56,λ57,λ58,λ59,λ60*)};