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 elementpernodef(iponoel,inoel,lakonf,ipkonf,konf,nef)
20!
21      implicit none
22!
23      character*8 lakonf(*)
24!
25      integer iponoel(*),inoel(2,*),ipkonf(*),konf(*),i,j,nef,
26     &  inoelfree,nope,indexe,node
27!
28!
29!
30!     determining the elements belonging to the nodes of
31!     the elements
32!
33      inoelfree=1
34      do i=1,nef
35         if(ipkonf(i).lt.0) cycle
36         if(lakonf(i)(1:1).ne.'F') cycle
37         if(lakonf(i)(4:4).eq.'8') then
38            nope=8
39         elseif(lakonf(i)(4:4).eq.'4') then
40            nope=4
41         elseif(lakonf(i)(4:4).eq.'6') then
42            nope=6
43         else
44            cycle
45         endif
46         indexe=ipkonf(i)
47         do j=1,nope
48            node=konf(indexe+j)
49            inoel(1,inoelfree)=i
50            inoel(2,inoelfree)=iponoel(node)
51            iponoel(node)=inoelfree
52            inoelfree=inoelfree+1
53         enddo
54      enddo
55!
56      return
57      end
58