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
47C-----------------------------------------------
48C I m p l i c i t T y p e s
49C-----------------------------------------------
50#include "implicit_f.inc"
51C-----------------------------------------------
52C C o m m o n B l o c k s
53C-----------------------------------------------
54#include "com04_c.inc"
55#include "param_c.inc"
56#include "sphcom.inc"
57C-----------------------------------------------
58C D u m m y A r g u m e n t s
59C-----------------------------------------------
60 INTEGER IXS(NIXS,*),IXS10(6,*),IXS16(8,*),IXS20(12,*),
61 . IXQ(NIXQ,*),IXC(NIXC,*),IXTG(NIXTG,*),IXT(NIXT,*),
62 . IXP(NIXP,*),IXR(NIXR,*),IXX(*),KXX(*),KXSP(NISP,*)
63 my_real
64 . geo(npropg,*)
65!
66 TYPE (SET_) :: CLAUSE
67 INTEGER ARRAY(*),SZ
68 LOGICAL GO_IN_ARRAY
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 INTEGER I,IND,LIMIT
73 INTEGER, ALLOCATABLE, DIMENSION(:) :: TAGNOD,CLAUSE_NODE
74 INTEGER IWORK(70000)
75 INTEGER, DIMENSION(:),ALLOCATABLE:: IDX,SORT
76C=======================================================================
77!
78 ALLOCATE(tagnod(numnod))
79 tagnod(:) = 0
80 ALLOCATE(clause_node(numnod))
81
82 ind=0
83!
84 ! SOLID
85 IF ( clause%NB_SOLID > 0 )
87 . ixs ,ixs10 ,ixs20 ,ixs16 ,clause%NB_SOLID ,
88 . clause%SOLID ,tagnod ,clause_node,ind )
89 ! QUAD
90 IF ( clause%NB_QUAD > 0 )
92 . ixq ,nixq ,2 ,5 ,clause%NB_QUAD,
93 . clause%QUAD ,tagnod,clause_node,ind )
94 ! SH4N
95 IF ( clause%NB_SH4N > 0 )
97 . ixc ,nixc ,2 ,5 ,clause%NB_SH4N,
98 . clause%SH4N ,tagnod,clause_node,ind )
99 ! SH3N
100 IF ( clause%NB_SH3N > 0 .AND. clause%NB_TRIA == 0 )
102 . ixtg ,nixtg ,2 ,4 ,clause%NB_SH3N,
103 . clause%SH3N ,tagnod,clause_node,ind )
104 ! TRIA
105 IF ( clause%NB_TRIA > 0 )
107 . ixtg ,nixtg ,2 ,4 ,clause%NB_TRIA,
108 . clause%TRIA ,tagnod,clause_node,ind )
109 ! TRUSS
110 IF ( clause%NB_TRUSS > 0 )
112 . ixt ,nixt ,2 ,3 ,clause%NB_TRUSS,
113 . clause%TRUSS,tagnod,clause_node,ind )
114 ! BEAM
115 IF ( clause%NB_BEAM > 0 )
117 . ixp ,nixp ,2 ,3 ,clause%NB_BEAM,
118 . clause%BEAM ,tagnod,clause_node,ind )
119 ! SPRING
120 IF ( clause%NB_SPRING > 0 )
122 . ixr ,geo ,clause%NB_SPRING ,clause%SPRING ,tagnod,clause_node,ind)
123!
124!
125! ATTENTION --- PARTS SPH are not inverted
126!
127!
128 ! SPH
129 IF ( clause%NB_SPHCEL > 0 )
130 . CALL tag_node_from_part_sphcel(
131 . clause%NB_SPHCEL ,clause%SPHCEL ,tagnod,clause_node,ind,numnod)
132! IF (NUMSPH > 0)
133! . CALL TAGNOD_PART(KXSP,NISP,3,3,NUMSPH,IPARTSP,TAGPART,TAGNOD)
134C-----------
135 limit = numnod/2
136 IF (ind < limit)THEN ! cheaper to use Order on small node groups
137 ALLOCATE(idx(2*ind))
138 ALLOCATE(sort(ind))
139 sort(1:ind) = clause_node(1:ind)
140 CALL my_orders(0,iwork,sort,idx,ind,1)
141
142 DO i=1,ind
143 clause_node(i) = sort(idx(i))
144 ENDDO
145 DEALLOCATE(idx)
146 DEALLOCATE(sort)
147 ELSE
148 ind = 0
149 DO i=1,numnod
150 IF (tagnod(i) == 1) THEN
151 ind = ind + 1
152 clause_node(ind) = i
153 ENDIF
154 ENDDO
155 ENDIF
156!
157! Decide whether the result is stored in an array or in the clause.
158! In certain cases it is useful to store in ARRAY.
159! example : clause with delete clause. nodes must be recreated & merged...
160! ----------------------------------------------------------------------------
161 IF (go_in_array .EQV. .true.) THEN
162 sz = ind
163 array(1:ind) = clause_node(1:ind)
164 ELSE
165 ! clause node allocation
166 sz=0
167 clause%NB_NODE = ind
168 IF(ALLOCATED( clause%NODE )) DEALLOCATE( clause%NODE )
169 ALLOCATE( clause%NODE(ind) )
170 clause%NODE(1:ind) = clause_node(1:ind)
171 ENDIF
172C-----------
173 DEALLOCATE(tagnod)
174 DEALLOCATE(clause_node)
175C-----------
176 RETURN
177 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
program starter
Definition starter.F:39
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)