SPEED
GET_AREA_FACE.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine get_area_face (x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, surf, ielem)
 Computes area of a face (quad).
 

Function/Subroutine Documentation

◆ get_area_face()

subroutine get_area_face ( real*8, intent(in)  x1,
real*8, intent(in)  x2,
real*8, intent(in)  x3,
real*8, intent(in)  x4,
real*8, intent(in)  y1,
real*8, intent(in)  y2,
real*8, intent(in)  y3,
real*8, intent(in)  y4,
real*8, intent(in)  z1,
real*8, intent(in)  z2,
real*8, intent(in)  z3,
real*8, intent(in)  z4,
real*8, intent(out)  surf,
integer*4, intent(in)  ielem 
)

Computes area of a face (quad).

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]x1vertex x-coordinate defining a face of the element ielem
[in]x2vertex x-coordinate defining a face of the element ielem
[in]x3vertex x-coordinate defining a face of the element ielem
[in]x4vertex x-coordinate defining a face of the element ielem
[in]y1vertex y-coordinate defining a face of the element ielem
[in]y2vertex y-coordinate defining a face of the element ielem
[in]y3vertex y-coordinate defining a face of the element ielem
[in]y4vertex y-coordinate defining a face of the element ielem
[in]z1vertex z-coordinate defining a face of the element ielem
[in]z2vertex z-coordinate defining a face of the element ielem
[in]z3vertex z-coordinate defining a face of the element ielem
[in]z4vertex z-coordinate defining a face of the element ielem
[in]indexof the element
[out]surfarea of a face of the hex ielem

Definition at line 38 of file GET_AREA_FACE.f90.

39
40 implicit none
41
42 integer*4, intent(in) :: ielem
43
44 real*8 :: a,b,c,vx,vy,vz,wx,wy,wz,xbar,ybar,zbar
45 real*8, intent(in) :: x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4
46 real*8, intent(out) :: surf
47
48 surf = 0.d0
49
50 xbar = (x1 + x2 + x3 + x4)/4.d0
51 ybar = (y1 + y2 + y3 + y4)/4.d0
52 zbar = (z1 + z2 + z3 + z4)/4.d0
53
54 vx = x4 - x1
55 vy = y4 - y1
56 vz = z4 - z1
57
58 wx = xbar - x1
59 wy = ybar - y1
60 wz = zbar - z1
61
62
63 a = vy*wz - vz*wy
64 b = -vx*wz + vz*wx
65 c = vx*wy - vy*wx
66
67
68
69 surf = surf + 0.5d0*dsqrt(a**2.d0 + b**2.d0 + c**2.d0)
70
71 vx = x2 - x1
72 vy = y2 - y1
73 vz = z2 - z1
74
75 wx = xbar - x1
76 wy = ybar - y1
77 wz = zbar - z1
78
79
80 a = vy*wz - vz*wy
81 b = -vx*wz + vz*wx
82 c = vx*wy - vy*wx
83
84 surf = surf + 0.5d0*dsqrt(a**2.d0 + b**2.d0 + c**2.d0)
85
86 vx = x2 - x3
87 vy = y2 - y3
88 vz = z2 - z3
89
90 wx = xbar - x3
91 wy = ybar - y3
92 wz = zbar - z3
93
94
95 a = vy*wz - vz*wy
96 b = -vx*wz + vz*wx
97 c = vx*wy - vy*wx
98
99 surf = surf + 0.5d0*dsqrt(a**2.d0 + b**2.d0 + c**2.d0)
100
101 vx = x4 - x3
102 vy = y4 - y3
103 vz = z4 - z3
104
105 wx = xbar - x3
106 wy = ybar - y3
107 wz = zbar - z3
108
109
110 a = vy*wz - vz*wy
111 b = -vx*wz + vz*wx
112 c = vx*wy - vy*wx
113
114 surf = surf + 0.5d0*dsqrt(a**2.d0 + b**2.d0 + c**2.d0)
115

Referenced by setup_dg().

Here is the caller graph for this function: