OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_line_from_element.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_line_from_element ../starter/source/model/sets/create_line_from_element.F
25!||--- called by ------------------------------------------------------
26!|| create_box_clause ../starter/source/model/sets/create_box_clause.F
27!|| hm_set ../starter/source/model/sets/hm_set.F
28!|| insert_clause_in_set ../starter/source/model/sets/insert_clause_in_set.F
29!||--- calls -----------------------------------------------------
30!|| line_buffer ../starter/source/model/sets/line_buffer.F
31!||--- uses -----------------------------------------------------
32!|| message_mod ../starter/share/message_module/message_mod.F
33!||====================================================================
34 SUBROUTINE create_line_from_element(IXT ,IXP ,IXR ,CLAUSE ,DELBUF,
35 . GO_IN_ARRAY)
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
138 END
subroutine create_line_from_element(ixt, ixp, ixr, clause, delbuf, go_in_array)
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