OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_node_from_seg.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!|| create_node_from_seg ../starter/source/model/sets/create_node_from_seg.f
25!||--- called by ------------------------------------------------------
26!|| hm_set ../starter/source/model/sets/hm_set.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
30!|| message_mod ../starter/share/message_module/message_mod.F
31!|| submodel_mod ../starter/share/modules1/submodel_mod.F
32!||====================================================================
33 SUBROUTINE create_node_from_seg( CLAUSE )
34C-----------------------------------------------
35C ROUTINE DESCRIPTION :
36C ===================
37C Create PART Clause from LIST
38C------------------------------------------------------------------
39C DUMMY ARGUMENTS DESCRIPTION:
40C ===================
41C
42C NAME DESCRIPTION
43C
44C CLAUSE (SET structure) Clause to be treated
45C============================================================================
46C-----------------------------------------------
47C M o d u l e s
48C-----------------------------------------------
49 USE setdef_mod
50 USE submodel_mod
51 USE message_mod
53C-----------------------------------------------
54C I m p l i c i t T y p e s
55C-----------------------------------------------
56#include "implicit_f.inc"
57C-----------------------------------------------
58C C o m m o n B l o c k s
59C-----------------------------------------------
60#include "com04_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 TYPE (SET_) :: CLAUSE
65C-----------------------------------------------
66C L o c a l V a r i a b l e s
67C-----------------------------------------------
68 INTEGER I,J,IND,NOD(4),NB_SEG_NODE,NB_SEG,LIMIT
69 INTEGER, ALLOCATABLE, DIMENSION(:) :: TAGNOD,CLAUSE_NODE
70 INTEGER IWORK(70000)
71 INTEGER, DIMENSION(:),ALLOCATABLE:: IDX,SORT
72C=======================================================================
73!
74 nb_seg_node = 4 ! by default surf SEG
75 nb_seg = clause%NB_SURF_SEG ! only one surf seg par CLAUSE
76
77 IF (clause%NB_SURF_SEG == 0) THEN
78 nb_seg_node = 2 ! line SEG
79 nb_seg = clause%NB_LINE_SEG ! only one line seg par CLAUSE
80 ENDIF
81!
82 ALLOCATE(tagnod(numnod))
83 tagnod(:) = 0
84 ALLOCATE(clause_node(numnod))
85
86 ind = 0
87
88 IF (clause%NB_SURF_SEG > 0) THEN
89 ! none from surf of SEG
90 DO i=1,nb_seg
91 DO j=1,nb_seg_node
92 nod(j) = clause%SURF_NODES(i,j)
93 IF(tagnod(nod(j)) == 0)THEN
94 tagnod(nod(j)) = 1
95 ind = ind+1
96 clause_node(ind) = nod(j)
97 ENDIF
98 ENDDO
99 ENDDO
100
101 ELSE
102 ! none from line of SEG
103 DO i=1,nb_seg
104 DO j=1,nb_seg_node
105 nod(j) = clause%LINE_NODES(i,j)
106 IF(tagnod(nod(j)) == 0)THEN
107 tagnod(nod(j)) = 1
108 ind = ind+1
109 clause_node(ind) = nod(j)
110 ENDIF
111 ENDDO
112 ENDDO
113
114 ENDIF ! IF (CLAUSE%NB_SURF_SEG > 0)
115
116!-------
117 limit = numnod/2
118 IF (ind < limit)THEN ! cheaper to use Order on small node groups
119 ALLOCATE(idx(2*ind))
120 ALLOCATE(sort(ind))
121 sort(1:ind) = clause_node(1:ind)
122 CALL my_orders(0,iwork,sort,idx,ind,1)
123
124 DO i=1,ind
125 clause_node(i) = sort(idx(i))
126 ENDDO
127 DEALLOCATE(idx)
128 DEALLOCATE(sort)
129 ELSE
130 ind = 0
131 DO i=1,numnod
132 IF (tagnod(i) == 1) THEN
133 ind = ind + 1
134 clause_node(ind) = i
135 ENDIF
136 ENDDO
137 ENDIF
138
139!
140 ! clause node allocation
141 clause%NB_NODE = ind
142 IF(ALLOCATED( clause%NODE )) DEALLOCATE( clause%NODE )
143 ALLOCATE( clause%NODE(ind) )
144 clause%NODE(1:ind) = clause_node(1:ind)
145
146C-----------
147 DEALLOCATE(tagnod)
148 DEALLOCATE(clause_node)
149C-----------
150 RETURN
151 END
subroutine create_node_from_seg(clause)
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
program starter
Definition starter.F:39