11"""
22Trigonometric 2D MMS on [0,L]^2 with linear-elasticity constitutive law:
33
4- u_ex(x, y) = ( sin(pi x / L) cos(pi y / L),
5- cos(pi x / L) sin(pi y / L) )
4+ u_ex(x, y) = A * ( sin(pi x / L) cos(pi y / L),
5+ cos(pi x / L) sin(pi y / L) )
66
77 sigma = lambda tr(eps) I + 2 mu eps,
88 with (lambda, mu) selected per dim (plane stress vs plane strain).
1616 quad_q1_rule , tri_p1_rule )
1717
1818
19+ # Amplitude of the oscillation functions
20+ AMPLITUDE = 0.1
21+
22+
1923class Trigonometric (MMSCase2D ):
2024 name = "trigonometric"
2125 plot_label = (r"$u_x = \sin(\pi x/L)\cos(\pi y/L),\ "
@@ -25,16 +29,18 @@ class Trigonometric(MMSCase2D):
2529 source_quadrature_tri = staticmethod (tri_p1_rule (3 ))
2630
2731 def u_ex (self , x , y , L ):
32+ A = AMPLITUDE
2833 k = np .pi / L
29- return (np .sin (k * x ) * np .cos (k * y ),
30- np .cos (k * x ) * np .sin (k * y ))
34+ return (A * np .sin (k * x ) * np .cos (k * y ),
35+ A * np .cos (k * x ) * np .sin (k * y ))
3136
3237 def grad_u_ex (self , x , y , L ):
38+ A = AMPLITUDE
3339 k = np .pi / L
34- dux_dx = k * np .cos (k * x ) * np .cos (k * y )
35- dux_dy = - k * np .sin (k * x ) * np .sin (k * y )
36- duy_dx = - k * np .sin (k * x ) * np .sin (k * y )
37- duy_dy = k * np .cos (k * x ) * np .cos (k * y )
40+ dux_dx = A * k * np .cos (k * x ) * np .cos (k * y )
41+ dux_dy = - A * k * np .sin (k * x ) * np .sin (k * y )
42+ duy_dx = - A * k * np .sin (k * x ) * np .sin (k * y )
43+ duy_dy = A * k * np .cos (k * x ) * np .cos (k * y )
3844 return np .array ([[dux_dx , dux_dy ],
3945 [duy_dx , duy_dy ]])
4046
@@ -71,6 +77,7 @@ def apply_bcs(self, Beam, nodes_2d, L, dim):
7177
7278 def source (self , x , y , E , nu , L , dim ):
7379 lam , mu = lame (E , nu , dim )
80+ A = AMPLITUDE
7481 k = np .pi / L
7582 ux = np .sin (k * x ) * np .cos (k * y )
7683 uy = np .cos (k * x ) * np .sin (k * y )
@@ -84,7 +91,7 @@ def source(self, x, y, E, nu, L, dim):
8491 + mu * (d2ux_dyy + d2uy_dxy ))
8592 fy = - (mu * (d2ux_dxy + d2uy_dxx ) + lam * d2ux_dxy
8693 + (lam + 2 * mu ) * d2uy_dyy )
87- return (fx , fy )
94+ return (A * fx , A * fy )
8895
8996
9097mms = Trigonometric ()
0 commit comments