OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
admordr.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!|| admordr ../engine/source/model/remesh/admordr.F
25!||--- called by ------------------------------------------------------
26!|| resol ../engine/source/engine/resol.F
27!|| resol_init ../engine/source/engine/resol_init.F
28!||--- calls -----------------------------------------------------
29!|| my_orders ../common_source/tools/sort/my_orders.c
30!||--- uses -----------------------------------------------------
31!|| element_mod ../common_source/modules/elements/element_mod.F90
32!|| my_alloc_mod ../common_source/tools/memory/my_alloc.F90
33!|| remesh_mod ../engine/share/modules/remesh_mod.F
34!||====================================================================
35 SUBROUTINE admordr(SH4TREE,SH3TREE,IXC,IXTG)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE remesh_mod
40 USE my_alloc_mod
41 use element_mod , only : nixc,nixtg
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46#include "comlock.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "param_c.inc"
51#include "parit_c.inc"
52#include "remesh_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER SH4TREE(KSH4TREE,*), SH3TREE(KSH3TREE,*),
57 . IXC(NIXC,*), IXTG(NIXTG,*)
58C-----------------------------------------------
59C L o c a l V a r i a b l e s
60C-----------------------------------------------
61 INTEGER N,NN,LEVEL,IP,NLEV,PTR,SON,
62 . J,NI,IERR
63 INTEGER,DIMENSION(:),ALLOCATABLE :: LTMP4
64 INTEGER,DIMENSION(:),ALLOCATABLE :: LTMP3
65 INTEGER,DIMENSION(:),ALLOCATABLE :: ITRI
66 INTEGER,DIMENSION(:),ALLOCATABLE :: SORT_INDEX
67 INTEGER WORK(70000)
68C-----------------------------------------------
69 CALL my_alloc(ltmp4,nsh4act)
70 CALL my_alloc(ltmp3,nsh3act)
71 CALL my_alloc(itri,max(nsh4act,nsh3act))
72 CALL my_alloc(sort_index,2*max(nsh4act,nsh3act))
73C-----------------------------------------------
74 IF(iparit/=0)THEN
75
76 DO nn = 1, nsh4act
77 itri(nn) = ixc(nixc,lsh4act(nn))
78 ENDDO
79 CALL my_orders(0,work,itri,sort_index,nsh4act,1)
80 ltmp4(1:nsh4act)=lsh4act(1:nsh4act)
81 DO nn = 1, nsh4act
82 lsh4act(nn)=ltmp4(sort_index(nn))
83 END DO
84
85 DO nn = 1, nsh3act
86 itri(nn) = ixtg(nixtg,lsh3act(nn))
87 ENDDO
88 CALL my_orders(0,work,itri,sort_index,nsh3act,1)
89 ltmp3(1:nsh3act)=lsh3act(1:nsh3act)
90 DO nn = 1, nsh3act
91 lsh3act(nn)=ltmp3(sort_index(nn))
92 END DO
93
94 END IF
95
96 psh4act=0
97
98 DO nn=1,nsh4act
99 n =lsh4act(nn)
100 level=sh4tree(3,n)
101 psh4act(level)=psh4act(level)+1
102 ltmp4(nn)=n
103 END DO
104C
105 DO level=1,levelmax
106 psh4act(level)=psh4act(level)+psh4act(level-1)
107 END DO
108C
109 DO level=levelmax+1,1,-1
110 psh4act(level)=psh4act(level-1)
111 END DO
112 psh4act(0)=0
113C
114 DO nn=1,nsh4act
115 n =ltmp4(nn)
116 level=sh4tree(3,n)
117 psh4act(level)=psh4act(level)+1
118 lsh4act(psh4act(level))=n
119 END DO
120C
121 DO level=levelmax+1,1,-1
122 psh4act(level)=psh4act(level-1)
123 END DO
124 psh4act(0)=0
125C
126 psh4kin(0)=0
127 lsh4kin(1:psh4act(1))=lsh4act(1:psh4act(1))
128
129 ptr = psh4act(1)
130 DO level=0,levelmax-1
131 psh4kin(level+1)=ptr
132 DO nn=psh4kin(level)+1,psh4kin(level+1)
133 n =lsh4kin(nn)
134 son=sh4tree(2,n)
135 ptr=ptr+1
136 lsh4kin(ptr)=son
137 ptr=ptr+1
138 lsh4kin(ptr)=son+1
139 ptr=ptr+1
140 lsh4kin(ptr)=son+2
141 ptr=ptr+1
142 lsh4kin(ptr)=son+3
143 END DO
144 DO nn=psh4act(level+1)+1,psh4act(level+2)
145 ptr=ptr+1
146 lsh4kin(ptr)=lsh4act(nn)
147 END DO
148 END DO
149 psh4kin(levelmax+1)=ptr
150
151C--------------------------------------------
152C TRIANGLES
153C--------------------------------------------
154 psh3act=0
155
156 DO nn=1,nsh3act
157 n =lsh3act(nn)
158 level=sh3tree(3,n)
159 psh3act(level)=psh3act(level)+1
160 ltmp3(nn)=n
161 END DO
162C
163 DO level=1,levelmax
164 psh3act(level)=psh3act(level)+psh3act(level-1)
165 END DO
166C
167 DO level=levelmax+1,1,-1
168 psh3act(level)=psh3act(level-1)
169 END DO
170 psh3act(0)=0
171C
172 DO nn=1,nsh3act
173 n =ltmp3(nn)
174 level=sh3tree(3,n)
175 psh3act(level)=psh3act(level)+1
176 lsh3act(psh3act(level))=n
177 END DO
178C
179 DO level=levelmax+1,1,-1
180 psh3act(level)=psh3act(level-1)
181 END DO
182 psh3act(0)=0
183C
184 psh3kin(0)=0
185 lsh3kin(1:psh3act(1))=lsh3act(1:psh3act(1))
186
187 ptr = psh3act(1)
188 DO level=0,levelmax-1
189 psh3kin(level+1)=ptr
190 DO nn=psh3kin(level)+1,psh3kin(level+1)
191 n =lsh3kin(nn)
192 son=sh3tree(2,n)
193 ptr=ptr+1
194 lsh3kin(ptr)=son
195 ptr=ptr+1
196 lsh3kin(ptr)=son+1
197 ptr=ptr+1
198 lsh3kin(ptr)=son+2
199 ptr=ptr+1
200 lsh3kin(ptr)=son+3
201 END DO
202 DO nn=psh3act(level+1)+1,psh3act(level+2)
203 ptr=ptr+1
204 lsh3kin(ptr)=lsh3act(nn)
205 END DO
206 END DO
207 psh3kin(levelmax+1)=ptr
208C--------------------------------------------
209 DEALLOCATE(ltmp4)
210 DEALLOCATE(ltmp3)
211 DEALLOCATE(itri)
212 DEALLOCATE(sort_index)
213
214 RETURN
215 END
subroutine admordr(sh4tree, sh3tree, ixc, ixtg)
Definition admordr.F:36
#define max(a, b)
Definition macros.h:21
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
integer, dimension(:), allocatable lsh3act
Definition remesh_mod.F:62
integer, dimension(:), allocatable lsh4kin
Definition remesh_mod.F:62
integer, dimension(:), allocatable lsh3kin
Definition remesh_mod.F:62
integer, dimension(:), allocatable psh4kin
Definition remesh_mod.F:62
integer, dimension(:), allocatable psh3kin
Definition remesh_mod.F:62
integer, dimension(:), allocatable psh4act
Definition remesh_mod.F:62
integer nsh3act
Definition remesh_mod.F:66
integer nsh4act
Definition remesh_mod.F:66
integer, dimension(:), allocatable lsh4act
Definition remesh_mod.F:62
integer, dimension(:), allocatable psh3act
Definition remesh_mod.F:62