SPEED
MAKE_MASS_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
53
54 subroutine make_mass_matrix(nn,xq,wq,dd,rho,&
55 AA11,AA12,AA13,AA21,AA22,AA23,&
56 AA31,AA32,AA33,BB11,BB12,BB13,&
57 BB21,BB22,BB23,BB31,BB32,BB33,&
58 GG1,GG2,GG3,DD1,DD2,DD3,&
59 mass)
60
61
62 implicit none
63
64 integer*4 :: nn
65 integer*4 :: i,j,k
66
67 real*8 :: aa11,aa12,aa13,aa21,aa22,aa23,aa31,aa32,aa33
68 real*8 :: bb11,bb12,bb13,bb21,bb22,bb23,bb31,bb32,bb33
69 real*8 :: gg1,gg2,gg3,dd1,dd2,dd3
70 real*8 :: dxdx,dxdy,dxdz,dydx,dydy,dydz,dzdx,dzdy,dzdz,det_j
71
72 real*8, dimension(nn) :: xq, wq
73
74 real*8, dimension(nn,nn) :: dd
75
76 real*8, dimension(nn,nn,nn) :: rho
77 real*8, dimension(nn,nn,nn) :: mass
78
79
80! ELEMENT NODAL MASS CALCULATION
81
82 do k = 1,nn
83 do j = 1,nn
84 do i = 1,nn
85 dxdx = aa11 + bb12*xq(k) + bb13*xq(j) + gg1*xq(j)*xq(k)
86 dydx = aa21 + bb22*xq(k) + bb23*xq(j) + gg2*xq(j)*xq(k)
87 dzdx = aa31 + bb32*xq(k) + bb33*xq(j) + gg3*xq(j)*xq(k)
88
89 dxdy = aa12 + bb11*xq(k) + bb13*xq(i) + gg1*xq(k)*xq(i)
90 dydy = aa22 + bb21*xq(k) + bb23*xq(i) + gg2*xq(k)*xq(i)
91 dzdy = aa32 + bb31*xq(k) + bb33*xq(i) + gg3*xq(k)*xq(i)
92
93 dxdz = aa13 + bb11*xq(j) + bb12*xq(i) + gg1*xq(i)*xq(j)
94 dydz = aa23 + bb21*xq(j) + bb22*xq(i) + gg2*xq(i)*xq(j)
95 dzdz = aa33 + bb31*xq(j) + bb32*xq(i) + gg3*xq(i)*xq(j)
96
97 det_j = dxdz * (dydx*dzdy - dzdx*dydy) &
98 - dydz * (dxdx*dzdy - dzdx*dxdy) &
99 + dzdz * (dxdx*dydy - dydx*dxdy)
100
101 mass(i,j,k) = rho(i,j,k) * det_j * wq(i)*wq(j)*wq(k)
102 enddo
103 enddo
104 enddo
105
106 return
107
108 end subroutine make_mass_matrix
109
subroutine make_mass_matrix(nn, xq, wq, dd, rho, aa11, aa12, aa13, aa21, aa22, aa23, aa31, aa32, aa33, bb11, bb12, bb13, bb21, bb22, bb23, bb31, bb32, bb33, gg1, gg2, gg3, dd1, dd2, dd3, mass)
Makes mass matrix.