OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_node_from_rbody.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine create_node_from_rbody (rby_msn, clause)

Function/Subroutine Documentation

◆ create_node_from_rbody()

subroutine create_node_from_rbody ( integer, dimension(2,nrbody), intent(in) rby_msn,
type (set_) clause )

Definition at line 32 of file create_node_from_rbody.F.

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
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)
subroutine tagnod(ix, nix, nix1, nix2, numel, iparte, tagbuf, npart)
Definition tagnod.F:29