OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_base.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!|| sensor_base ../engine/source/tools/sensor/sensor_base.F
25!||--- called by ------------------------------------------------------
26!|| resol ../engine/source/engine/resol.f
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../engine/source/output/message/message.f
29!|| arret ../engine/source/system/arret.F
30!|| sensor_acc ../engine/source/tools/sensor/sensor_acc.F
31!|| sensor_contact ../engine/source/tools/sensor/sensor_contact.F
32!|| sensor_dist ../engine/source/tools/sensor/sensor_dist.F
33!|| sensor_dist_surf ../engine/source/tools/sensor/sensor_dist_surf.F
34!|| sensor_energy ../engine/source/tools/sensor/sensor_energy.F
35!|| sensor_gauge ../engine/source/tools/sensor/sensor_gauge.F
36!|| sensor_hic ../engine/source/tools/sensor/sensor_hic.F
37!|| sensor_nic ../engine/source/tools/sensor/sensor_nic.F
38!|| sensor_python ../engine/source/tools/sensor/sensor_python.F90
39!|| sensor_rbody ../engine/source/tools/sensor/sensor_rbody.F
40!|| sensor_rwall ../engine/source/tools/sensor/sensor_rwall.F
41!|| sensor_section ../engine/source/tools/sensor/sensor_section.F
42!|| sensor_temp ../engine/source/tools/sensor/sensor_temp.F
43!|| sensor_time ../engine/source/tools/sensor/sensor_time.f
44!|| sensor_vel ../engine/source/tools/sensor/sensor_vel.F
45!|| sensor_work ../engine/source/tools/sensor/sensor_work.F
46!||--- uses -----------------------------------------------------
47!|| groupdef_mod ../common_source/modules/groupdef_mod.F
48!|| message_mod ../engine/share/message_module/message_mod.F
49!|| python_funct_mod ../common_source/modules/python_mod.F90
50!|| sensor_mod ../common_source/modules/sensor_mod.F90
51!|| sensor_python_mod ../engine/source/tools/sensor/sensor_python.f90
52!||====================================================================
53 SUBROUTINE sensor_base(SENSORS ,NSENSOR ,TIME ,TIMESTEP ,
54 . XSENS ,IPARI ,PARTSAV2 ,GAUGE ,FSAV ,
55 . X ,V ,A ,ACC ,NPRW ,
56 . SUBSET ,IGRSURF ,IGRNOD ,PYTHON)
57C-----------------------------------------------
58C M o d u l e s
59C-----------------------------------------------
60 USE python_funct_mod
61 USE sensor_python_mod
62 USE groupdef_mod
63 USE sensor_mod
64 USE message_mod
65C-----------------------------------------------
66C I m p l i c i t T y p e s
67C-----------------------------------------------
68#include "implicit_f.inc"
69#include "comlock.inc"
70C-----------------------------------------------
71C C o m m o n B l o c k s
72C-----------------------------------------------
73#include "param_c.inc"
74#include "com04_c.inc"
75#include "userlib.inc"
76C-----------------------------------------------
77C D u m m y A r g u m e n t s
78C-----------------------------------------------
79 INTEGER ,INTENT(IN) :: NSENSOR
80 INTEGER ,DIMENSION(NPARI,NINTER) ,INTENT(IN) :: IPARI
81 INTEGER ,DIMENSION(*) ,INTENT(IN) :: NPRW
82 my_real ,DIMENSION(3,NUMNOD) ,INTENT(IN) :: x,v,a
83 my_real ,DIMENSION(12,NSENSOR) ,INTENT(INOUT) :: xsens
84 my_real ,DIMENSION(LLACCELM,*) ,INTENT(IN) :: acc
85 my_real ,DIMENSION(NTHVKI,*) ,INTENT(IN) :: fsav
86 my_real ,DIMENSION(LLGAUGE,*) ,INTENT(IN) :: gauge
87 my_real ,DIMENSION(2,*) ,INTENT(IN) :: partsav2
88 my_real ,INTENT(IN) :: time,timestep
89 TYPE (SUBSET_) ,DIMENSION(NSUBS) ,INTENT(IN) :: SUBSET
90 TYPE(surf_) ,DIMENSION(NSURF) ,INTENT(IN) :: IGRSURF
91 TYPE(group_) ,DIMENSION(NGRNOD) ,INTENT(IN) :: IGRNOD
92 TYPE (SENSORS_) ,INTENT(INOUT) :: SENSORS
93 TYPE(python_), INTENT(INOUT) :: PYTHON
94C-----------------------------------------------
95C L o c a l V a r i a b l e s
96C-----------------------------------------------
97 INTEGER TYP,ISENS,SENS_ID,SIZE,STABS,SFSAV
98 CHARACTER(LEN=256) :: OPTION
99 LOGICAL :: ANY_PYTHON_SENSOR
100 INTEGER, DIMENSION(:), ALLOCATABLE :: UIDS
101 DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: RESULTS
102 INTEGER, DIMENSION(:), ALLOCATABLE :: STATUSES
103 INTEGER, DIMENSION(:), ALLOCATABLE :: TYPES
104C-----------------------------------------------
105C D e s c r i p t i o n
106C-----------------------------------------------
107C this routine checks activation condition of all basic sensor types
108C=======================================================================
109 any_python_sensor = .false.
110 stabs = sensors%STABSEN
111 sfsav = sensors%SFSAV
112c--------------------------------------------------
113c Parallel loop over sensor list
114c--------------------------------------------------
115
116!$OMP PARALLEL DO PRIVATE(ISENS,TYP)
117c--------------------------------------------------
118 DO isens = 1,nsensor
119 sensors%SENSOR_TAB(isens)%RESULTS(sensor_result_size) = zero
120 typ = sensors%SENSOR_TAB(isens)%TYPE
121C--------------------------------
122C SENSOR - TIME
123C--------------------------------
124 IF (typ == 0) THEN
125
126 CALL sensor_time(sensors%SENSOR_TAB(isens) ,time ,timestep)
127
128C--------------------------------
129C SENSOR - ACCELEROMETER
130C--------------------------------
131 ELSEIF (typ == 1) THEN
132c
133 CALL sensor_acc(sensors%SENSOR_TAB(isens) ,acc)
134c
135C--------------------------------
136C SENSOR - DISTANCE
137C--------------------------------
138 ELSEIF (typ == 2) THEN
139c
140 CALL sensor_dist(sensors%SENSOR_TAB(isens) ,x ,xsens(1,isens))
141c
142C--------------------------------
143C SENSOR - CONTACT
144C--------------------------------
145 ELSEIF (typ == 6)THEN
146 CALL sensor_contact(sensors%SENSOR_TAB(isens),
147 . ipari ,sfsav ,stabs ,sensors%TABSENSOR ,sensors%FSAV)
148
149C--------------------------------
150C SENSOR - RWALL
151C--------------------------------
152 ELSEIF(typ == 7)THEN
153
154 CALL sensor_rwall(sensors%SENSOR_TAB(isens) ,
155 . nprw ,sfsav ,stabs ,sensors%TABSENSOR ,sensors%FSAV)
156
157C--------------------------------
158C SENSOR - NODAL VELOCITY
159C--------------------------------
160 ELSEIF(typ == 9)THEN
161
162 CALL sensor_vel(sensors%SENSOR_TAB(isens),v)
163
164C--------------------------------
165C SENSOR - GAUGE
166C--------------------------------
167 ELSEIF (typ == 10) THEN
168
169 CALL sensor_gauge(sensors%SENSOR_TAB(isens) ,gauge)
170
171C--------------------------------
172C SENSOR - RBODY
173C--------------------------------
174 ELSEIF (typ == 11) THEN
175
176 CALL sensor_rbody(sensors%SENSOR_TAB(isens),sfsav ,stabs ,sensors%TABSENSOR,sensors%FSAV)
177
178
179C--------------------------------
180C SENSOR - SECTION
181C--------------------------------
182 ELSEIF (typ == 12) THEN
183
184 CALL sensor_section(sensors%SENSOR_TAB(isens),
185 . sfsav ,stabs ,sensors%TABSENSOR ,fsav ,sensors%FSAV )
186
187C--------------------------------
188C SENSOR WORK
189C--------------------------------
190 ELSEIF (typ == 13)THEN
191
192 CALL sensor_work(sensors%SENSOR_TAB(isens),x ,xsens(1,isens) ,
193 . sfsav ,stabs ,sensors%TABSENSOR ,sensors%FSAV )
194c
195c--------------------------------
196c SENSOR --- ENERGY ---
197c--------------------------------
198 ELSEIF (typ == 14) THEN
199
200 CALL sensor_energy(sensors%SENSOR_TAB(isens),isens ,subset,partsav2,
201 * sensors%NSENSOR,sensors%SENSOR_STRUCT )
202c
203c--------------------------------
204c SENSOR Distance to surface
205C--------------------------------
206 ELSEIF (typ == 15) THEN
207c
208 CALL sensor_dist_surf(sensors%SENSOR_TAB(isens) ,x ,igrsurf )
209c
210c--------------------------------
211c SENSOR HIC
212c--------------------------------
213 ELSEIF (typ == 16) THEN
214c
215 CALL sensor_hic(sensors%SENSOR_TAB(isens) ,a ,acc )
216c
217c--------------------------------
218c SENSOR TEMPERATURE
219c--------------------------------
220 ELSEIF (typ == 17) THEN
221c
222 CALL sensor_temp(sensors%SENSOR_TAB(isens) ,isens ,igrnod)
223c
224c--------------------------------
225 ELSEIF (typ == 19) THEN
226c--------------------------------
227c SENSOR NIC-Nij
228c
229 CALL sensor_nic(sensors%SENSOR_TAB(isens) )
230c
231c--------------------------------
232 ELSEIF (typ == 29) THEN
233c--------------------------------
234c USER SENSOR TYPE 29
235
236 sens_id = sensors%SENSOR_TAB(isens)%SENS_ID
237
238 IF (userl_avail==1) THEN
239 CALL eng_userlib_user_sens(typ,sens_id)
240 ELSE
241 ! ----------------
242 ! ERROR to be printed & exit
243 option='USER SENSOR 29'
244 size=len_trim(option)
245 CALL ancmsg(msgid=257,c1=option(1:size),anmode=aninfo)
246 CALL arret(2)
247 ! ----------------
248 ENDIF
249c--------------------------------
250 ELSEIF (typ == 30) THEN
251c--------------------------------
252c USER SENSOR TYPE 30
253
254 sens_id = sensors%SENSOR_TAB(isens)%SENS_ID
255
256 IF (userl_avail==1) THEN
257 CALL eng_userlib_user_sens(typ,sens_id)
258 ELSE
259 ! ----------------
260 ! ERROR to be printed & exit
261 option='USER SENSOR 30'
262 size=len_trim(option)
263 CALL ancmsg(msgid=257,c1=option(1:size),anmode=aninfo)
264 CALL arret(2)
265 ! ----------------
266 ENDIF
267c--------------------------------
268 ELSEIF (typ == 31) THEN
269c--------------------------------
270c USER SENSOR TYPE 31
271 sens_id = sensors%SENSOR_TAB(isens)%SENS_ID
272
273 IF (userl_avail==1) THEN
274 CALL eng_userlib_user_sens(typ,sens_id)
275 ELSE
276 ! ----------------
277 ! ERROR to be printed & exit
278 option='USER SENSOR 31'
279 size=len_trim(option)
280 CALL ancmsg(msgid=257,c1=option(1:size),anmode=aninfo)
281 CALL arret(2)
282 ! ----------------
283 ENDIF
284 ELSEIF (typ == sensor_type_python) THEN
285c CALL SENSOR_PYTHON(SENSORS%SENSOR_TAB(ISENS) )
286 any_python_sensor = .true.
287 ENDIF ! TYP
288c----
289 END DO ! ISENS
290c--------------------------------------------------
291c END of parallel loop
292!$OMP END PARALLEL DO
293c--------------------------------------------------
294 IF(python%NB_FUNCTS > 0) THEN
295 ALLOCATE(uids(nsensor))
296 ALLOCATE(results(sensor_result_size,nsensor))
297 ALLOCATE(statuses(nsensor))
298 ALLOCATE(types(nsensor))
299 DO isens = 1,nsensor
300 typ = sensors%SENSOR_TAB(isens)%TYPE
301 types(isens) = typ
302 uids(isens) = sensors%SENSOR_TAB(isens)%SENS_ID
303 statuses(isens) = sensors%SENSOR_TAB(isens)%STATUS
304 results(1:sensor_result_size,isens) = sensors%SENSOR_TAB(isens)%RESULTS(1:sensor_result_size)
305 END DO ! ISENS
306 CALL python_update_sensors(types,uids,statuses,results,nsensor)
307 DEALLOCATE(types)
308 DEALLOCATE(uids)
309 DEALLOCATE(results)
310 DEALLOCATE(statuses)
311 ENDIF
312 IF (any_python_sensor) THEN
313 DO isens = 1,nsensor
314 typ = sensors%SENSOR_TAB(isens)%TYPE
315 IF (typ == sensor_type_python) THEN
316 CALL sensor_python(sensors%SENSOR_TAB(isens))
317 ENDIF ! TYP
318 END DO ! ISENS
319 ENDIF
320c
321c--------------------------------------------------
322 IF (stabs > 0) sensors%FSAV(1:12,1:6,1:sfsav) = zero
323
324c-----------
325 RETURN
326 END
#define my_real
Definition cppsort.cpp:32
subroutine resol(timers, element, nodes, coupling, af, iaf, iskwn, neth, ipart, nom_opt, kxx, ixx, ixtg, ixs, ixq, ixt, ixp, ixr, ifill, mat_elem, ims, npc, ibcl, ibfv, idum, las, laccelm, nnlink, lnlink, iparg, dd_iad, igrv, iexlnk, kinet, ipari, nprw, iconx, npby, lpby, lrivet, nstrf, ljoint, nodpor, monvol, ilink, llink, linale, neflsw, nnflsw, icut, cluster, itask, inoise, thke, damp, pm, skews, geo, eani, bufmat, bufgeo, bufsf, w, veul, fill, dfill, alph, wb, dsave, asave, msnf, tf, forc, vel, fsav, fzero, xlas, accelm, agrv, fr_wave, failwave, parts0, elbuf, rwbuf, sensors, rwsav, rby, rivet, secbuf, volmon, lambda, wa, fv, partsav, uwa, val2, phi, segvar, r, crflsw, flsw, fani, xcut, anin, tani, secfcum, bufnois, idata, rdata, iframe, kxsp, ixsp, nod2sp, ispsym, ispcond, xframe, spbuf, xspsym, vspsym, pv, fsavd, ibvel, lbvel, wasph, w16, isphio, lprtsph, lonfsph, vsphio, fbvel, lagbuf, ibcslag, iactiv, dampr, gjbufi, gjbufr, rbmpc, ibmpc, sphveln, nbrcvois, nbsdvois, lnrcvois, lnsdvois, nercvois, nesdvois, lercvois, lesdvois, npsegcom, lsegcom, nporgeo, ixtg1, npbyl, lpbyl, rbyl, igeo, ipm, madprt, madsh4, madsh3, madsol, madnod, madfail, iad_rby, fr_rby, fr_wall, iad_rby2, fr_rby2, iad_i2m, fr_i2m, addcni2, procni2, iadi2, fr_mv, iadmv2, fr_ll, fr_rl, iadcj, fr_cj, fr_sec, iad_sec, iad_cut, fr_cut, rg_cut, newfront, fr_mad, fxbipm, fxbrpm, fxbnod, fxbmod, fxbglm, fxbcpm, fxbcps, fxblm, fxbfls, fxbdls, fxbdep, fxbvit, fxbacc, fxbelm, fxbsig, fxbgrvi, fxbgrvr, eigipm, eigibuf, eigrpm, lnodpor, fr_i18, graphe, iflow, rflow, lgrav, dd_r2r, fasolfr, fr_lagf, llagf, lprw, icontact, rcontact, sh4tree, sh3tree, ipadmesh, padmesh, msc, mstg, inc, intg, ptg, iskwp, nskwp, isensp, nsensp, iaccp, naccp, ipart_state, acontact, pcontact, factiv, sh4trim, sh3trim, mscnd, incnd, ibfflux, fbfflux, rbym, irbym, lnrbym, icodrbym, ibcv, fconv, ibftemp, fbftemp, iad_rbym, fr_rbym, weight_rm, ms_ply, zi_ply, inod_pxfem, iel_pxfem, iadc_pxfem, adsky_pxfem, icode_ply, icodt_ply, iskew_ply, admsms, madclnod, nom_sect, mcpc, mcptg, dmelc, dmeltg, mssa, dmels, mstr, dmeltr, msp, dmelp, msrt, dmelrt, ibcr, fradia, res_sms, table, irbe2, lrbe2, iad_rbe2, fr_rbe2, phie, msf, procne_pxfem, iadsdp_pxfem, iadrcp_pxfem, icfield, lcfield, cfield, msz2, diag_sms, iloadp, lloadp, loadp, inod_crk, iel_crk, iadc_crk, adsky_crk, cne_crk, procne_crk, iadsdp_crk, iadrcp_crk, ibufssg_io, ibc_ply, dmint2, ibordnode, elbuf_tab, por, nodedge, iad_edge, fr_edge, fr_nbedge, crknodiad, lgauge, gauge, igaup, ngaup, nodlevxf, dd_r2r_elem, nodglobxfe, sph2sol, sol2sph, irst, dmsph, wagap, xfem_tab, elcutc, nodenr, kxfenod2elc, enrtag, rthbu f, kxig3d, ixig3d, knot, wige, wsmcomp, stack, cputime_mp_glob, cputime_mp, tab_ump, poin_ump, sol2sph_typ, irunn_bis, addcsrect, iad_frnor, fr_nor, procnor, iad_fredg, fr_edg, drape_sh4n, drape_sh3n, tab_mat, nativ0_sms, multi_fvm, segquadfr, ms_2d, h3d_data, subsets, igrnod, igrbric, igrquad, igrsh4n, igrsh3n, igrtruss, igrbeam, igrspring, igrpart, igrsurf, forneqs, nloc_dmg, iskwp_l, knotlocpc, knotlocel, pinch_data, tag_skins6, ale_connectivity, xcell, xface, ne_nercvois, ne_nesdvois, ne_lercvois, ne_lesdvois, ibcscyc, lbcscyc, t_monvol, id_global_vois, face_vois, dynain_data, fcont_max, ebcs_tab, diffusion, kloadpinter, loadpinter, dgaploadint, drapeg, user_windows, output, interfaces, dt, loads, python, dpl0cld, vel0cld, ndamp_vrel, id_damp_vrel, fr_damp_vrel, ndamp_vrel_rbyg, names_and_titles, unitab, liflow, lrflow, glob_therm, pblast, rbe3)
Definition resol.F:633
subroutine sensor_acc(sensor, acc)
Definition sensor_acc.F:32
subroutine sensor_base(sensors, nsensor, time, timestep, xsens, ipari, partsav2, gauge, fsav, x, v, a, acc, nprw, subset, igrsurf, igrnod, python)
Definition sensor_base.F:57
subroutine sensor_contact(sensor, ipari, dimfb, stabs, tabs, fbsav6)
subroutine sensor_dist(sensor, x, xsens)
Definition sensor_dist.F:32
subroutine sensor_dist_surf(sensor, x, igrsurf)
subroutine sensor_energy(sensor, isens, subset, partsav2, nsensor, sensor_struct)
subroutine sensor_gauge(sensor, gauge)
subroutine sensor_hic(sensor, accn, accel)
Definition sensor_hic.F:33
subroutine sensor_nic(sensor)
Definition sensor_nic.F:33
subroutine sensor_rbody(sensor, dimfb, stabs, tabs, fbsav6)
subroutine sensor_rwall(sensor, nprw, dimfb, stabs, tabs, fbsav6)
subroutine sensor_section(sensor, dimfb, stabs, tabs, fsav, fbsav6)
subroutine sensor_temp(sensor, isens, igrnod)
Definition sensor_temp.F:32
subroutine sensor_time(sensor, time, timestep)
Definition sensor_time.F:33
subroutine sensor_vel(sensor, v)
Definition sensor_vel.F:34
subroutine sensor_work(sensor, x, xsens, dimfb, stabs, tabs, fbsav6)
Definition sensor_work.F:33
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:889
subroutine arret(nn)
Definition arret.F:87