OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
rdbox.F File Reference
#include "implicit_f.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine checkpara (xp1, yp1, zp1, xp2, yp2, zp2, isk, nodin, skew, ok)
subroutine projskew (po, sk, isk)
subroutine inside_parallelepiped (p1, p2, p3, p4, p, ok)
subroutine checkcyl (xp1, yp1, zp1, xp2, yp2, zp2, nodin, d, ok)
subroutine inside_cylinder (p1, p2, p, d, ok)
function vec_length (dimens, x)
subroutine checksphere (xp, yp, zp, nodin, d, ok)
subroutine inside_sphere (pc, p, d, ok)

Function/Subroutine Documentation

◆ checkcyl()

subroutine checkcyl ( xp1,
yp1,
zp1,
xp2,
yp2,
zp2,
nodin,
d,
integer ok )

Definition at line 226 of file rdbox.F.

228C-----------------------------------------------
229C I m p l i c i t T y p e s
230C-----------------------------------------------
231#include "implicit_f.inc"
232C-----------------------------------------------
233C D u m m y A r g u m e n t s
234C-----------------------------------------------
235 INTEGER OK
236 my_real
237 . xp1,yp1,zp1,xp2,yp2,zp2,nodin(3),d
238C-----------------------------------------------
239C L o c a l V a r i a b l e s
240C-----------------------------------------------
241 my_real
242 . p1(3),p2(3)
243C-----------------------------------------------
244
245C-----------------------------------------------
246 p1(1) = xp1
247 p1(2) = yp1
248 p1(3) = zp1
249C
250 p2(1) = xp2
251 p2(2) = yp2
252 p2(3) = zp2
253C
254 CALL inside_cylinder(p1, p2, nodin, d, ok)
255C
256 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine inside_cylinder(p1, p2, p, d, ok)
Definition rdbox.F:266

◆ checkpara()

subroutine checkpara ( xp1,
yp1,
zp1,
xp2,
yp2,
zp2,
integer isk,
nodin,
skew,
integer ok )

Definition at line 37 of file rdbox.F.

39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "param_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER ISK,OK
52 . xp1,yp1,zp1,xp2,yp2,zp2,skew(lskew,*),nodin(3)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
57 . p1(3),p2(3),p3(3),p4(3),pp2(3)
58C-----------------------------------------------
59 p1(1) = xp1
60 p1(2) = yp1
61 p1(3) = zp1
62 CALL projskew(p1,skew,isk)
63C
64 pp2(1) = xp2
65 pp2(2) = yp2
66 pp2(3) = zp2
67 CALL projskew(pp2,skew,isk)
68C
69 p2(1) = pp2(1)
70 p2(2) = p1(2)
71 p2(3) = p1(3)
72C
73 p3(1) = p1(1)
74 p3(2) = pp2(2)
75 p3(3) = p1(3)
76C
77 p4(1) = p1(1)
78 p4(2) = p1(2)
79 p4(3) = pp2(3)
80C
81 CALL projskew(nodin,skew,isk)
82C
83 CALL inside_parallelepiped(p1, p2, p3, p4, nodin, ok)
84C
85 RETURN
subroutine inside_parallelepiped(p1, p2, p3, p4, p, ok)
Definition rdbox.F:143
subroutine projskew(po, sk, isk)
Definition rdbox.F:93

◆ checksphere()

subroutine checksphere ( xp,
yp,
zp,
nodin,
d,
integer ok )

Definition at line 345 of file rdbox.F.

346C-----------------------------------------------
347C I m p l i c i t T y p e s
348C-----------------------------------------------
349#include "implicit_f.inc"
350C-----------------------------------------------
351C D u m m y A r g u m e n t s
352C-----------------------------------------------
353 INTEGER OK
354 my_real
355 . xp,yp,zp,nodin(3),d
356C-----------------------------------------------
357C L o c a l V a r i a b l e s
358C-----------------------------------------------
359 my_real
360 . p(3)
361C-----------------------------------------------
362 p(1) = xp
363 p(2) = yp
364 p(3) = zp
365C
366 CALL inside_sphere(p, nodin, d, ok)
367C
368 RETURN
subroutine inside_sphere(pc, p, d, ok)
Definition rdbox.F:376

◆ inside_cylinder()

subroutine inside_cylinder ( p1,
p2,
p,
d,
integer ok )

Definition at line 265 of file rdbox.F.

266C-----------------------------------------------
267C The surface and interior of a (finite) cylinder in 3D is defined
268C by an axis, which is the line segment from point P1 to P2, and a
269C diameter D. The points contained in the volume include:
270C * points at a distance less than or equal to D/2 from the line through P1
271C and P2, whose nearest point on the line through P1 and P2 is, in fact,
272C P1, P2, or any point between them.
273C---
274C Input, D, the diameter of the cylinder.
275C Input, P(3), the checked point.
276C Input, P1(3), P2(3), the points defining the cylinder axis.
277C-----------------------------------------------
278C I m p l i c i t T y p e s
279C-----------------------------------------------
280#include "implicit_f.inc"
281C-----------------------------------------------
282C D u m m y A r g u m e n t s
283C-----------------------------------------------
284 INTEGER OK
285 my_real
286 . p1(3),p2(3),p(3),d
287C-----------------------------------------------
288C L o c a l V a r i a b l e s
289C-----------------------------------------------
290 my_real
291 . axis(3),axis_length,vec_length,off_axix_component,
292 . p_dot_axis,p_length
293C-----------------------------------------------
294 axis(1:3) = p2(1:3) - p1(1:3)
295 axis_length = vec_length(3,axis)
296 IF(axis_length == zero)RETURN
297C
298 axis(1:3) = axis(1:3) / axis_length
299 p_dot_axis = dot_product(p(1:3) - p1(1:3),axis)
300C
301C If the point lies below or above the "caps" of the cylinder, we're done.
302C
303 IF(p_dot_axis < zero .or. axis_length < p_dot_axis)RETURN
304C
305C Otherwise, determine the distance from P to the axis.
306C
307 p_length = vec_length(3, p1(1:3) - (p(1:3) - p_dot_axis * axis(1:3)))
308 IF(p_length <= half*d)ok = 1
309C
310 RETURN
function vec_length(dimens, x)
Definition rdbox.F:319

◆ inside_parallelepiped()

subroutine inside_parallelepiped ( p1,
p2,
p3,
p4,
p,
integer ok )

Definition at line 142 of file rdbox.F.

143C nodes inside parallelepiped in 3D.
144C
145C
146C *------------------*
147C / . / \
148C / . / \
149C / . / \
150C P4------------------* \
151C \ . \ \
152C \ . \ \
153C \ . \ \
154C \ P2.........\.......\
155C \ . \ /
156C \ . \ /
157C \ . \ /
158C P1-----------------P3
159C
160C
161C Parameters:
162C
163C Input, reals: P1(3), P2(3), P3(3), P4(3), four corners
164C of the parallelepiped. It is assumed that P2, P3 and P4 are
165C immediate neighbors of P1.
166C
167C Input, real: P(3), the node to be checked.
168C
169C IF integer "OK == 1", the node P
170C is inside the parallelepiped, or on its boundary.
171C
172C-----------------------------------------------
173C I m p l i c i t T y p e s
174C-----------------------------------------------
175#include "implicit_f.inc"
176C-----------------------------------------------
177C D u m m y A r g u m e n t s
178C-----------------------------------------------
179 INTEGER OK
180 my_real
181 . p1(3),p2(3),p3(3),p4(3),p(3)
182C-----------------------------------------------
183C L o c a l V a r i a b l e s
184C-----------------------------------------------
185 my_real
186 . dot,suma
187C-----------------------------------------------
188 dot = dot_product( p(1:3) - p1(1:3),
189 . p2(1:3) - p1(1:3))
190 IF(dot < zero)RETURN
191 suma = sum((p2(1:3) - p1(1:3) )**2)
192 IF((suma == zero . and. p(1) /= p1(1)) .OR.
193 . suma < dot)RETURN
194C---
195 dot = dot_product( p(1:3) - p1(1:3),
196 . p3(1:3) - p1(1:3))
197 IF(dot < zero)RETURN
198 suma = sum((p3(1:3) - p1(1:3) )**2)
199 IF((suma == zero . and. p(2) /= p1(2)) .OR.
200 . suma < dot)RETURN
201C---
202 dot = dot_product( p(1:3) - p1(1:3),
203 . p4(1:3) - p1(1:3))
204 IF(dot < zero)RETURN
205 suma = sum((p4(1:3) - p1(1:3) )**2)
206 IF((suma == zero . and. p(3) /= p1(3)) .OR.
207 . suma < dot)RETURN
208C---
209 ok = 1
210C---
211 RETURN

◆ inside_sphere()

subroutine inside_sphere ( pc,
p,
d,
integer ok )

Definition at line 375 of file rdbox.F.

376C-----------------------------------------------
377C Implicit Sphere Equation:
378C
379C SUM ( ( P(1:3) - PC(1:3) )**2 ) = D**2/4
380C-----------------------------------------------
381C I m p l i c i t T y p e s
382C-----------------------------------------------
383#include "implicit_f.inc"
384C-----------------------------------------------
385C D u m m y A r g u m e n t s
386C-----------------------------------------------
387 INTEGER OK
388 my_real
389 . pc(3),p(3),d
390C-----------------------------------------------
391C L o c a l V a r i a b l e s
392C-----------------------------------------------
393 my_real
394 . p1(3),p2(3),suma
395C-----------------------------------------------
396 suma = sum((p(1:3) - pc(1:3))**2)
397 suma = four*suma
398 IF(suma <= d**2) ok = 1
399C
400 RETURN

◆ projskew()

subroutine projskew ( po,
sk,
integer isk )

Definition at line 92 of file rdbox.F.

93C-----------------------------------------------
94C I m p l i c i t T y p e s
95C-----------------------------------------------
96#include "implicit_f.inc"
97C-----------------------------------------------
98C C o m m o n B l o c k s
99C-----------------------------------------------
100#include "param_c.inc"
101C-----------------------------------------------
102C D u m m y A r g u m e n t s
103C-----------------------------------------------
104 INTEGER ISK
105 my_real
106 . po(3),sk(lskew,*)
107C-----------------------------------------------
108C L o c a l V a r i a b l e s
109C-----------------------------------------------
110 INTEGER JSK
111 my_real
112 . sum,pn(3)
113C-----------------------------------------------
114 jsk = isk + 1
115C
116 pn(1) = po(1)*sk(1,jsk) + po(2)*sk(2,jsk) + po(3)*sk(3,jsk)
117 sum = sk(1,jsk)**2 + sk(2,jsk)**2 + sk(3,jsk)**2
118 sum = sqrt(sum)
119 pn(1) = pn(1) / sum
120C
121 pn(2) = po(1)*sk(4,jsk) + po(2)*sk(5,jsk) + po(3)*sk(6,jsk)
122 sum = sk(4,jsk)**2 + sk(5,jsk)**2 + sk(6,jsk)**2
123 sum = sqrt(sum)
124 pn(2) = pn(2) / sum
125C
126 pn(3) = po(1)*sk(7,jsk) + po(2)*sk(8,jsk) + po(3)*sk(9,jsk)
127 sum = sk(7,jsk)**2 + sk(8,jsk)**2 + sk(9,jsk)**2
128 sum = sqrt(sum)
129 pn(3) = pn(3) / sum
130C
131 po(1) = pn(1)
132 po(2) = pn(2)
133 po(3) = pn(3)
134C
135 RETURN

◆ vec_length()

function vec_length ( integer dimens,
x )

Definition at line 318 of file rdbox.F.

319C-----------------
320C VEC_LENGTH returns the Euclidean length of a vector.
321C
322 IMPLICIT NONE
323C
324 INTEGER DIMENS
325 my_real
326 . vec_length,x(dimens)
327C-------------------------------
328 vec_length = sqrt(sum((x(1:dimens))**2))
329C
330 RETURN