OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sptri.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!||====================================================================
25!|| mod_sptri ../starter/source/elements/sph/sptri.F
26!||--- called by ------------------------------------------------------
27!|| sptri ../starter/source/elements/sph/sptri.F
28!||====================================================================
29 module mod_sptri
30 implicit none
31 INTEGER, DIMENSION(:), ALLOCATABLE :: wreduce
32 END MODULE mod_sptri
33
34!||====================================================================
35!|| sptri ../starter/source/elements/sph/sptri.F
36!||--- called by ------------------------------------------------------
37!|| lectur ../starter/source/starter/lectur.F
38!|| spinih ../starter/source/elements/sph/spinih.F
39!||--- calls -----------------------------------------------------
40!|| ancmsg ../starter/source/output/message/message.F
41!|| arret ../starter/source/system/arret.F
42!|| spbuc31 ../starter/source/elements/sph/spbuc31.F
43!|| spclasv ../starter/source/elements/sph/spclasv.F
44!||--- uses -----------------------------------------------------
45!|| message_mod ../starter/share/message_module/message_mod.F
46!|| mod_sptri ../starter/source/elements/sph/sptri.F
47!||====================================================================
48 SUBROUTINE sptri(KXSP,IXSP,NOD2SP,X,SPBUF,
49 . LPRTSPH,LONFSPH,IPARTSP,SZ_INTP_DIST,MAX_INTP_DIST_PART,
50 . PRE_SEARCH)
51C-----------------------------------------------
52 USE message_mod
53 USE mod_sptri
54C-----------------------------------------------
55C I m p l i c i t T y p e s
56C-----------------------------------------------
57#include "implicit_f.inc"
58C-----------------------------------------------
59C G l o b a l P a r a m e t e r s
60C-----------------------------------------------
61#include "com04_c.inc"
62#include "sphcom.inc"
63#include "buckr_c.inc"
64C-----------------------------------------------
65C PRE_SEARCH = 0 -> full search of neigbours
66C PRE_SEARCH = 1 -> pre-search of neigbours for computation of max interparticle dist
67C-----------------------------------------------
68C D u m m y A r g u m e n t s
69C-----------------------------------------------
70 INTEGER KXSP(NISP,*), IXSP(KVOISPH,*), NOD2SP(*),
71 . LPRTSPH(2,0:NPART) ,LONFSPH(*)
72 INTEGER ,INTENT(IN) :: IPARTSP(NUMSPH),PRE_SEARCH,SZ_INTP_DIST
73 my_real
74 . spbuf(nspbuf,*), x(3,*)
75 my_real ,INTENT(INOUT) :: max_intp_dist_part(sz_intp_dist)
76C-----------------------------------------------
77C L o c a l V a r i a b l e s
78C-----------------------------------------------
79 INTEGER N,J,K, IREDUCE, NVOIS, IERROR,JVOIS(NUMSPH), JSTOR(NUMSPH), JPERM(NUMSPH)
80 INTEGER NS, WASPACT(NUMSPH), IPRT
81 my_real dvois(numsph), bminma(6), myspatrue,xmax, ymax, zmax
82C-----------------------------------------------
83 nvois = 0
84C-----------------------------------------------
85 ALLOCATE(wreduce(numsph),stat=ierror)
86 IF(ierror/=0) THEN
87 CALL ancmsg(msgid=19,msgtype=msgerror,anmode=aninfo,
88 . c1='(SPH)')
89 CALL arret(2)
90 END IF
91 ireduce=0
92 wreduce(1:numsph)=0
93C-----------------------------------------------
94 IF(nsphio==0)THEN
95 nsphact=0
96 DO n=1,numsph
97 IF(kxsp(2,n)/=0)THEN
98 nsphact=nsphact+1
99 waspact(nsphact)=n
100 ENDIF
101 ENDDO
102 ELSE
103 nsphact=0
104 DO iprt=1,npart
105 DO k=lprtsph(2,iprt-1)+1,lprtsph(1,iprt)
106 nsphact=nsphact+1
107 waspact(nsphact)=lonfsph(k)
108 ENDDO
109 ENDDO
110 END IF
111C
112 DO ns=1,nsphact
113 n=waspact(ns)
114 kxsp(5,n)=0
115 END DO
116C-----------------------------------------------
117 bminma(1) = -ep30
118 bminma(2) = -ep30
119 bminma(3) = -ep30
120 bminma(4) = ep30
121 bminma(5) = ep30
122 bminma(6) = ep30
123C
124 xmin=ep30
125 xmax=-ep30
126 ymin=ep30
127 ymax=-ep30
128 zmin=ep30
129 zmax=-ep30
130C
131C Bucket sort. DBUC + MIN / MAX
132C
133 dbuc=zero
134 DO ns=1,nsphact
135 n=waspact(ns)
136 dbuc=max(dbuc,spbuf(1,n))
137C
138 j=kxsp(3,n)
139 xmin= min(xmin,x(1,j))
140 ymin= min(ymin,x(2,j))
141 zmin= min(zmin,x(3,j))
142 xmax= max(xmax,x(1,j))
143 ymax= max(ymax,x(2,j))
144 zmax= max(zmax,x(3,j))
145 END DO
146C
147 bminma(1) = max(bminma(1),xmax)
148 bminma(2) = max(bminma(2),ymax)
149 bminma(3) = max(bminma(3),zmax)
150 bminma(4) = min(bminma(4),xmin)
151 bminma(5) = min(bminma(5),ymin)
152 bminma(6) = min(bminma(6),zmin)
153C
154 dbuc=dbuc*sqrt(one +spatrue)*onep0001
155 bminma(1) = bminma(1)+dbuc
156 bminma(2) = bminma(2)+dbuc
157 bminma(3) = bminma(3)+dbuc
158 bminma(4) = bminma(4)-dbuc
159 bminma(5) = bminma(5)-dbuc
160 bminma(6) = bminma(6)-dbuc
161C-----------------------------------------------
162 CALL spbuc31(x ,kxsp ,ixsp ,nod2sp,
163 . spbuf ,waspact,jvois,jstor ,jperm ,
164 . dvois ,ireduce,wreduce,bminma,ipartsp ,
165 . sz_intp_dist,max_intp_dist_part,pre_search)
166C-----------------------------------------------
167C re-tri voisins (voisins vrais, voisins dans la zone de securite).
168C
169 IF (pre_search==0) THEN
170 myspatrue=spatrue
171C /---------------/
172C CALL MY_BARRIER
173C /---------------/
174 CALL spclasv(x ,spbuf ,kxsp ,ixsp ,nod2sp ,
175 1 waspact,myspatrue,ireduce,wreduce)
176C /---------------/
177C CALL MY_BARRIER
178C /---------------/
179 IF(myspatrue<spatrue)spatrue=myspatrue
180 ELSE
181 DEALLOCATE(wreduce)
182 ENDIF
183
184 RETURN
185 END
subroutine ymax(idn, fac, npc, pld, stiffmin, stiffmax, stiffini, stiffavg)
Definition law100_upd.F:272
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
integer, dimension(:), allocatable wreduce
Definition sptri.F:31
subroutine spbuc31(x, kxsp, ixsp, nod2sp, spbuf, ma, jvois, jstor, jperm, dvois, ireduce, kreduce, bminma, ipartsp, sz_intp_dist, max_intp_dist_part, pre_search)
Definition spbuc31.F:36
subroutine sptri(kxsp, ixsp, nod2sp, x, spbuf, lprtsph, lonfsph, ipartsp, sz_intp_dist, max_intp_dist_part, pre_search)
Definition sptri.F:51
subroutine spclasv(x, spbuf, kxsp, ixsp, nod2sp, waspact, myspatrue, ireduce, kreduce)
Definition spclasv.F:32
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:889
subroutine arret(nn)
Definition arret.F:87