1!
2!     CalculiX - A 3-dimensional finite element program
3!              Copyright (C) 1998-2021 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 evalshapefunc(xil,etl,xl2,nopes,p)
20!
21      implicit none
22!
23      integer i,j,nopes,iflag
24!
25      real*8  xl2(3,8),xs2(3,2),shp2(7,8),p(3),xsj2(3),
26     &  xil,etl
27!
28      iflag=1
29      do j=1,3
30         p(j)=0.d0
31      enddo
32      if(nopes.eq.8)then
33         call shape8q(xil,etl,xl2,xsj2,xs2,shp2,iflag)
34      elseif(nopes.eq.4)then
35         call shape4q(xil,etl,xl2,xsj2,xs2,shp2,iflag)
36      elseif(nopes.eq.6)then
37         call shape6tri(xil,etl,xl2,xsj2,xs2,shp2,iflag)
38      else
39         call shape3tri(xil,etl,xl2,xsj2,xs2,shp2,iflag)
40      endif
41      do i=1,nopes
42         do j=1,3
43            p(j)=p(j)+xl2(j,i)*shp2(4,i)
44         enddo
45      enddo
46!
47      return
48      end
49