SPEED
MAKE_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
55
56
57 subroutine make_damping_matrix(nn,ct,ww,dd,rho,gamma,&
58 A11,A12,A13,A21,A22,A23,&
59 A31,A32,A33,B11,B12,B13,&
60 B21,B22,B23,B31,B32,B33,&
61 GG1,GG2,GG3,DD1,DD2,DD3,&
62 mc_el,mck_el)
63
64
65 implicit none
66
67 integer*4 :: nn
68 integer*4 :: i,j,k
69
70 real*8 :: a11,a12,a13,a21,a22,a23,a31,a32,a33
71 real*8 :: b11,b12,b13,b21,b22,b23,b31,b32,b33
72 real*8 :: gg1,gg2,gg3,dd1,dd2,dd3
73 real*8 :: dxdx,dxdy,dxdz,dydx,dydy,dydz,dzdx,dzdy,dzdz,det_j
74
75 real*8, dimension(nn) :: ct,ww
76
77 real*8, dimension(nn,nn) :: dd
78
79 real*8, dimension(nn,nn,nn) :: rho,gamma
80 real*8, dimension(nn,nn,nn) :: mc_el,mck_el
81
82
83
84 do k = 1,nn
85 do j = 1,nn
86 do i = 1,nn
87 dxdx = a11 +b12*ct(k) +b13*ct(j) &
88 + gg1*ct(j)*ct(k)
89 dydx = a21 +b22*ct(k) +b23*ct(j) &
90 + gg2*ct(j)*ct(k)
91 dzdx = a31 +b32*ct(k) +b33*ct(j) &
92 + gg3*ct(j)*ct(k)
93
94 dxdy = a12 +b11*ct(k) +b13*ct(i) &
95 + gg1*ct(k)*ct(i)
96 dydy = a22 +b21*ct(k) +b23*ct(i) &
97 + gg2*ct(k)*ct(i)
98 dzdy = a32 +b31*ct(k) +b33*ct(i) &
99 + gg3*ct(k)*ct(i)
100
101 dxdz = a13 +b11*ct(j) +b12*ct(i) &
102 + gg1*ct(i)*ct(j)
103 dydz = a23 +b21*ct(j) +b22*ct(i) &
104 + gg2*ct(i)*ct(j)
105 dzdz = a33 +b31*ct(j) +b32*ct(i) &
106 + gg3*ct(i)*ct(j)
107
108 det_j = dxdz * (dydx*dzdy - dzdx*dydy) &
109 - dydz * (dxdx*dzdy - dzdx*dxdy) &
110 + dzdz * (dxdx*dydy - dydx*dxdy)
111
112
113
114 mc_el(i,j,k) = 2 * gamma(i,j,k) * rho(i,j,k) &
115 * det_j * ww(i) * ww(j) * ww(k)
116
117 mck_el(i,j,k) = (gamma(i,j,k)**2) * rho(i,j,k) &
118 * det_j * ww(i) * ww(j) * ww(k)
119
120
121 enddo
122 enddo
123 enddo
124
125 return
126
127 end subroutine make_damping_matrix
128
subroutine make_damping_matrix(nn, ct, ww, dd, rho, gamma, 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, mck_el)
Make damping matrices.