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 227 of file rdbox.F.

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

◆ 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-----------------------------------------------
56 INTEGER I
58 . p1(3),p2(3),p3(3),p4(3),pp2(3)
59C-----------------------------------------------
60 p1(1) = xp1
61 p1(2) = yp1
62 p1(3) = zp1
63 CALL projskew(p1,skew,isk)
64C
65 pp2(1) = xp2
66 pp2(2) = yp2
67 pp2(3) = zp2
68 CALL projskew(pp2,skew,isk)
69C
70 p2(1) = pp2(1)
71 p2(2) = p1(2)
72 p2(3) = p1(3)
73C
74 p3(1) = p1(1)
75 p3(2) = pp2(2)
76 p3(3) = p1(3)
77C
78 p4(1) = p1(1)
79 p4(2) = p1(2)
80 p4(3) = pp2(3)
81C
82 CALL projskew(nodin,skew,isk)
83C
84 CALL inside_parallelepiped(p1, p2, p3, p4, nodin, ok)
85C
86 RETURN
subroutine inside_parallelepiped(p1, p2, p3, p4, p, ok)
Definition rdbox.F:144
subroutine projskew(po, sk, isk)
Definition rdbox.F:94

◆ checksphere()

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

Definition at line 346 of file rdbox.F.

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

◆ inside_cylinder()

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

Definition at line 266 of file rdbox.F.

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

◆ inside_parallelepiped()

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

Definition at line 143 of file rdbox.F.

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

◆ inside_sphere()

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

Definition at line 376 of file rdbox.F.

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

◆ projskew()

subroutine projskew ( po,
sk,
integer isk )

Definition at line 93 of file rdbox.F.

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

◆ vec_length()

function vec_length ( integer dimens,
x )

Definition at line 319 of file rdbox.F.

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