OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
dist_node_plane_3n.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/.
23!||====================================================================
24!|| dist_node_plane_3n ../engine/source/tools/sensor/dist_node_plane_3n.F
25!||--- called by ------------------------------------------------------
26!|| sensor_dist_surf ../engine/source/tools/sensor/sensor_dist_surf.F
27!||====================================================================
28 SUBROUTINE dist_node_plane_3n (DIST,
29 . XNOD,YNOD,ZNOD,XP1,YP1,ZP1,XP2,YP2,ZP2,XP3,YP3,ZP3)
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
66 END SUBROUTINE
67
#define my_real
Definition cppsort.cpp:32
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
subroutine dist_node_plane_3n(dist, xnod, ynod, znod, xp1, yp1, zp1, xp2, yp2, zp2, xp3, yp3, zp3)