OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ass2sort.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!|| ass2sort ../engine/source/assembly/ass2sort.F
25!||--- called by ------------------------------------------------------
26!|| asspar4 ../engine/source/assembly/asspar4.F
27!|| i17lll_ass ../engine/source/interfaces/int17/i17for3.F
28!||--- calls -----------------------------------------------------
29!|| stlsort ../common_source/tools/sort/cppsort.cpp
30!||--- uses -----------------------------------------------------
31!|| message_mod ../engine/share/message_module/message_mod.F
32!||====================================================================
33 SUBROUTINE ass2sort(FSKYI,JJ1,JJ2,FSKYT,NFSK)
34C FSKYI : IN/OUT : TABLEAU DE FORCES A TRIER EN ENTREE,
35C TABLEAU DE FORCES TRIE EN SORTIE
36C JJ1 : IN : INDICE DE DEBUT DANS FSKYI
37C JJ2 : IN : INDICE DE FIN DANS FSKYI
38C FSKYT : IN/OUT : TABLEAU TEMPORAIRE
39C NFSK : IN : Dimension de FSKYI
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE message_mod
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48#include "comlock.inc"
49C-----------------------------------------------
50C C o m m o n B l o c k s
51C-----------------------------------------------
52#include "parit_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER JJ1, JJ2, NFSK
57C REAL
58 my_real
59 . fskyi(lskyi,nfsk), fskyt(*)
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63 INTEGER K, L, ERROR, PERM(JJ2-JJ1+1)
64C-----------------------------------------------
65 DO l = 1, nfsk
66 DO k = jj1, jj2
67 fskyt(k-jj1+1) = fskyi(k,l)
68 ENDDO
69 CALL stlsort(jj2-jj1+1,fskyt)
70 DO k = jj1, jj2
71 fskyi(k,l) = fskyt(jj2-k+1)
72 ENDDO
73 ENDDO
74
75C
76 RETURN
77 END
78!||====================================================================
79!|| ass2sort_pxfem ../engine/source/assembly/ass2sort.F
80!||--- called by ------------------------------------------------------
81!|| asspar4 ../engine/source/assembly/asspar4.F
82!||--- calls -----------------------------------------------------
83!|| stlsort ../common_source/tools/sort/cppsort.cpp
84!||--- uses -----------------------------------------------------
85!|| message_mod ../engine/share/message_module/message_mod.F
86!||====================================================================
87 SUBROUTINE ass2sort_pxfem(FSKYI,JJ1,JJ2,FSKYT,NFSK)
88C FSKYI : IN/OUT : TABLEAU DE FORCES A TRIER EN ENTREE,
89C TABLEAU DE FORCES TRIE EN SORTIE
90C JJ1 : IN : INDICE DE DEBUT DANS FSKYI
91C JJ2 : IN : INDICE DE FIN DANS FSKYI
92C FSKYT : IN/OUT : TABLEAU TEMPORAIRE
93C NFSK : IN : Dimension de FSKYI
94C-----------------------------------------------
95C M o d u l e s
96C-----------------------------------------------
97 USE message_mod
98C-----------------------------------------------
99C I m p l i c i t T y p e s
100C-----------------------------------------------
101#include "implicit_f.inc"
102#include "comlock.inc"
103C-----------------------------------------------
104C C o m m o n B l o c k s
105C-----------------------------------------------
106#include "parit_c.inc"
107C-----------------------------------------------
108C D u m m y A r g u m e n t s
109C-----------------------------------------------
110 INTEGER JJ1, JJ2, NFSK
111C REAL
112 my_real
113 . fskyi(lskyi,nfsk), fskyt(*)
114C-----------------------------------------------
115C L o c a l V a r i a b l e s
116C-----------------------------------------------
117 INTEGER K, L, ERROR, PERM(JJ2-JJ1+1),
118 . IDX1(JJ2-JJ1+1),IDX2(JJ2-JJ1+1),N1,N2,IPLY,
119 . IPLY1,KK
120C-----------------------------------------------
121 n1 = 1
122 n2 = 0
123 kk = jj1
124 DO WHILE(fskyi(kk,5)== zero .AND. kk <= jj2)
125 kk = kk + 1
126 ENDDO
127 iply = int(fskyi(kk,5))
128 idx1(1) = kk
129 IF(iply == 0) n1 = 0
130C
131 IF(iply /= 0) THEN
132 DO k = jj1+1, jj2
133 iply1 = int(fskyi(k,5))
134 IF(iply1 == iply) THEN
135 n1 = n1 + 1
136 idx1(n1) = k
137 ELSEIF(iply1 /= 0) THEN
138 n2 = n2 + 1
139 idx2(n2) = k
140 ENDIF
141 ENDDO
142 ENDIF
143C
144 IF(n1 > 0) THEN
145 DO l = 1, nfsk-1
146 DO k = 1, n1
147 kk = idx1(k)
148 fskyt(k) = fskyi(kk,l)
149 ENDDO
150 CALL stlsort(n1, fskyt)
151 DO k = 1, n1
152 kk = idx1(k)
153 fskyi(kk,l) = fskyt(n1-k+1)
154 ENDDO
155 ENDDO
156 ENDIF
157C
158 IF(n2 > 0) THEN
159 DO l = 1, nfsk-1
160 DO k = 1, n2
161 kk = idx2(k)
162 fskyt(k) = fskyi(kk,l)
163 ENDDO
164 CALL stlsort(n2, fskyt)
165 DO k = 1, n2
166 kk = idx2(k)
167 fskyi(kk,l) = fskyt(n2-k+1)
168 ENDDO
169 ENDDO
170 ENDIF
171C
172 RETURN
173 END
subroutine ass2sort(fskyi, jj1, jj2, fskyt, nfsk)
Definition ass2sort.F:34
subroutine ass2sort_pxfem(fskyi, jj1, jj2, fskyt, nfsk)
Definition ass2sort.F:88
void stlsort(int *len, my_real *array)
Definition cppsort.cpp:57
#define my_real
Definition cppsort.cpp:32