OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spsym_alloc.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!|| spsym_alloc ../engine/source/elements/sph/spsym_alloc.F
25!||--- called by ------------------------------------------------------
26!|| sphprep ../engine/source/elements/sph/sphprep.F
27!||--- calls -----------------------------------------------------
28!|| my_barrier ../engine/source/system/machine.F
29!||--- uses -----------------------------------------------------
30!|| message_mod ../engine/share/message_module/message_mod.F
31!|| sphbox ../engine/share/modules/sphbox.F
32!||====================================================================
33 SUBROUTINE spsym_alloc(
34 1 X, ISPCOND ,ISPSYM ,XFRAME ,XSPSYM ,
35 2 VSPSYM ,WSP2SORT,DMAX,ITASK ,WSMCOMP,
36 3 MYSPATRUE,SPBUF,KXSP)
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE sphbox
41 USE message_mod
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 "sphcom.inc"
51#include "param_c.inc"
52#include "task_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER KXSP(NISP,*),ISPSYM(NSPCOND,*),WSP2SORT(*), ITASK,
57 . ISPCOND(NISPCOND,*)
58 my_real
59 . x(3,*) ,xframe(nxframe,*) ,dmax,myspatrue,spbuf(nspbuf,*)
60 TYPE (SPSYM_STRUCT) :: XSPSYM,VSPSYM,WSMCOMP
61C-----------------------------------------------
62C L o c a l V a r i a b l e s
63C-----------------------------------------------
64 INTEGER K,N,IS,IC,NC,NS,INOD,NSPHSYM_L,IERROR
65 my_real
66 . XI,YI,ZI,DI,
67 . ox,oy,oz,nx,ny,nz,
68 . dd,dm,dk,dl,spalinr
69C-----------------------------------------------
70C new construction of ghost particles is necessary.
71 spalinr=sqrt(one + myspatrue)
72
73C NSPHSYM=0 initialise dans sphprep
74 nsphsymr=0
75C
76C Comptage des particules symetriques pour allocation des tableaux
77C
78 DO nc=1,nspcond
79 is=ispcond(3,nc)
80 ic=ispcond(2,nc)
81 ox=xframe(10,is)
82 oy=xframe(11,is)
83 oz=xframe(12,is)
84 nx=xframe(3*(ic-1)+1,is)
85 ny=xframe(3*(ic-1)+2,is)
86 nz=xframe(3*(ic-1)+3,is)
87C
88 DO ns=1+itask,nsp2sort,nthread
89 n=wsp2sort(ns)
90 inod =kxsp(3,n)
91 xi =x(1,inod)
92 yi =x(2,inod)
93 zi =x(3,inod)
94 di =spbuf(1,n)
95C DMAX : max diametre sur le domaine
96 dm=di+dmax
97C------
98C Recherche si condition active en X.
99 dd=(xi-ox)*nx+(yi-oy)*ny+(zi-oz)*nz
100 IF (dd<=spalinr*dm) THEN
101#include "lockon.inc"
102 nsphsym=nsphsym+1
103 nsphsym_l = nsphsym
104 ispsym(nc,n)= nsphsym_l
105#include "lockoff.inc"
106 ELSE
107C not symetrized at this time.
108 ispsym(nc,n)=-1
109 ENDIF
110 ENDDO
111C
112C Particules symetriques de particules remotes
113C
114 DO ns = itask+1,nsphr,nthread
115 xi =xsphr(3,ns)
116 yi =xsphr(4,ns)
117 zi =xsphr(5,ns)
118 di =xsphr(2,ns)
119C DMAX : max diametre sur le domaine
120 dm=di+dmax
121C------
122C Recherche si condition active en X.
123 dd=(xi-ox)*nx+(yi-oy)*ny+(zi-oz)*nz
124 IF (dd<=spalinr*dm) THEN
125#include "lockon.inc"
126 nsphsym=nsphsym+1
127 nsphsymr=nsphsymr+1
128 nsphsym_l = nsphsym
129#include "lockoff.inc"
130 ispsymr(nc,ns)= nsphsym_l
131 ELSE
132C not symetrized at this time.
133 ispsymr(nc,ns)=-1
134 END IF
135 END DO
136 END DO
137C
138 CALL my_barrier
139C
140 IF (itask==0) THEN
141 IF(ALLOCATED(xspsym%BUF)) DEALLOCATE(xspsym%BUF)
142 ALLOCATE(xspsym%BUF(3*nsphsym),stat=ierror)
143 IF(ierror==0) xspsym%BUF = 0
144 IF(ALLOCATED(vspsym%BUF)) DEALLOCATE(vspsym%BUF)
145 ALLOCATE(vspsym%BUF(3*nsphsym),stat=ierror)
146 IF(ierror==0) vspsym%BUF = 0
147 IF(ALLOCATED(wsmcomp%BUF)) DEALLOCATE(wsmcomp%BUF)
148 ALLOCATE(wsmcomp%BUF(6*nsphsym),stat=ierror)
149 IF(ierror==0) wsmcomp%BUF = 0
150 ENDIF
151C-------------------------------------------
152 RETURN
153 END
integer, dimension(:,:), allocatable ispsymr
Definition sphbox.F:93
integer nsphr
Definition sphbox.F:83
subroutine spsym_alloc(x, ispcond, ispsym, xframe, xspsym, vspsym, wsp2sort, dmax, itask, wsmcomp, myspatrue, spbuf, kxsp)
Definition spsym_alloc.F:37
subroutine my_barrier
Definition machine.F:31