OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
create_node_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_node_from_element ../starter/source/model/sets/create_node_from_element.F
25!||--- called by ------------------------------------------------------
26!|| hm_set ../starter/source/model/sets/hm_set.F
27!||--- calls -----------------------------------------------------
28!|| tag_node_from_1d_2d_elem ../starter/source/model/sets/tag_node_from_1D_2D_elem.F
29!|| tag_node_from_part_sphcel ../starter/source/model/sets/tag_node_from_part_sphcel.F90
30!|| tag_node_from_solid ../starter/source/model/sets/tag_node_from_solid.F
31!|| tag_node_from_spring ../starter/source/model/sets/tag_node_from_spring.F
32!||--- uses -----------------------------------------------------
33!|| message_mod ../starter/share/message_module/message_mod.F
34!|| tag_node_from_part_sphcel_mod ../starter/source/model/sets/tag_node_from_part_sphcel.F90
35!||====================================================================
37 . IXS ,IXS10 ,IXS20 ,IXS16 ,IXQ ,
38 . IXC ,IXTG ,IXT ,IXP ,IXR ,
39 . IXX ,KXX ,KXSP ,CLAUSE ,GEO,
40 . ARRAY ,SZ ,GO_IN_ARRAY )
41C-----------------------------------------------
42C M o d u l e s
43C-----------------------------------------------
44 USE message_mod
45 USE setdef_mod
46 USE tag_node_from_part_sphcel_mod
47 use element_mod , only : nixs,nixq,nixc,nixt,nixp,nixr,nixtg
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52C-----------------------------------------------
53C C o m m o n B l o c k s
54C-----------------------------------------------
55#include "com04_c.inc"
56#include "param_c.inc"
57#include "sphcom.inc"
58C-----------------------------------------------
59C D u m m y A r g u m e n t s
60C-----------------------------------------------
61 INTEGER IXS(NIXS,*),IXS10(6,*),IXS16(8,*),IXS20(12,*),
62 . IXQ(NIXQ,*),IXC(NIXC,*),IXTG(NIXTG,*),IXT(NIXT,*),
63 . IXP(NIXP,*),IXR(NIXR,*),IXX(*),KXX(*),KXSP(NISP,*)
64 my_real
65 . geo(npropg,*)
66!
67 TYPE (SET_) :: CLAUSE
68 INTEGER ARRAY(*),SZ
69 LOGICAL GO_IN_ARRAY
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER I,IND,LIMIT
74 INTEGER, ALLOCATABLE, DIMENSION(:) :: TAGNOD,CLAUSE_NODE
75 INTEGER IWORK(70000)
76 INTEGER, DIMENSION(:),ALLOCATABLE:: IDX,SORT
77C=======================================================================
78!
79 ALLOCATE(tagnod(numnod))
80 tagnod(:) = 0
81 ALLOCATE(clause_node(numnod))
82
83 ind=0
84!
85 ! SOLID
86 IF ( clause%NB_SOLID > 0 )
88 . ixs ,ixs10 ,ixs20 ,ixs16 ,clause%NB_SOLID ,
89 . clause%SOLID ,tagnod ,clause_node,ind )
90 ! QUAD
91 IF ( clause%NB_QUAD > 0 )
93 . ixq ,nixq ,2 ,5 ,clause%NB_QUAD,
94 . clause%QUAD ,tagnod,clause_node,ind )
95 ! SH4N
96 IF ( clause%NB_SH4N > 0 )
98 . ixc ,nixc ,2 ,5 ,clause%NB_SH4N,
99 . clause%SH4N ,tagnod,clause_node,ind )
100 ! SH3N
101 IF ( clause%NB_SH3N > 0 .AND. clause%NB_TRIA == 0 )
103 . ixtg ,nixtg ,2 ,4 ,clause%NB_SH3N,
104 . clause%SH3N ,tagnod,clause_node,ind )
105 ! TRIA
106 IF ( clause%NB_TRIA > 0 )
108 . ixtg ,nixtg ,2 ,4 ,clause%NB_TRIA,
109 . clause%TRIA ,tagnod,clause_node,ind )
110 ! TRUSS
111 IF ( clause%NB_TRUSS > 0 )
113 . ixt ,nixt ,2 ,3 ,clause%NB_TRUSS,
114 . clause%TRUSS,tagnod,clause_node,ind )
115 ! BEAM
116 IF ( clause%NB_BEAM > 0 )
118 . ixp ,nixp ,2 ,3 ,clause%NB_BEAM,
119 . clause%BEAM ,tagnod,clause_node,ind )
120 ! SPRING
121 IF ( clause%NB_SPRING > 0 )
123 . ixr ,geo ,clause%NB_SPRING ,clause%SPRING ,tagnod,clause_node,ind)
124!
125!
126! ATTENTION --- PARTS SPH are not inverted
127!
128!
129 ! SPH
130 IF ( clause%NB_SPHCEL > 0 )
131 . CALL tag_node_from_part_sphcel(
132 . clause%NB_SPHCEL ,clause%SPHCEL ,tagnod,clause_node,ind,numnod)
133! IF (NUMSPH > 0)
134! . CALL tagnod_part(kxsp,nisp,3,3,numsph,ipartsp,tagpart,tagnod)
135C-----------
136 limit = numnod/2
137 IF (ind < limit)THEN ! cheaper to use Order on small node groups
138 ALLOCATE(idx(2*ind))
139 ALLOCATE(sort(ind))
140 sort(1:ind) = clause_node(1:ind)
141 CALL my_orders(0,iwork,sort,idx,ind,1)
142
143 DO i=1,ind
144 clause_node(i) = sort(idx(i))
145 ENDDO
146 DEALLOCATE(idx)
147 DEALLOCATE(sort)
148 ELSE
149 ind = 0
150 DO i=1,numnod
151 IF (tagnod(i) == 1) THEN
152 ind = ind + 1
153 clause_node(ind) = i
154 ENDIF
155 ENDDO
156 ENDIF
157!
158! Decide whether the result is stored in an array or in the clause.
159! In certain cases it is useful to store in ARRAY.
160! Example : Clause with delete clause. Nodes must be recreated & merged...
161! ----------------------------------------------------------------------------
162 IF (go_in_array .EQV. .true.) THEN
163 sz = ind
164 array(1:ind) = clause_node(1:ind)
165 ELSE
166 ! clause node allocation
167 sz=0
168 clause%NB_NODE = ind
169 IF(ALLOCATED( clause%NODE )) DEALLOCATE( clause%NODE )
170 ALLOCATE( clause%NODE(ind) )
171 clause%NODE(1:ind) = clause_node(1:ind)
172 ENDIF
173C-----------
174 DEALLOCATE(tagnod)
175 DEALLOCATE(clause_node)
176C-----------
177 RETURN
178 END
subroutine create_node_from_element(ixs, ixs10, ixs20, ixs16, ixq, ixc, ixtg, ixt, ixp, ixr, ixx, kxx, kxsp, clause, geo, array, sz, go_in_array)
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
subroutine tag_node_from_1d_2d_elem(ix, nix, nix1, nix2, numel, elem, tagnod, clause_node, ind)
subroutine tag_node_from_solid(ixs, ixs10, ixs20, ixs16, numel, elem, tagnod, clause_node, ind)
subroutine tag_node_from_spring(ixr, geo, numelr, elem, tagnod, clause_node, ind)