OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sphtri0.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!|| sphtri0 ../engine/source/elements/sph/sphtri0.F
25!||--- called by ------------------------------------------------------
26!|| sphprep ../engine/source/elements/sph/sphprep.F
27!||--- calls -----------------------------------------------------
28!|| my_barrier ../engine/source/system/machine.F
29!|| spmd_all_dmax ../engine/source/mpi/elements/spmd_sph.F
30!|| spmd_barrier ../engine/source/mpi/spmd_mod.F90
31!|| spmd_sphvox ../engine/source/mpi/sph/spmd_sphvox.F
32!|| spmd_sphvox0 ../engine/source/mpi/elements/spmd_sph.F
33!|| startime ../engine/source/system/timer_mod.f90
34!|| stoptime ../engine/source/system/timer_mod.F90
35!||--- uses -----------------------------------------------------
36!|| spmd_mod ../engine/source/mpi/spmd_mod.F90
37!|| timer_mod ../engine/source/system/timer_mod.F90
38!|| tri7box ../engine/share/modules/tri7box.f
39!||====================================================================
40 SUBROUTINE sphtri0(TIMERS, X , SPBUF, KXSP, WSP2SORT,BMINMA , DMAX,
41 2 NSP2SORTF,NSP2SORTL,NMN,ITASK, DBUC)
42C============================================================================
43C M o d u l e s
44C-----------------------------------------------
45 USE spmd_mod, ONLY : spmd_barrier
46 USE timer_mod
47 USE tri7box
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51#include "implicit_f.inc"
52#include "comlock.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com01_c.inc"
57#include "sphcom.inc"
58#include "task_c.inc"
59#include "timeri_c.inc"
60C-----------------------------------------------
61C D u m m y A r g u m e n t s
62C-----------------------------------------------
63 TYPE(timer_), INTENT(INOUT) :: TIMERS
64 INTEGER KXSP(NISP,*), WSP2SORT(*),NSP2SORTF,NSP2SORTL,ITASK,NMN
65 my_real x(3,*),spbuf(nspbuf,*), bminma(12), dmax, dbuc
66C-----------------------------------------------
67C L o c a l V a r i a b l e s
68C-----------------------------------------------
69 INTEGER N, J, NS,LOC_PROC
70 my_real xmax,ymax,zmax,xmin,ymin,zmin,dbucl,mx,my,mz,dx,dy,dz,sx,sy,sz,sx2,sy2,sz2
71
72C-----------------------------------------------
73 xmin=ep30
74 xmax=-ep30
75 ymin=ep30
76 ymax=-ep30
77 zmin=ep30
78 zmax=-ep30
79 sx=zero
80 sy=zero
81 sz=zero
82 sx2=zero
83 sy2=zero
84 sz2=zero
85C
86C
87C Bucket sort. DBUC + MIN / MAX
88
89 dbucl=zero
90 DO ns=nsp2sortf,nsp2sortl
91 n=wsp2sort(ns)
92 dbucl=max(dbucl,spbuf(1,n))
93C
94 j=kxsp(3,n)
95 xmin= min(xmin,x(1,j))
96 ymin= min(ymin,x(2,j))
97 zmin= min(zmin,x(3,j))
98 xmax= max(xmax,x(1,j))
99 ymax= max(ymax,x(2,j))
100 zmax= max(zmax,x(3,j))
101 sx=sx+x(1,j)
102 sy=sy+x(2,j)
103 sz=sz+x(3,j)
104 sx2=sx2+x(1,j)**2
105 sy2=sy2+x(2,j)**2
106 sz2=sz2+x(3,j)**2
107 END DO
108
109 IF(itask == 0)THEN
110 bminma(7:12)=0
111 bminma(1)=-ep30
112 bminma(2)=-ep30
113 bminma(3)=-ep30
114 bminma(4)=ep30
115 bminma(5)=ep30
116 bminma(6)=ep30
117 dbuc = zero
118 ENDIF
119
120 CALL my_barrier
121
122#include "lockon.inc"
123 bminma(1) = max(bminma(1),xmax)
124 bminma(2) = max(bminma(2),ymax)
125 bminma(3) = max(bminma(3),zmax)
126 bminma(4) = min(bminma(4),xmin)
127 bminma(5) = min(bminma(5),ymin)
128 bminma(6) = min(bminma(6),zmin)
129 dbuc = max(dbuc,dbucl)
130 dmax = dbuc
131 bminma(7) = bminma(7)+sx
132 bminma(8) = bminma(8)+sy
133 bminma(9) = bminma(9)+sz
134 bminma(10)= bminma(10)+sx2
135 bminma(11)= bminma(11)+sy2
136 bminma(12)= bminma(12)+sz2
137#include "lockoff.inc"
138C
139 CALL my_barrier
140
141!$OMP SINGLE
142 dbuc=dbuc*sqrt(one +spatrue)*onep0001
143 bminma(1) = bminma(1)+dbuc
144 bminma(2) = bminma(2)+dbuc
145 bminma(3) = bminma(3)+dbuc
146 bminma(4) = bminma(4)-dbuc
147 bminma(5) = bminma(5)-dbuc
148 bminma(6) = bminma(6)-dbuc
149C Computation of standard deviation of X main
150C use the formula dev = sum(xi )-n.m
151C mean value m by direction
152 mx=bminma(7)/max(nmn,1)
153 my=bminma(8)/max(nmn,1)
154 mz=bminma(9)/max(nmn,1)
155c print*,noint,'m=',mx,my,mz,NMN,NRTM
156C standard deviation by direction
157 dx=sqrt(bminma(10)/max(nmn,1)-mx**2)
158 dy=sqrt(bminma(11)/max(nmn,1)-my**2)
159 dz=sqrt(bminma(12)/max(nmn,1)-mz**2)
160c print*,noint,'var=',dx,dy,dz
161C Computation of new boundary of the domain mean values +/- 2 sigma
162C => 95% of the population for normal distribution
163 bminma(7) =min(mx+2*dx,bminma(1))
164 bminma(8) =min(my+2*dy,bminma(2))
165 bminma(9) =min(mz+2*dz,bminma(3))
166 bminma(10)=max(mx-2*dx,bminma(4))
167 bminma(11)=max(my-2*dy,bminma(5))
168 bminma(12)=max(mz-2*dz,bminma(6))
169
170C Test cas particulier 2D
171 IF(bminma(10)==bminma(7))THEN
172 bminma(10)=bminma(4)
173 bminma(7)=bminma(1)
174 END IF
175 IF(bminma(11)==bminma(8))THEN
176 bminma(11)=bminma(5)
177 bminma(8)=bminma(2)
178 END IF
179 IF(bminma(12)==bminma(9))THEN
180 bminma(12)=bminma(6)
181 bminma(9)=bminma(3)
182 END IF
183!$OMP END SINGLE
184
185
186 IF(nspmd>1) THEN
187C
188C Boite MIN / MAX en SPMD
189C
190 IF(itask==0) THEN
191 loc_proc = ispmd+1
192 crvoxel(0:lrvoxel,0:lrvoxel,loc_proc)=0
193 ENDIF
194
195 CALL my_barrier
196
197 CALL spmd_sphvox0(kxsp ,spbuf,wsp2sort,bminma,x,
198 2 nsp2sortf,nsp2sortl)
199
200 CALL my_barrier
201
202 IF(itask==0)THEN
203C
204 IF(imonm == 2)THEN
205 CALL startime(timers,95)
206 CALL spmd_barrier()
207 CALL stoptime(timers,95)
208 END IF
209 CALL startime(timers,91)
210C Recuperation des cellules SPH remotes NSPHR stockees dans XSPHR
211C
212 CALL spmd_sphvox(kxsp ,spbuf,wsp2sort,bminma,x)
213 CALL spmd_all_dmax(dmax,1)
214C
215 CALL stoptime(timers,91)
216 ENDIF
217
218 END IF
219
220 CALL my_barrier
221C
222 RETURN
223 END
#define my_real
Definition cppsort.cpp:32
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(0:lrvoxel, 0:lrvoxel) crvoxel
Definition tri7box.F:56
integer lrvoxel
Definition tri7box.F:54
subroutine sphtri0(timers, x, spbuf, kxsp, wsp2sort, bminma, dmax, nsp2sortf, nsp2sortl, nmn, itask, dbuc)
Definition sphtri0.F:42
subroutine spmd_all_dmax(v, len)
Definition spmd_sph.F:1146
subroutine spmd_sphvox0(kxsp, spbuf, wsp2sort, bminmal, x, nsp2sortf, nsp2sortl)
Definition spmd_sph.F:2423
subroutine spmd_sphvox(kxsp, spbuf, wsp2sort, bminmal, x)
Definition spmd_sphvox.F:41
subroutine my_barrier
Definition machine.F:31
subroutine startime(event, itask)
Definition timer.F:93
subroutine stoptime(event, itask)
Definition timer.F:135