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