OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_dist_surf.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "units_c.inc"
#include "com04_c.inc"
#include "com08_c.inc"
#include "task_c.inc"
#include "lockon.inc"
#include "lockoff.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine sensor_dist_surf (sensor, x, igrsurf)

Function/Subroutine Documentation

◆ sensor_dist_surf()

subroutine sensor_dist_surf ( type (sensor_str_) sensor,
dimension(3,numnod) x,
type (surf_), dimension(nsurf), target igrsurf )

Definition at line 33 of file sensor_dist_surf.F.

34!$COMMENT
35! SENSOR_DIST_SURF description
36! computation of distance to surface for sensor typ16 + plane defined by 3 nodes
37! and modification of the state of sensor
38! For the other surface, the distance computation is done in SENSOR_DIST_SURF0 routine
39!
40! SENSOR_DIST_SURF0 organization :
41! - computation of local distance for sensor 16 + plane defined by 3 nodes
42! - sensor state modification
43!$ENDCOMMENT
44c-----------------------------------------------
45C M o d u l e s
46c-----------------------------------------------
47 USE groupdef_mod
48 USE sensor_mod
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53#include "comlock.inc"
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "units_c.inc"
58#include "com04_c.inc"
59#include "com08_c.inc"
60#include "task_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 my_real ,DIMENSION(3,NUMNOD) :: x
65 TYPE (SURF_) ,DIMENSION(NSURF), TARGET :: IGRSURF
66 TYPE (SENSOR_STR_) :: SENSOR
67C----------------------------------------------------------
68C Local Variables
69C----------------------------------------------------------
70 INTEGER ISURF, INOD, NP1, NP2, NP3, ICRIT, IFLAG
71 my_real dist,dmin,dmax,tdelay,tmin
72 my_real xnod,ynod,znod,xp1,yp1,zp1,xp2,yp2,zp2,xp3,yp3,zp3
73C=======================================================================
74 IF (sensor%STATUS == 1) RETURN ! already activated
75
76C.....................................................
77C ==> DIST between node and a plan defined by 3 nodes
78C.....................................................
79C ID_N1 : Node identifier
80C ID_PN1 : Plan Node 1 identifier
81C ID_PN2 : Plan Node 2 identifier
82C ID_PN3 : Plan Node 3 identifier
83C
84 tmin = sensor%TMIN
85 tdelay = sensor%TDELAY ! time delay before activation
86 inod = sensor%IPARAM(1)
87 isurf = sensor%IPARAM(2)
88c
89 dmin = sensor%RPARAM(1)
90 dmax = sensor%RPARAM(2)
91 icrit = 0
92 iflag = 0
93c
94c... Current position of reference node
95c
96 xnod = x(1,inod)
97 ynod = x(2,inod)
98 znod = x(3,inod)
99c
100c
101 IF (isurf == 0) THEN ! calculate distance to plane defined by 3 nodes
102c
103 np1 = sensor%IPARAM(3)
104 np2 = sensor%IPARAM(4)
105 np3 = sensor%IPARAM(5)
106 xp1 = x(1,np1)
107 yp1 = x(2,np1)
108 zp1 = x(3,np1)
109 xp2 = x(1,np2)
110 yp2 = x(2,np2)
111 zp2 = x(3,np2)
112 xp3 = x(1,np3)
113 yp3 = x(2,np3)
114 zp3 = x(3,np3)
115 CALL dist_node_plane_3n(dist,
116 . xnod,ynod,znod,xp1,yp1,zp1,xp2,yp2,zp2,xp3,yp3,zp3)
117c
118 sensor%VALUE = dist
119 END IF
120 IF (sensor%VALUE <= dmin) THEN
121 icrit = 1
122 iflag = 1
123 ELSE IF (sensor%VALUE >= dmax) THEN
124 icrit = 1
125 iflag = 2
126 END IF
127 sensor%RESULTS(1) = sensor%VALUE
128c----------------------------------------------------------------
129c check activation status
130c----------------------------------------------------------------
131 IF (sensor%TCRIT + tmin > tt) THEN
132 IF (icrit == 0) THEN
133 sensor%TCRIT = infinity
134 ELSE IF (sensor%TCRIT == infinity) THEN
135 sensor%TCRIT = min(sensor%TCRIT, tt)
136 END IF
137 END IF
138 IF (sensor%TSTART == infinity .and. sensor%TCRIT < infinity) THEN
139 sensor%TSTART = sensor%TCRIT + tmin + tdelay
140 END IF
141 IF (sensor%TSTART <= tt) THEN ! sensor activation
142 sensor%STATUS = 1
143 END IF
144c----------------------------------------------------------
145 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
146#include "lockon.inc"
147 WRITE (istdo,1100) sensor%SENS_ID,sensor%TSTART
148 WRITE (iout ,1100) sensor%SENS_ID,sensor%TSTART
149 IF (iflag == 1) THEN
150 WRITE (iout ,1200) dmin,dist
151 ELSE IF (iflag == 2) THEN
152 WRITE (iout ,1300) dmax,dist
153 END IF
154#include "lockoff.inc"
155 END IF
156c-----------------------------------------------------------------------
1571100 FORMAT(' SENSOR NUMBER ',i10,' ,activated at time ',1PE12.5)
1581200 FORMAT(' TARGET min distance to plan = ',1PE12.5,/
159 . ' current distance after tmin and tdelay = ',1PE12.5)
1601300 FORMAT(' TARGET max distance to plan = ',1PE12.5,/
161 . ' current distance after tmin and tdelay = ',1PE12.5)
162c----------------------------------------------------------
163 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine dist_node_plane_3n(dist, xnod, ynod, znod, xp1, yp1, zp1, xp2, yp2, zp2, xp3, yp3, zp3)
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21