SPEED
MAKE_GRID_NODES.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
32!
33! E.G. two elements grid
34! 1------2------3
35! | | | nnz = 15
36! | el.1 | el.2 | node_wgt(1) = node_wgt(3) = node_wgt(4) = node_wgt(6) = 1
37! 4------5------6 node_wgt(2) = node_wgt(5) = 2
38!
39! BEFORE
40! node_pointer(0) = 7 i4count(1) = 7
41! node_pointer(1) = 8 i4count(2) = 8
42! node_pointer(2) = 10 i4count(3) = 10
43! node_pointer(3) = 11 i4count(4) = 11
44! node_pointer(4) = 12 i4count(5) = 12
45! node_pointer(5) = 14 i4count(6) = 14
46! node_pointer(6) = 15 i4count(7) = 15
47! node_pointer(7) = ... = node_pointer(15) = 0
48!
49!
50! AFTER
51! node_pointer(0),...,node_pointer(6) unchanged
52! node_pointer(7) = 1 i4count(1) = 8
53! node 1 el. 1
54! node_pointer(8) = 1 i4count(2) = 10
55! node_pointer(9) = 2 i4count(3) = 11
56! node 2 el. 1 & 2
57! node_pointer(10) = 2 i4count(4) = 12
58! node 3 el. 2
59! node_pointer(11) = 1 i4count(5) = 14
60! node 4 el. 1
61! node_pointer(12) = 1 i4count(6) = 15
62! node_pointer(13) = 2 i4count(7) = 16
63! node 5 el. 1 & 2
64! node_pointer(14) = 2
65! node 6 el. 2
66! node_pointer(15) = 2
67! node 7 el. 2
68!
69!**************************************************************************************************
70
71
72 subroutine make_grid_nodes(nb_node,nb_elem,con_matrix,node_wgt,nnz,node_pointer)
73
74
75 implicit none
76
77 integer*4 :: nb_node,nb_elem,nnz
78 integer*4 :: i,j,ie
79
80 integer*4, dimension(:), allocatable :: i4count
81 integer*4, dimension(nb_node) :: node_wgt
82 integer*4, dimension(0:nnz) :: node_pointer
83
84 integer*4, dimension(nb_elem,9) :: con_matrix
85
86
87 allocate(i4count(nb_node))
88
89 node_pointer(0) = nb_node +1
90 do j = 1,nb_node
91 node_pointer(j) = node_pointer(j-1) + node_wgt(j)
92 enddo
93
94 do j = 1,nb_node
95 i4count(j) = node_pointer(j-1)
96 enddo
97
98
99 do ie = 1,nb_elem
100 do i = 1,8
101 j = con_matrix(ie,i +1)
102 node_pointer(i4count(j)) = ie
103 i4count(j) = i4count(j) +1
104 enddo
105 enddo
106
107 deallocate(i4count)
108
109 return
110
111 end subroutine make_grid_nodes
112
subroutine make_grid_nodes(nb_node, nb_elem, con_matrix, node_wgt, nnz
Makes pointer for connectivity of mesh nodes.