This page was generated from unit-6.1.4-shells/shell.ipynb.
6.1.4 Shell model¶
Simple Naghdi shell model¶
Geometric model and meshing. Clamped on left boundary.
[1]:
from netgen.csg import *
from ngsolve import *
from ngsolve.internal import visoptions
from ngsolve.webgui import Draw
order = 3
geo = CSGeometry()
cyl = Cylinder(Pnt(0,0,0),Pnt(1,0,0),0.4).bc("cyl")
left = Plane(Pnt(0,0,0), Vec(-1,0,0))
right = Plane(Pnt(1,0,0), Vec(1,0,0))
finitecyl = cyl * left * right
geo.AddSurface(cyl, finitecyl)
geo.NameEdge(cyl,left, "left")
geo.NameEdge(cyl,right, "right")
mesh = Mesh(geo.GenerateMesh(maxh=0.2))
mesh.Curve(order)
Draw(mesh)
Start Findpoints
main-solids: 1
Found points 8
Analyze spec points
Find edges
2 edges found
Check intersecting edges
CalcLocalH: 26 Points 0 Elements 0 Surface Elements
Start Findpoints
Analyze spec points
Find edges
2 edges found
Check intersecting edges
Start Findpoints
Analyze spec points
Find edges
2 edges found
Check intersecting edges
Surface 1 / 1
load internal triangle rules
Surface meshing done
0 illegal triangles
Optimize Surface
Edgeswapping, topological
Smoothing
Combine improve
Smoothing
Edgeswapping, metric
Smoothing
Combine improve
Smoothing
Edgeswapping, metric
Smoothing
Combine improve
Smoothing
142 elements, 84 points
SplitSeparateFaces
Remove Illegal Elements
Volume Optimization
CombineImprove
ImproveMesh
SplitImprove
ImproveMesh
SwapImprove
SwapImprove2
ImproveMesh
CombineImprove
ImproveMesh
SplitImprove
ImproveMesh
SwapImprove
SwapImprove2
ImproveMesh
CombineImprove
ImproveMesh
SplitImprove
ImproveMesh
SwapImprove
SwapImprove2
ImproveMesh
Update mesh topology
Update clusters
Curve elements, order = 3
Update clusters
Curving edges
Curving faces
[1]:
BaseWebGuiScene
Use Lagrangian elements for displacement \(u \in [H^1(S)]^3\) and the rotation \(\beta \in [H^1(S)]^3\). It might lock for small thickness \(t\).
[2]:
fes1 = VectorH1(mesh, order=order, dirichlet_bbnd="left")
fes = FESpace( [fes1,fes1] )
u,beta = fes.TrialFunction()
nsurf = specialcf.normal(3)
thickness = 0.1
Membrane energy
Shear energy
Bending energy
[3]:
Ptau = Id(3) - OuterProduct(nsurf,nsurf)
Ftau = grad(u).Trace() + Ptau
Ctautau = Ftau.trans * Ftau
Etautau = 0.5*(Ctautau - Ptau)
eps_beta = Sym(Ptau*grad(beta).Trace())
gradu = grad(u).Trace()
ngradu = gradu.trans*nsurf
#Average normal vector for affine geometry
if order == 1:
gfn = GridFunction(fes1)
gfn.Set(nsurf,definedon=mesh.Boundaries(".*"))
else:
gfn = nsurf
a = BilinearForm(fes, symmetric=True)
#membran energy
a += Variation( thickness*InnerProduct(Etautau, Etautau)*ds )
#bending energy
a += Variation( 0.5*thickness**3*InnerProduct(eps_beta-Sym(gradu.trans*grad(gfn)),eps_beta-Sym(gradu.trans*grad(gfn)))*ds )
#shearing energy
a += Variation( thickness*(ngradu-beta)*(ngradu-beta)*ds )
# external force
factor = Parameter(0.0)
a += Variation( -thickness*factor*y*u[1]*ds )
gfu = GridFunction(fes)
Increase the load step-wise, solve the non-linear problem by Newton’s method. First and second order derivatives are computed by automatic differentiation.
[4]:
with TaskManager():
for loadstep in range(6):
print("loadstep ", loadstep)
factor.Set (1.5*(loadstep+1))
solvers.NewtonMinimization(a, gfu, printing=False)
loadstep 0
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
loadstep 1
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
loadstep 2
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
loadstep 3
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
loadstep 4
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
loadstep 5
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
Assemble linearization
assemble BND element 142/142
call umfpack ... done
[5]:
Draw(gfu.components[1], mesh, "rotations", deformation=gfu.components[0])
Draw(gfu.components[0], mesh, "disp")
[5]:
BaseWebGuiScene
Nonlinear Koiter shell model¶
We present the method described in [Neunteufel and Schöberl. The Hellan-Herrmann-Johnson method for nonlinear shells. Computers & Structures , 225 (2019), 106109].
[6]:
from math import pi
from ngsolve.meshes import MakeStructuredSurfaceMesh
thickness = 0.1
L = 12
W = 1
E, nu = 1.2e6, 0
moment = IfPos(x-L+1e-6, 1, 0)*50*pi/3
mapping = lambda x,y,z : (L*x, W*y,0)
mesh = MakeStructuredSurfaceMesh(quads=False, nx=10, ny=1, mapping=mapping)
Draw(mesh)
Update mesh topology
Update clusters
[6]:
BaseWebGuiScene
To avoid membrane locking Regge interpolation as in [Neunteufel and Schöberl. Avoiding Membrane Locking with Regge Interpolation] can be used.
[7]:
# False -> membrane locking
regge = True
order = 2
fes1 = HDivDivSurface(mesh, order=order-1, discontinuous=True)
fes2 = VectorH1(mesh, order=order, dirichletx_bbnd="left", dirichlety_bbnd="left|bottom", dirichletz_bbnd="left")
fes3 = HDivSurface(mesh, order=order-1, orderinner=0, dirichlet_bbnd="left")
if regge:
fes4 = HCurlCurl(mesh, order=order-1, discontinuous=True)
fes = FESpace( [fes2,fes1,fes3,fes4,fes4] )
u,sigma,hyb,C,R = fes.TrialFunction()
sigma, hyb, C, R = sigma.Trace(), hyb.Trace(), C.Trace(), R.Operator("dualbnd")
else:
fes = FESpace( [fes2,fes1,fes3] )
u,sigma,hyb = fes.TrialFunction()
sigma, hyb = sigma.Trace(), hyb.Trace()
fesVF = VectorFacetSurface(mesh, order=order)
b = fesVF.TrialFunction()
b.dims=(3,)
gfclamped = GridFunction(FacetSurface(mesh,order=0))
gfclamped.Set(1,definedon=mesh.BBoundaries("left"))
solution = GridFunction(fes, name="solution")
averednv = GridFunction(fesVF)
averednv_start = GridFunction(fesVF)
nsurf = specialcf.normal(mesh.dim)
t = specialcf.tangential(mesh.dim)
nel = Cross(nsurf, t)
Ptau = Id(mesh.dim) - OuterProduct(nsurf,nsurf)
Ftau = grad(u).Trace() + Ptau
Ctau = Ftau.trans*Ftau
Etautau = 0.5*(Ctau - Ptau)
nphys = Normalize(Cof(Ftau)*nsurf)
tphys = Normalize(Ftau*t)
nelphys = Cross(nphys,tphys)
Hn = CoefficientFunction( (u.Operator("hesseboundary").trans*nphys), dims=(3,3) )
cfnphys = Normalize(Cof(Ptau+grad(solution.components[0]))*nsurf)
cfn = Normalize(CoefficientFunction( averednv.components ))
cfnR = Normalize(CoefficientFunction( averednv_start.components ))
pnaverage = Normalize( cfn - (tphys*cfn)*tphys )
setvalues element 22/22
WARNING: kwarg 'orderinner' is an undocumented flags option for class <class 'ngsolve.comp.HDivSurface'>, maybe there is a typo?
[8]:
bfF = BilinearForm(fesVF, symmetric=True)
bfF += Variation( (0.5*b*b - ((1-gfclamped)*cfnphys+gfclamped*nsurf)*b)*ds(element_boundary=True))
rf = averednv.vec.CreateVector()
bfF.Apply(averednv.vec, rf)
bfF.AssembleLinearization(averednv.vec)
invF = bfF.mat.Inverse(fesVF.FreeDofs(), inverse="sparsecholesky")
averednv.vec.data -= invF*rf
averednv_start.vec.data = averednv.vec
Assemble linearization
assemble BND element 20/20
[9]:
gradn = specialcf.Weingarten(3) #grad(nsurf)
def MaterialNorm(mat, E, nu):
return E/(1-nu**2)*((1-nu)*InnerProduct(mat,mat)+nu*Trace(mat)**2)
def MaterialNormInv(mat, E, nu):
return (1+nu)/E*(InnerProduct(mat,mat)-nu/(2*nu+1)*Trace(mat)**2)
[10]:
bfA = BilinearForm(fes, symmetric=True, condense=True)
bfA += Variation( (-6/thickness**3*MaterialNormInv(sigma, E, nu) \
+ InnerProduct(sigma, Hn + (1-nphys*nsurf)*gradn))*ds ).Compile()
if regge:
bfA += Variation( 0.5*thickness*MaterialNorm(C, E, nu)*ds )
bfA += Variation( InnerProduct(C-Etautau, R)*ds(element_vb=BND) )
bfA += Variation( InnerProduct(C-Etautau, R)*ds(element_vb=VOL) )
else:
bfA += Variation( 0.5*thickness*MaterialNorm(Etautau, E, nu)*ds )
bfA += Variation( -(acos(nel*cfnR)-acos(nelphys*pnaverage)-hyb*nel)*(sigma*nel)*nel*ds(element_boundary=True) ).Compile()
par = Parameter(0.0)
bfA += Variation( -par*moment*(hyb*nel)*ds(element_boundary=True) )
Compiled CF:
N5ngfem13ProxyFunctionE
N5ngfem35T_MultVecVecSameCoefficientFunctionILi9EEE
N5ngfem24ScaleCoefficientFunctionE
N5ngfem24ScaleCoefficientFunctionE
N5ngfem13ProxyFunctionE
N5ngfem28TransposeCoefficientFunctionE
N5ngfem27ConstantCoefficientFunctionE
N5ngfem13ProxyFunctionE
N5ngfem27IdentityCoefficientFunctionE
N5ngfem17cl_NormalVectorCFILi3EEE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem28TransposeCoefficientFunctionE
N5ngfem29MultMatMatCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem13cl_BinaryOpCFINS_11GenericPlusEEE
N5ngfem27CofactorCoefficientFunctionILi3EEE
N5ngfem29MultMatVecCoefficientFunctionE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem29MultMatVecCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem27ConstantCoefficientFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem15cl_WeingartenCFILi3EEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_11GenericPlusEEE
N5ngfem31T_MultVecVecCoefficientFunctionILi9EEE
N5ngfem13cl_BinaryOpCFINS_11GenericPlusEEE
inputs =
0:
1: 0
2: 1
3: 2
4:
5: 4
6:
7:
8:
9:
10: 9
11: 10
12: 9
13: 12
14: 13
15: 11 14
16: 8 15
17: 7 16
18: 17
19: 18 9
20: 19
21: 6 20
22: 21 19
23: 5 22
24: 23
25:
26: 22 9
27: 25 26
28:
29: 27 28
30: 24 29
31: 0 30
32: 3 31
Compiled CF:
N5ngfem17cl_NormalVectorCFILi3EEE
N5ngfem21cl_TangentialVectorCFILi3EEE
N5ngfem31CrossProductCoefficientFunctionE
N5ngfem27ConstantCoefficientFunctionE
N6ngcomp21ComponentGridFunctionE
N6ngcomp21ComponentGridFunctionE
N6ngcomp21ComponentGridFunctionE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
N5ngfem12cl_UnaryOpCFI11GenericACosEE
N5ngfem27ConstantCoefficientFunctionE
N5ngfem13ProxyFunctionE
N5ngfem27IdentityCoefficientFunctionE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem28TransposeCoefficientFunctionE
N5ngfem29MultMatMatCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem13cl_BinaryOpCFINS_11GenericPlusEEE
N5ngfem27CofactorCoefficientFunctionILi3EEE
N5ngfem29MultMatVecCoefficientFunctionE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem27ConstantCoefficientFunctionE
N5ngfem29MultMatVecCoefficientFunctionE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem31CrossProductCoefficientFunctionE
N5ngfem27ConstantCoefficientFunctionE
N5ngfem27ConstantCoefficientFunctionE
N6ngcomp21ComponentGridFunctionE
N6ngcomp21ComponentGridFunctionE
N6ngcomp21ComponentGridFunctionE
N5ngfem28VectorialCoefficientFunctionE
N5ngfem12cl_UnaryOpCFI15GenericIdentityEE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem23NormCoefficientFunctionE
N5ngfem13cl_BinaryOpCFINS_10GenericDivEEE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
N5ngfem12cl_UnaryOpCFI11GenericACosEE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem13ProxyFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
N5ngfem13cl_BinaryOpCFINS_12GenericMinusEEE
N5ngfem24ScaleCoefficientFunctionE
N5ngfem13ProxyFunctionE
N5ngfem29MultMatVecCoefficientFunctionE
N5ngfem30MultScalVecCoefficientFunctionE
N5ngfem31T_MultVecVecCoefficientFunctionILi3EEE
inputs =
0:
1:
2: 0 1
3:
4:
5:
6:
7: 4 5 6
8: 7
9: 8
10: 3 9
11: 10 8
12: 2 11
13: 12
14:
15:
16:
17: 0
18: 17
19: 0
20: 19
21: 20
22: 18 21
23: 16 22
[11]:
par.Set(0.1)
bfF.Apply(averednv.vec, rf)
bfF.AssembleLinearization(averednv.vec)
invF.Update()
averednv.vec.data -= invF*rf
with TaskManager():
solvers.Newton(bfA, solution, inverse="sparsecholesky", maxerr=1e-10, maxit=20)
24: 15 23
25: 24
26: 25 0
27: 26
28: 14 27
29: 28 26
30:
31: 24 1
32: 31
33: 30 32
34: 33 31
35: 29 34
36:
37:
38:
39:
40:
41: 38 39 40
42: 41
43: 42
44: 37 43
45: 44 42
46: 34 45
47: 46 34
48: 45 47
49: 48
50: 36 49
51: 50 48
52: 35 51
53: 52
54: 13 53
55:
56: 55 2
57: 54 56
58: 57
59:
60: 59 2
61: 58 60
62: 61 2
Assemble linearization
assemble BND element 20/20
Newton iteration 0
Assemble linearization
assemble BND element 20/20
err = 1.8137993642227015
Newton iteration 1
Assemble linearization
assemble BND element 20/20
err = 106.02124724191505
Newton iteration 2
Assemble linearization
assemble BND element 20/20
err = 6.43045109141144
Newton iteration 3
Assemble linearization
assemble BND element 20/20
err = 0.07240855383266113
Newton iteration 4
Assemble linearization
assemble BND element 20/20
err = 4.902465522340852e-06
Newton iteration 5
Assemble linearization
assemble BND element 20/20
err = 1.041641886062636e-11
[12]:
Draw(solution.components[0], mesh, "disp", deformation=solution.components[0])
[12]:
BaseWebGuiScene
[13]:
numsteps=10
with TaskManager():
for steps in range(1,numsteps):
par.Set((steps+1)/numsteps)
print("Loadstep =", steps+1, ", F/Fmax =", (steps+1)/numsteps*100, "%")
bfF.Apply(averednv.vec, rf)
bfF.AssembleLinearization(averednv.vec)
invF.Update()
averednv.vec.data -= invF*rf
(res,numit) = solvers.Newton(bfA, solution, inverse="sparsecholesky", printing=False, maxerr=2e-10)
Loadstep = 2 , F/Fmax = 20.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 3 , F/Fmax = 30.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 4 , F/Fmax = 40.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 5 , F/Fmax = 50.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 6 , F/Fmax = 60.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 7 , F/Fmax = 70.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 8 , F/Fmax = 80.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 9 , F/Fmax = 90.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Loadstep = 10 , F/Fmax = 100.0 %
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
Assemble linearization
assemble BND element 20/20
[14]:
Draw(solution.components[0], mesh, "disp", deformation=solution.components[0])
[14]:
BaseWebGuiScene
[ ]: