OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
fill_clause_rbody_box.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!|| fill_clause_rbody_box ../starter/source/model/sets/fill_clause_rbody_box.F
25!||--- called by ------------------------------------------------------
26!|| create_rbody_box ../starter/source/model/sets/create_rbody_box.F
27!||--- calls -----------------------------------------------------
28!|| rbody_box ../starter/source/model/sets/fill_clause_rbody_box.F
29!|| set_merge_simple ../starter/source/model/sets/set_merge_simple.F
30!||--- uses -----------------------------------------------------
31!|| message_mod ../starter/share/message_module/message_mod.F
32!|| set_mod ../starter/share/modules1/set_mod.F
33!||====================================================================
34 SUBROUTINE fill_clause_rbody_box( IBOX ,X ,SKEW ,SET_TITLE ,KEYSET,
35 * BOXLIST, BOXLIST_SIZE,
36 * BOXNDS, SZ_BOXNDS ,RBY_MSN)
37
38C-----------------------------------------------
39C M o d u l e s
40C-----------------------------------------------
42 USE message_mod
44 USE set_mod , ONLY : set_add
45C-----------------------------------------------
46C I m p l i c i t T y p e s
47C-----------------------------------------------
48#include "implicit_f.inc"
49C-----------------------------------------------
50C C o m m o n B l o c k s
51C-----------------------------------------------
52#include "com04_c.inc"
53#include "param_c.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 TYPE (BOX_) , DIMENSION(NBBOX) :: IBOX
58
59 INTEGER BOXNDS(*),BOXLIST(*)
60 INTEGER SZ_BOXNDS, BOXLIST_SIZE
61 INTEGER, INTENT(IN), DIMENSION(2,NRBODY) :: RBY_MSN
62
63 my_real x(3,*),skew(lskew,*)
64
65 CHARACTER(LEN=NCHARFIELD):: KEYSET
66 CHARACTER(LEN=NCHARTITLE):: SET_TITLE
67C-----------------------------------------------
68C L o c a l V a r i a b l e s
69C-----------------------------------------------
70 INTEGER I,B_NDS_SIZE,NB_RESULT,
71 . ID,IB,NB_BOX_OF_BOX,J,CLAUSE_OPERATOR
72 LOGICAL BOOL
73 INTEGER, DIMENSION(:) , ALLOCATABLE :: B_NDS,RESULT
74C-----------------------------------------------
75 ALLOCATE(b_nds(nrbody))
76 ALLOCATE(result(nrbody))
77
78!
79 ! Tag nodes from boxes
80 ! ---------------------
81 clause_operator = set_add
82 sz_boxnds = 0
83 DO i=1,boxlist_size
84 ib = boxlist(i)
85 b_nds_size = 0
86
87 CALL rbody_box( ib ,
88 * ibox ,x ,skew ,set_title ,keyset,
89 * b_nds, b_nds_size,rby_msn)
90
91
92 CALL set_merge_simple( boxnds, sz_boxnds ,
93 * b_nds, b_nds_size ,
94 * result, nb_result ,
95 * clause_operator)
96
97 boxnds(1:nb_result) = result(1:nb_result)
98 sz_boxnds = nb_result
99 ENDDO ! DO I=1,BOXLIST_SIZE
100
101C-------
102 RETURN
103 END
104
105
106!||====================================================================
107!|| rbody_box ../starter/source/model/sets/fill_clause_rbody_box.F
108!||--- called by ------------------------------------------------------
109!|| fill_clause_rbody_box ../starter/source/model/sets/fill_clause_rbody_box.F
110!||--- calls -----------------------------------------------------
111!|| set_merge_simple ../starter/source/model/sets/set_merge_simple.F
112!|| simple_rbody_box ../starter/source/model/sets/simple_rbody_box.F
113!||--- uses -----------------------------------------------------
114!|| message_mod ../starter/share/message_module/message_mod.F
115!|| set_mod ../starter/share/modules1/set_mod.F
116!||====================================================================
117 RECURSIVE SUBROUTINE rbody_box( IB ,
118 * IBOX ,X ,SKEW ,SET_TITLE ,KEYSET,
119 * BOXNDS, SZ_BOXNDS,RBY_MSN)
120C-----------------------------------------------
121C ROUTINE DESCRIPTION :
122C ===================
123C Recursive routine - Go through tree and fill the Node Box array
124C
125C------------------------------------------------------------------
126C DUMMY ARGUMENTS DESCRIPTION:
127C ===================
128C
129C NAME DESCRIPTION
130C
131C IB Recursive indice / Current Box to treat
132C IBOX IBOX Structure
133C SKEW Skew Structure
134C SET_TITLE Title for Error message
135C KEYSET KEYSET for Error message
136C BOXNDS merged node array
137C SZ_BOXNDS number of stacked nodes in BOXNDS
138C============================================================================
139C-----------------------------------------------
140C M o d u l e s
141C-----------------------------------------------
142 USE optiondef_mod
143 USE message_mod
145 USE set_mod , ONLY : set_add,set_delete
146C-----------------------------------------------
147C I m p l i c i t T y p e s
148C-----------------------------------------------
149#include "implicit_f.inc"
150C-----------------------------------------------
151C C o m m o n B l o c k s
152C-----------------------------------------------
153#include "com04_c.inc"
154#include "param_c.inc"
155C-----------------------------------------------
156C D u m m y A r g u m e n t s
157C-----------------------------------------------
158 TYPE (box_) , DIMENSION(NBBOX) :: ibox
159 INTEGER, INTENT(IN), DIMENSION(2,NRBODY) :: rby_msn
160
161 INTEGER boxnds(*)
162 INTEGER ib,sz_boxnds
163
164 my_real
165 . x(3,*),skew(lskew,*)
166
167 CHARACTER(LEN=NCHARFIELD) :: keyset
168 CHARACTER(LEN=NCHARTITLE)::set_title
169C-----------------------------------------------
170C L o c a l V a r i a b l e s
171C-----------------------------------------------
172 INTEGER i,b_nds_size,nb_result,
173 . nb_box_of_box,j,new_box,clause_operator
174 LOGICAL bool
175 INTEGER, DIMENSION(:) , ALLOCATABLE :: b_nds,result
176
177C-----------------------------------------------
178
179
180 nb_box_of_box = ibox(ib)%NBOXBOX
181
182 IF ( nb_box_of_box == 0 ) THEN
183
184 ! Fill SIMPLE Boxes
185 ! ---------------------
186 sz_boxnds = 0
187 CALL simple_rbody_box(ibox, x, skew, ib,
188 * boxnds, sz_boxnds,rby_msn)
189
190 ELSE
191 ALLOCATE(b_nds(nrbody))
192 ALLOCATE(result(nrbody))
193
194
195 DO i=1,nb_box_of_box
196
197 j = ibox(ib)%IBOXBOX(i) ! could be negative
198 new_box = abs(j)
199
200 b_nds_size=0
201
202 CALL rbody_box ( new_box ,
203 * ibox ,x ,skew ,set_title ,keyset,
204 * b_nds, b_nds_size ,rby_msn)
205
206 IF (j < 0)THEN
207 clause_operator = set_delete
208 ELSE
209 clause_operator = set_add
210 ENDIF
211
212 CALL set_merge_simple( boxnds, sz_boxnds ,
213 * b_nds, b_nds_size ,
214 * result, nb_result ,
215 * clause_operator)
216
217 boxnds(1:nb_result) = result(1:nb_result)
218 sz_boxnds = nb_result
219 ENDDO
220
221 ENDIF
222
223C-------
224 RETURN
225 END
226
227
228
229
230
231
232
#define my_real
Definition cppsort.cpp:32
subroutine fill_clause_rbody_box(ibox, x, skew, set_title, keyset, boxlist, boxlist_size, boxnds, sz_boxnds, rby_msn)
recursive subroutine rbody_box(ib, ibox, x, skew, set_title, keyset, boxnds, sz_boxnds, rby_msn)
integer, parameter nchartitle
integer, parameter ncharfield
integer, parameter set_add
add operator
Definition set_mod.F:47
integer, parameter set_delete
delete operator
Definition set_mod.F:48
subroutine set_merge_simple(set_entity, nb_set_entity, clause_entity, nb_clause_entity, result, nb_result, clause_operator)
subroutine simple_rbody_box(ibox, x, skew, ib, nd_array, nd_size, rby_msn)