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

Go to the source code of this file.

Functions/Subroutines

subroutine create_line_from_element (ixt, ixp, ixr, clause, delbuf, go_in_array)

Function/Subroutine Documentation

◆ create_line_from_element()

subroutine create_line_from_element ( integer, dimension(nixt,*), intent(in) ixt,
integer, dimension(nixp,*), intent(in) ixp,
integer, dimension(nixr,*), intent(in) ixr,
type (set_) clause,
type (set_scratch) delbuf,
logical go_in_array )

Definition at line 34 of file create_line_from_element.F.

36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE my_alloc_mod
40 USE setdef_mod
41 USE message_mod
43 use element_mod , only : nixt,nixp,nixr
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER, INTENT(IN) :: IXT(NIXT,*),IXP(NIXP,*),IXR(NIXR,*)
52!
53 TYPE (SET_) :: CLAUSE
54 TYPE (SET_SCRATCH) :: DELBUF
55 LOGICAL GO_IN_ARRAY
56C-----------------------------------------------
57C L o c a l V a r i a b l e s
58C-----------------------------------------------
59 INTEGER I, NIX, SZELMAX, IAD_LINE, NSEG, LINE_NENTITY
60 INTEGER IWORK(70000)
61!
62 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: ITRI
63 INTEGER, ALLOCATABLE, DIMENSION(:) :: INDEX, BUFTMPLINE
64C=======================================================================
65 delbuf%SZ_LINE = 0
66!
67!! SZELMAX = MAX(CLAUSE%NB_TRUSS,CLAUSE%NB_BEAM,CLAUSE%NB_SPRING)
68 szelmax = clause%NB_TRUSS + clause%NB_BEAM + clause%NB_SPRING
69 IF (szelmax == 0) RETURN
70!
71 line_nentity = 4 ! NOD1, NOD2, ELTYP, ELEM
72 ALLOCATE(buftmpline(szelmax*line_nentity))
73 ALLOCATE(itri(3,szelmax))
74 ALLOCATE(index(2*szelmax))
75!
76 iad_line = 1
77!------------------
78!----
79! ! temporary line segments got from elements
80 nseg = 0
81 CALL line_buffer(
82 . ixt ,ixp ,ixr ,buftmpline , nseg,
83 . iad_line ,clause )
84!----
85!
86 nix = line_nentity
87!
88 DO i=1,nseg
89 index(i)=i
90 itri(1,i) = buftmpline((i-1)*nix+1)
91 itri(2,i) = buftmpline((i-1)*nix+2)
92 itri(3,i) = buftmpline((i-1)*nix+4)
93 ENDDO
94 iwork(1:70000) = 0
95 CALL my_orders(0,iwork,itri,index,nseg,3)
96!---
97! clause surf allocation
98!---
99!------------------
100!
101! Decide whether the result is stored in an array or in the clause.
102! In certain cases it is useful to store in ARRAY.
103! Example : Clause with delete clause. Lines must be recreated & merged...
104! ----------------------------------------------------------------------------
105 IF (go_in_array .EQV. .true.) THEN
106 delbuf%SZ_LINE = nseg
107 ALLOCATE(delbuf%LINE(nseg,4))
108 DO i=1,nseg
109 delbuf%LINE(i,1) = buftmpline((index(i)-1)*nix+1)
110 delbuf%LINE(i,2) = buftmpline((index(i)-1)*nix+2)
111 delbuf%LINE(i,3) = buftmpline((index(i)-1)*nix+3)
112 delbuf%LINE(i,4) = buftmpline((index(i)-1)*nix+4)
113 ENDDO
114 ELSE
115 IF(ALLOCATED( clause%LINE_NODES )) DEALLOCATE( clause%LINE_NODES )
116 IF(ALLOCATED( clause%LINE_ELTYP )) DEALLOCATE( clause%LINE_ELTYP )
117 IF(ALLOCATED( clause%LINE_ELEM )) DEALLOCATE( clause%LINE_ELEM )
118!
119 clause%NB_LINE_SEG = nseg
120 CALL my_alloc(clause%LINE_NODES,nseg,2)
121 CALL my_alloc(clause%LINE_ELTYP,nseg)
122 CALL my_alloc(clause%LINE_ELEM,nseg)
123!
124 DO i=1,nseg
125 clause%LINE_NODES(i,1) = buftmpline((index(i)-1)*nix+1)
126 clause%LINE_NODES(i,2) = buftmpline((index(i)-1)*nix+2)
127 clause%LINE_ELTYP(i) = buftmpline((index(i)-1)*nix+3)
128 clause%LINE_ELEM(i) = buftmpline((index(i)-1)*nix+4)
129 ENDDO
130 ENDIF ! IF (GO_IN_ARRAY .EQV. .TRUE.)
131!------------------
132 IF(ALLOCATED(itri)) DEALLOCATE(itri)
133 IF(ALLOCATED(index)) DEALLOCATE(index)
134 IF(ALLOCATED(buftmpline)) DEALLOCATE(buftmpline)
135!------------------
136!-----------
137 RETURN
subroutine line_buffer(ixt, ixp, ixr, buftmpline, nseg, iad_line, clause)
Definition line_buffer.F:34
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82