OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_node_from_rbody.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_rbody ../starter/source/model/sets/create_node_from_rbody.F
25!||--- called by ------------------------------------------------------
26!|| hm_set ../starter/source/model/sets/hm_set.F
27!||--- calls -----------------------------------------------------
28!|| tag_node_from_rbody ../starter/source/model/sets/tag_node_from_rbody.F
29!||--- uses -----------------------------------------------------
30!|| message_mod ../starter/share/message_module/message_mod.F
31!||====================================================================
32 SUBROUTINE create_node_from_rbody(RBY_MSN,CLAUSE)
33C-----------------------------------------------
34C M o d u l e s
35C-----------------------------------------------
36 USE message_mod
37 USE setdef_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C C o m m o n B l o c k s
44C-----------------------------------------------
45#include "com04_c.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 INTEGER, INTENT(IN), DIMENSION(2,NRBODY) :: RBY_MSN
50!
51 TYPE (SET_) :: CLAUSE
52C-----------------------------------------------
53C L o c a l V a r i a b l e s
54C-----------------------------------------------
55 INTEGER I,IND,LIMIT
56 INTEGER, ALLOCATABLE, DIMENSION(:) :: TAGNOD,CLAUSE_NODE
57 INTEGER IWORK(70000)
58 INTEGER, DIMENSION(:),ALLOCATABLE:: IDX,SORT
59C=======================================================================
60!
61 ALLOCATE(tagnod(numnod))
62 tagnod(:) = 0
63 ALLOCATE(clause_node(numnod))
64
65 ind=0
66!
67 ! RBODY
68 IF ( clause%NB_RBODY > 0 )
70 . clause%NB_RBODY ,clause%RBODY ,clause_node,ind,
71 . tagnod ,rby_msn )
72C-----------
73 limit = numnod/2
74 IF (ind < limit)THEN ! cheaper to use Order on small node groups
75 ALLOCATE(idx(2*ind))
76 ALLOCATE(sort(ind))
77 sort(1:ind) = clause_node(1:ind)
78 CALL my_orders(0,iwork,sort,idx,ind,1)
79
80 DO i=1,ind
81 clause_node(i) = sort(idx(i))
82 ENDDO
83 DEALLOCATE(idx)
84 DEALLOCATE(sort)
85 ELSE
86 ind = 0
87 DO i=1,numnod
88 IF (tagnod(i) == 1) THEN
89 ind = ind + 1
90 clause_node(ind) = i
91 ENDIF
92 ENDDO
93 ENDIF
94!
95! Decide whether the result is stored in an array or in the clause.
96! In certain cases it is useful to store in ARRAY.
97! Example : Clause with delete clause. Nodes must be recreated & merged...
98! ----------------------------------------------------------------------------
99 clause%NB_NODE = ind
100 IF(ALLOCATED( clause%NODE )) DEALLOCATE( clause%NODE )
101 ALLOCATE( clause%NODE(ind) )
102 clause%NODE(1:ind) = clause_node(1:ind)
103C-----------
104 DEALLOCATE(tagnod)
105 DEALLOCATE(clause_node)
106C-----------
107 RETURN
108 END
subroutine create_node_from_rbody(rby_msn, clause)
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
subroutine tag_node_from_rbody(nrb, rbody, clause_node, ind, tagnod, rby_msn)