SPEED
READ_FILEMESH_LOC.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
29
30 subroutine read_filemesh_loc(file_grid, nn_loc, xx_loc, yy_loc, zz_loc, &
31 loc_n_num)
32
33 implicit none
34
35 character*70 :: file_grid
36 character*110 :: input_line
37
38 integer*4 :: nn_loc
39 integer*4 :: inode
40 integer*4 :: nnode,nelem,i,ic,status
41
42 integer*4, dimension(nn_loc) :: loc_n_num
43
44 real*8 :: xx,yy,zz
45 real*8, dimension(nn_loc), intent(inout) :: xx_loc(nn_loc), yy_loc(nn_loc), zz_loc(nn_loc)
46
47 inode = 0
48 status = 0
49
50 open(23,file=file_grid)
51
52 do
53 read(23,'(A)') input_line
54 if (input_line(1:1) .ne. '#') exit
55 enddo
56
57 read(input_line,*) nnode, nelem
58
59 do i = 1,nnode
60 read(23,*) inode, xx, yy, zz
61 if (inode.ne.i) then
62 status = 1
63 endif
64
65 call get_indloc_from_indglo(loc_n_num, nn_loc, inode, ic)
66
67
68 if (ic .ne. 0) then
69 xx_loc(ic) = xx
70 yy_loc(ic) = yy
71 zz_loc(ic) = zz
72 endif
73
74 enddo
75
76
77 close(23)
78
79 return
80
81 end subroutine read_filemesh_loc
82
subroutine get_indloc_from_indglo(local_el, nel_loc, ie, ic)
Returns local id from global id.
subroutine read_filemesh_loc(file_grid, nn_loc, xx_loc, yy_loc, zz
Reads the local mesh.