-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathLinearElasticityFunctional.m
65 lines (46 loc) · 1.54 KB
/
LinearElasticityFunctional.m
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
61
62
63
64
65
classdef LinearElasticityFunctional < handle
properties (Access = public)
end
properties (Access = private)
mesh
material
end
properties (Access = private)
end
methods (Access = public)
function obj = LinearElasticityFunctional (cParams)
obj.init(cParams)
end
function val = compute(obj, uFun)
val = 1;
end
function Ju = computeGradient(obj, uFun)
strainVgt = SymGrad(uFun);
% strainVgt.ndimf = 4;
sigma = DDP(obj.material,strainVgt);
% sigma.ndimf = 3;
test = LagrangianFunction.create(obj.mesh, uFun.ndimf, uFun.order);
s.mesh = obj.mesh;
s.quadratureOrder = 3;
s.type = 'ShapeSymmetricDerivative';
RHS = RHSintegrator.create(s);
Ju = RHS.compute(sigma,test);
end
function Huu = computeHessian(obj, uFun)
s.type = 'ElasticStiffnessMatrix';
s.mesh = obj.mesh;
s.material = obj.material;
s.quadratureOrder = 3;
s.test = LagrangianFunction.create(obj.mesh,uFun.ndimf, 'P1');
s.trial = uFun;
LHS = LHSintegrator.create(s);
Huu = LHS.compute();
end
end
methods (Access = private)
function init(obj,cParams)
obj.mesh = cParams.mesh;
obj.material = cParams.material;
end
end
end