10 subroutine mass_c2(etype, nn, ecoord, gausses, sec_opt, thick, mass, lumped, temperature)
16 integer(kind=kint),
intent(in) :: etype
17 integer(kind=kint),
intent(in) :: nn
18 real(kind=kreal),
intent(in) :: ecoord(2,nn)
19 real(kind=kreal),
intent(out) :: mass(:,:)
20 real(kind=kreal),
intent(out) :: lumped(:)
21 real(kind=kreal),
intent(in),
optional :: temperature(nn)
22 type(tmaterial),
pointer :: matl
23 integer(kind=kint),
parameter :: ndof = 2
24 integer(kind=kint) :: i, j, lx, sec_opt
25 real(kind=kreal) :: naturalcoord(2)
26 real(kind=kreal) :: func(nn), thick
27 real(kind=kreal) :: det, wg, rho
28 real(kind=kreal) :: d(2,2), n(2, nn*ndof), dn(2, nn*ndof)
29 real(kind=kreal) :: gderiv(nn,2)
34 matl => gausses(1)%pMaterial
36 if(sec_opt == 2) thick = 1.0d0
43 if(
present(temperature))
then
47 rho = matl%variables(m_density)
54 rho = matl%variables(m_density)
72 dn(1:2, 1:nn*ndof) = matmul(d, n(1:2, 1:nn*ndof))
75 mass(i,j) = mass(i,j) + dot_product(n(:,i), dn(:,j))*wg
84 subroutine mass_c3(etype, nn, ecoord, gausses, mass, lumped, temperature)
90 integer(kind=kint),
intent(in) :: etype
91 integer(kind=kint),
intent(in) :: nn
92 real(kind=kreal),
intent(in) :: ecoord(3,nn)
93 real(kind=kreal),
intent(out) :: mass(:,:)
94 real(kind=kreal),
intent(out) :: lumped(:)
95 real(kind=kreal),
intent(in),
optional :: temperature(nn)
96 type(tmaterial),
pointer :: matl
97 integer(kind=kint),
parameter :: ndof = 3
98 integer(kind=kint) :: i, j, lx
99 real(kind=kreal) :: naturalcoord(3)
100 real(kind=kreal) :: func(nn)
101 real(kind=kreal) :: det, wg, rho
102 real(kind=kreal) :: d(3, 3), n(3, nn*ndof), dn(3, nn*ndof)
103 real(kind=kreal) :: gderiv(nn, 3)
108 matl => gausses(1)%pMaterial
115 if(
present(temperature))
then
119 rho = matl%variables(m_density)
126 rho = matl%variables(m_density)
146 dn(1:3, 1:nn*ndof) = matmul(d, n(1:3, 1:nn*ndof))
149 mass(i,j) = mass(i,j) + dot_product(n(:,i), dn(:,j))*wg
161 integer(kind=kint) :: i, j, nn, ndof
162 real(kind=kreal) :: lumped(:), mass(:,:)
163 real(kind=kreal) :: diag_mass, total_mass
166 do i = 1, nn*ndof, ndof
167 do j = 1, nn*ndof, ndof
168 total_mass = total_mass + mass(j,i)
173 do i = 1, nn*ndof, ndof
174 diag_mass = diag_mass + mass(i,i)
177 diag_mass = 1.0d0/diag_mass
179 lumped(i) = lumped(i) + mass(i,i)*total_mass*diag_mass
184 mass(i,i) = lumped(i)
194 (ecoord(1,2) - ecoord(1,1))**2 + &
195 (ecoord(2,2) - ecoord(2,1))**2 + &
196 (ecoord(3,2) - ecoord(3,1))**2 )
202 real(kind=kreal) ::
get_face3, ecoord(3,20)
203 real(kind=kreal) :: a1, a2, a3
204 real(kind=kreal) :: x(3), y(3), z(3)
206 x(1) = ecoord(1,1); y(1) = ecoord(2,1); z(1) = ecoord(3,1)
207 x(2) = ecoord(1,2); y(2) = ecoord(2,2); z(2) = ecoord(3,2)
208 x(3) = ecoord(1,3); y(3) = ecoord(2,3); z(3) = ecoord(3,3)
210 a1 = (x(2) - x(1))**2 + (y(2) - y(1))**2 + (z(2) - z(1))**2
211 a2 = (x(1) - x(3))*(x(2) - x(1)) &
212 & + (y(1) - y(3))*(y(2) - y(1)) &
213 & + (z(1) - z(3))*(z(2) - z(1))
214 a3 = (x(3) - x(1))**2 + (y(3) - y(1))**2 + (z(3) - z(1))**2
222 integer(kind=kint) :: lx, ly
223 real(kind=kreal) ::
get_face4, ecoord(3,20)
224 real(kind=kreal) :: xg(2), ri, si, rp, sp, rm, sm, hr(4), hs(4)
225 real(kind=kreal) :: xr, xs, yr, ys, zr, zs
226 real(kind=kreal) :: x(4), y(4), z(4), det
228 x(1) = ecoord(1,1); y(1) = ecoord(2,1); z(1) = ecoord(3,1)
229 x(2) = ecoord(1,2); y(2) = ecoord(2,2); z(2) = ecoord(3,2)
230 x(3) = ecoord(1,3); y(3) = ecoord(2,3); z(3) = ecoord(3,3)
231 x(4) = ecoord(1,4); y(4) = ecoord(2,4); z(4) = ecoord(3,4)
233 xg(1) = -0.5773502691896258d0
259 xr = hr(1)*x(1) + hr(2)*x(2) + hr(3)*x(3) + hr(4)*x(4)
260 xs = hs(1)*x(1) + hs(2)*x(2) + hs(3)*x(3) + hs(4)*x(4)
261 yr = hr(1)*y(1) + hr(2)*y(2) + hr(3)*y(3) + hr(4)*y(4)
262 ys = hs(1)*y(1) + hs(2)*y(2) + hs(3)*y(3) + hs(4)*y(4)
263 zr = hr(1)*z(1) + hr(2)*z(2) + hr(3)*z(3) + hr(4)*z(4)
264 zs = hs(1)*z(1) + hs(2)*z(2) + hs(3)*z(3) + hs(4)*z(4)
266 det = (yr*zs - zr*ys)**2 + (zr*xs - xr*zs)**2 + (xr*ys - yr*xs)**2