OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
consider_edge.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| consider_edge_mod ../starter/source/spmd/domain_decomposition/consider_edge.F
25!||--- called by ------------------------------------------------------
26!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
27!|| find_nodes ../starter/source/spmd/domain_decomposition/grid2mat.F
28!||====================================================================
30!=======================================================================================================================
31! Module parameters
32!=======================================================================================================================
33 integer, parameter :: max_nb_nodes_per_elt = 10
34
35
36 contains
37!=======================================================================================================================
38! Subroutines
39!=======================================================================================================================
40!! \brief returns true if the edge between two elements should be created
41!||====================================================================
42!|| consider_edge ../starter/source/spmd/domain_decomposition/consider_edge.F
43!||--- called by ------------------------------------------------------
44!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
45!||====================================================================
46 function consider_edge(connectivity,nb_nodes_mini,nelem,e1,e2) result(bool)
47 implicit none
48! ----------------------------------------------------------------------------------------------------------------------
49! Arguments
50! ----------------------------------------------------------------------------------------------------------------------
51 integer, intent(in) :: nelem !< total number of elements
52 integer, intent(in) :: connectivity(max_nb_nodes_per_elt,nelem) !< list of nodes per element (may be zero)
53 integer, intent(in) :: nb_nodes_mini(nelem) !< minimum number of shared node per element to consider the edge
54 integer, intent(in) :: e1 !< index of the first element
55 integer, intent(in) :: e2 !< index of the second element
56! ----------------------------------------------------------------------------------------------------------------------
57! Local variables
58! ----------------------------------------------------------------------------------------------------------------------
59 logical :: bool
60 integer :: count
61 integer :: i,j
62! ----------------------------------------------------------------------------------------------------------------------
63! Body
64! ----------------------------------------------------------------------------------------------------------------------
65 bool = .false.
66 count = 0
67
68 i = 1
69 j = 1
70 do while (i <= max_nb_nodes_per_elt .and. j <= max_nb_nodes_per_elt)
71 if(connectivity(i,e1) == 0 .or. connectivity(j,e2) == 0) then
72 exit
73 elseif (connectivity(i,e1) == connectivity(j,e2)) then
74 count = count + 1
75 i = i + 1
76 j = j + 1
77 else if (connectivity(i,e1) > connectivity(j,e2)) then
78 i = i + 1
79 else
80 j = j + 1
81 end if
82 end do
83
84 if (count >= nb_nodes_mini(e1) .or. count >= nb_nodes_mini(e2)) then
85 bool = .true.
86 end if
87 end function
88
89!! \brief sort array of nodes per element in descending order
90!||====================================================================
91!|| sort_descending ../starter/source/spmd/domain_decomposition/consider_edge.F
92!||--- called by ------------------------------------------------------
93!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
94!||====================================================================
95 subroutine sort_descending(array)
96 implicit none
97! ----------------------------------------------------------------------------------------------------------------------
98! Arguments
99! ----------------------------------------------------------------------------------------------------------------------
100 integer, dimension(max_nb_nodes_per_elt), intent(inout) :: array
101! ----------------------------------------------------------------------------------------------------------------------
102! Local variables
103! ----------------------------------------------------------------------------------------------------------------------
104 integer :: i, j, temp
105! ----------------------------------------------------------------------------------------------------------------------
106! Body
107! ----------------------------------------------------------------------------------------------------------------------
108 do i = 1, max_nb_nodes_per_elt-1
109 do j = i+1, max_nb_nodes_per_elt
110 if (array(i) < array(j)) then
111 temp = array(i)
112 array(i) = array(j)
113 array(j) = temp
114 end if
115 end do
116 end do
117
118 end subroutine sort_descending
119
120
121
122 end module
logical function consider_edge(connectivity, nb_nodes_mini, nelem, e1, e2)
subroutine sort_descending(array)
integer, parameter max_nb_nodes_per_elt