1!
2!     CalculiX - A 3-dimensional finite element program
3!              Copyright (C) 1998 Guido Dhondt
4!
5!     This program is free software; you can redistribute it and/or
6!     modify it under the terms of the GNU General Public License as
7!     published by the Free Software Foundation(version 2);
8!
9!
10!     This program is distributed in the hope that it will be useful,
11!     but WITHOUT ANY WARRANTY; without even the implied warranty of
12!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13!     GNU General Public License for more details.
14!
15!     You should have received a copy of the GNU General Public License
16!     along with this program; if not, write to the Free Software
17!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18!
19      subroutine calcsurf(n1,n2,n3,cotet,surf)
20!
21!     calculates the surface of a tetrahedral face consisting
22!     of nodes n1,n2 and n3
23!
24      implicit none
25!
26      integer n1,n2,n3
27!
28      real*8 cotet(3,*),s(3),surf
29!
30      s(1)=(cotet(2,n2)-cotet(2,n1))*(cotet(3,n3)-cotet(3,n1))-
31     &     (cotet(3,n2)-cotet(3,n1))*(cotet(2,n3)-cotet(2,n1))
32      s(2)=(cotet(3,n2)-cotet(3,n1))*(cotet(1,n3)-cotet(1,n1))-
33     &     (cotet(1,n2)-cotet(1,n1))*(cotet(3,n3)-cotet(3,n1))
34      s(3)=(cotet(1,n2)-cotet(1,n1))*(cotet(2,n3)-cotet(2,n1))-
35     &     (cotet(2,n2)-cotet(2,n1))*(cotet(1,n3)-cotet(1,n1))
36      surf=dsqrt(s(1)*s(1)+s(2)*s(2)+s(3)*s(3))/2.d0
37!
38      return
39      end
40