OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_tri22vox0.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/.
23C
24!||====================================================================
25!|| spmd_tri22vox0 ../engine/source/mpi/interfaces/spmd_tri22vox0.F
26!||--- called by ------------------------------------------------------
27!|| i22main_tri ../engine/source/interfaces/intsort/i22main_tri.F
28!||--- uses -----------------------------------------------------
29!|| element_mod ../common_source/modules/elements/element_mod.F90
30!|| tri7box ../engine/share/modules/tri7box.F
31!||====================================================================
32 SUBROUTINE spmd_tri22vox0(
33 1 X ,BMINMA_FLU_L ,NBRIC , IXS , BUFBRIC,
34 2 ITASK ,ITAB ,XMINS , YMINS , ZMINS ,
35 3 XMAXS ,YMAXS ,ZMAXS , BMINMA_LAG_R ,IS_CONTACT,
36 4 BMINMA_AND )
37C-----------------------------------------------
38C D e s c r i p t i o n
39C-----------------------------------------------
40C This subroutine is marking SPMD voxel if brick is inside
41C lagrangian domain (from local domain)
42C X : Node coordinates
43C BMINMAL : Fluid Bounds for local domain
44C IXS : Brick node ids
45C BUFBRIC : Brick Group for interface for current domain
46C ITASK : Current Thread
47C CRVOXEL : SPMD Voxel
48C-----------------------------------------------
49C M o d u l e s
50C-----------------------------------------------
51 USE tri7box
52 use element_mod , only :nixs
53C-----------------------------------------------
54C I m p l i c i t T y p e s
55C-----------------------------------------------
56#include "implicit_f.inc"
57#include "comlock.inc"
58C-----------------------------------------------
59C C o m m o n B l o c k s
60C-----------------------------------------------
61#include "task_c.inc"
62C-----------------------------------------------
63C D u m m y A r g u m e n t s
64C-----------------------------------------------
65 INTEGER, intent(in) :: NBRIC, IXS(NIXS,*), ITAB(*)
66 my_real, intent(in) ::
67 . X(3,*),
68 . BMINMA_FLU_L(6), BMINMA_LAG_R(6)
69 my_real, intent(inout) ::
70 . bminma_and(6)
71 my_real
72 . xmaxs(nbric), ymaxs(nbric), zmaxs(nbric),
73 . xmins(nbric), ymins(nbric), zmins(nbric)
74C-----------------------------------------------
75C L o c a l V a r i a b l e s
76C-----------------------------------------------
77 INTEGER LOC_PROC,IB,
78 . NBX,NBY,NBZ,
79 . IX1,IY1,IZ1,IX2,IY2,IZ2,IX,IY,IZ,
80 . BUFBRIC(NBRIC),NBF,NBL,ITASK
81 my_real
82 . xmaxb,ymaxb,zmaxb,xminb,yminb,zminb,
83 .
84 .
85 .
86 .
87 . dx,dy,dz
88 LOGICAL :: IS_CONTACT
89C-----------------------------------------------
90C S o u r c e L i n e s
91C-----------------------------------------------
92C
93C=======================================================================
94C tag of boxes containing facets
95C and creation of candidates
96C=======================================================================
97
98 loc_proc = ispmd + 1
99
100 nbx = lrvoxel
101 nby = lrvoxel
102 nbz = lrvoxel
103
104 ! to search for distant candidate facets,
105 ! we look at the intersection of the local fluid domain with the remote lagrangian domains
106 ! this is the domain that we voxelize to search for the remote facets
107 xmaxb = min( bminma_flu_l(1), bminma_lag_r(1) )
108 ymaxb = min( bminma_flu_l(2), bminma_lag_r(2) )
109 zmaxb = min( bminma_flu_l(3), bminma_lag_r(3) )
110 xminb = max( bminma_flu_l(4), bminma_lag_r(4) )
111 yminb = max( bminma_flu_l(5), bminma_lag_r(5) )
112 zminb = max( bminma_flu_l(6), bminma_lag_r(6) )
113
114 dx = xmaxb-xminb
115 dy = ymaxb-yminb
116 dz = zmaxb-zminb
117
118 !Test Interaction between domains (local / distant fluid)
119 IF ( (dx<=zero).OR.(dy<=zero).OR.(dz<=zero) ) THEN
120 is_contact = .false.
121 RETURN
122 ELSE
123 is_contact = .true.
124 END IF
125
126 bminma_and(1)=xmaxb
127 bminma_and(2)=ymaxb
128 bminma_and(3)=zmaxb
129 bminma_and(4)=xminb
130 bminma_and(5)=yminb
131 bminma_and(6)=zminb
132
133 nbf = 1+itask*nbric/nthread
134 nbl = (itask+1)*nbric/nthread
135
136 DO ib=nbf,nbl
137 !-------------------------------------------!
138 ! VOXEL OCCUPIED BY THE BRICK !
139 !-------------------------------------------!
140 !Voxel_lower_left_bound for this element---+
141 ix1=int(nbx*(xmins(ib)-xminb)/dx)
142 iy1=int(nby*(ymins(ib)-yminb)/dy)
143 iz1=int(nbz*(zmins(ib)-zminb)/dz)
144 ix1=max(ix1,0) !pos for ibset must be correctly defined
145 iy1=max(iy1,0) !CRVOXEL (0:LRVOXEL,...
146 iz1=max(iz1,0) !CRVOXEL (0:LRVOXEL,...
147 !Voxel_upper_right_bound for this element---+
148 ix2=int(nbx*(xmaxs(ib)-xminb)/dx)
149 iy2=int(nby*(ymaxs(ib)-yminb)/dy)
150 iz2=int(nbz*(zmaxs(ib)-zminb)/dz)
151 ix2=min(ix2,nbx) !pos for ibset must be correctly defined
152 iy2=min(iy2,nby) !CRVOXEL (0:LRVOXEL,...
153 iz2=min(iz2,nbz) !CRVOXEL (0:LRVOXEL,...
154 !------------------------------------------------------!
155 ! VOXEL MARKING TO SPOT BRIC LOCATIONS (LOCAL DOMAIN) !
156 !------------------------------------------------------!
157#include "lockon.inc"
158 DO iz = iz1, iz2
159 DO iy = iy1, iy2
160 DO ix = ix1, ix2
161 crvoxel(iy,iz,loc_proc)=ibset(crvoxel(iy,iz,loc_proc),ix)
162 END DO
163 END DO
164 END DO
165#include "lockoff.inc"
166 ENDDO !IB=NBF,NBL
167
168C
169 RETURN
170 END
#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 spmd_tri22vox0(x, bminma_flu_l, nbric, ixs, bufbric, itask, itab, xmins, ymins, zmins, xmaxs, ymaxs, zmaxs, bminma_lag_r, is_contact, bminma_and)