SPEED
MAKE_RAYLEIGH_DAMPING_MATRIX.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
31
32 subroutine make_rayleigh_damping_matrix(nn,ct,ww,dd,rho,&
33 A11,A12,A13,A21,A22,A23,&
34 A31,A32,A33,B11,B12,B13,&
35 B21,B22,B23,B31,B32,B33,&
36 GG1,GG2,GG3,DD1,DD2,DD3,&
37 mc_el)
38
39
40 implicit none
41
42 integer*4 :: nn
43 integer*4 :: i,j,k
44
45 real*8 :: a11,a12,a13,a21,a22,a23,a31,a32,a33
46 real*8 :: b11,b12,b13,b21,b22,b23,b31,b32,b33
47 real*8 :: gg1,gg2,gg3,dd1,dd2,dd3
48 real*8 :: dxdx,dxdy,dxdz,dydx,dydy,dydz,dzdx,dzdy,dzdz,det_j
49
50 real*8, dimension(nn) :: ct,ww
51
52 real*8, dimension(nn,nn) :: dd
53
54 real*8, dimension(nn,nn,nn) :: rho,gamma
55 real*8, dimension(nn,nn,nn) :: mc_el,mck_el
56
57
58
59 do k = 1,nn
60 do j = 1,nn
61 do i = 1,nn
62 dxdx = a11 +b12*ct(k) +b13*ct(j) &
63 + gg1*ct(j)*ct(k)
64 dydx = a21 +b22*ct(k) +b23*ct(j) &
65 + gg2*ct(j)*ct(k)
66 dzdx = a31 +b32*ct(k) +b33*ct(j) &
67 + gg3*ct(j)*ct(k)
68
69 dxdy = a12 +b11*ct(k) +b13*ct(i) &
70 + gg1*ct(k)*ct(i)
71 dydy = a22 +b21*ct(k) +b23*ct(i) &
72 + gg2*ct(k)*ct(i)
73 dzdy = a32 +b31*ct(k) +b33*ct(i) &
74 + gg3*ct(k)*ct(i)
75
76 dxdz = a13 +b11*ct(j) +b12*ct(i) &
77 + gg1*ct(i)*ct(j)
78 dydz = a23 +b21*ct(j) +b22*ct(i) &
79 + gg2*ct(i)*ct(j)
80 dzdz = a33 +b31*ct(j) +b32*ct(i) &
81 + gg3*ct(i)*ct(j)
82
83 det_j = dxdz * (dydx*dzdy - dzdx*dydy) &
84 - dydz * (dxdx*dzdy - dzdx*dxdy) &
85 + dzdz * (dxdx*dydy - dydx*dxdy)
86
87
88
89 mc_el(i,j,k) = rho(i,j,k) &
90 * det_j * ww(i) * ww(j) * ww(k)
91
92
93
94 enddo
95 enddo
96 enddo
97
98 return
99
100 end subroutine make_rayleigh_damping_matrix
101
subroutine make_rayleigh_damping_matrix(nn, ct, ww, dd, rho, a11, a12, a13, a21, a22, a23, a31, a32, a33, b11, b12, b13, b21, b22, b23, b31, b32, b33, gg1, gg2, gg3, dd1, dd2, dd3, mc_el)
Compute the Rayleigh damping matrix C = A0 M + A1 K, M = mass matrix, K= stiffness matrix.