OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spsym_alloc.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "sphcom.inc"
#include "param_c.inc"
#include "task_c.inc"
#include "lockon.inc"
#include "lockoff.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spsym_alloc (x, ispcond, ispsym, xframe, xspsym, vspsym, wsp2sort, dmax, itask, wsmcomp, myspatrue, spbuf, kxsp)

Function/Subroutine Documentation

◆ spsym_alloc()

subroutine spsym_alloc ( x,
integer, dimension(nispcond,*) ispcond,
integer, dimension(nspcond,*) ispsym,
xframe,
type (spsym_struct) xspsym,
type (spsym_struct) vspsym,
integer, dimension(*) wsp2sort,
dmax,
integer itask,
type (spsym_struct) wsmcomp,
myspatrue,
spbuf,
integer, dimension(nisp,*) kxsp )

Definition at line 33 of file spsym_alloc.F.

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,*)
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
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
#define my_real
Definition cppsort.cpp:32
integer, dimension(:,:), allocatable ispsymr
Definition sphbox.F:93
integer nsphr
Definition sphbox.F:83
subroutine my_barrier
Definition machine.F:31