SPEED
GET_ELEM_FROM_SURF.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
19
31
32 subroutine get_elem_from_surf(nnz_bc, cs_bc, n1, n2, n3, n4, ie_surf)
33
34
35 implicit none
36
37 integer*4 :: i, ne, nel, find
38 integer*4 :: nnz_bc, n1, n2, n3, n4, ie_surf
39
40 integer*4, dimension(:), allocatable :: vet
41 integer*4, dimension(0:nnz_bc) :: cs_bc
42
43
44
45 ne = cs_bc(0) - 1
46
47 do i = 1, ne
48 nel = cs_bc(i) - cs_bc(i-1) - 1
49 allocate(vet(nel))
50
51 vet = cs_bc(cs_bc(i-1) + 1 : cs_bc(i) - 1 )
52
53 if (find(nel, vet, n1) .eq. 1 .and. &
54 find(nel, vet, n2) .eq. 1 .and. &
55 find(nel, vet, n3) .eq. 1 .and. &
56 find(nel, vet, n4) .eq. 1 ) then
57
58 ie_surf = i
59 return
60 endif
61
62 deallocate(vet)
63 enddo
64
65 ie_surf = 0
66 return
67
68
69 end subroutine get_elem_from_surf
subroutine get_elem_from_surf(nnz_bc, cs_bc, n1, n2, n3, n4, ie_surf)
Find element index from verteces number.