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

Go to the source code of this file.

Functions/Subroutines

subroutine dist_node_plane_3n (dist, xnod, ynod, znod, xp1, yp1, zp1, xp2, yp2, zp2, xp3, yp3, zp3)

Function/Subroutine Documentation

◆ dist_node_plane_3n()

subroutine dist_node_plane_3n ( intent(out) dist,
intent(in) xnod,
intent(in) ynod,
intent(in) znod,
intent(in) xp1,
intent(in) yp1,
intent(in) zp1,
intent(in) xp2,
intent(in) yp2,
intent(in) zp2,
intent(in) xp3,
intent(in) yp3,
intent(in) zp3 )

Definition at line 28 of file dist_node_plane_3n.F.

30c-----------------------------------------------------------------------
31c Calculates distance between NODE(XNOD,YNOD,ZNOD)
32c and a flat surface defined by three points P1, P2, P3
33c-----------------------------------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36#include "implicit_f.inc"
37C-----------------------------------------------
38C D u m m y A r g u m e n t s
39C-----------------------------------------------
40 my_real , INTENT(IN) :: xnod,ynod,znod,
41 . xp1,yp1,zp1,xp2,yp2,zp2,xp3,yp3,zp3
42 my_real , INTENT(OUT) :: dist
43C----------------------------------------------------------
44C Local Variables
45C----------------------------------------------------------
46 my_real :: ax,ay,az,bx,by,bz,vecx,vecy,vecz,nx,ny,nz,norm
47C=======================================================================
48 ax = xp2 - xp1
49 ay = yp2 - yp1
50 az = zp2 - zp1
51 bx = xp3 - xp1
52 by = yp3 - yp1
53 bz = zp3 - zp1
54 vecx = xnod - xp1
55 vecy = ynod - yp1
56 vecz = znod - zp1
57c
58 nx = ay*bz - az*by
59 ny = az*bx - ax*bz
60 nz = ax*by - ay*bx
61 norm = sqrt(nx*nx + ny*ny + nz*nz)
62c distance to plane
63 dist = abs(nx*vecx + ny*vecy + nz*vecz) / norm
64c-----------
65 RETURN
#define my_real
Definition cppsort.cpp:32
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB