OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_acc.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/.
23C=======================================================================
24!||====================================================================
25!|| sensor_acc ../engine/source/tools/sensor/sensor_acc.F
26!||--- called by ------------------------------------------------------
27!|| sensor_base ../engine/source/tools/sensor/sensor_base.F
28!||--- uses -----------------------------------------------------
29!|| sensor_mod ../common_source/modules/sensor_mod.F90
30!||====================================================================
31 SUBROUTINE sensor_acc(SENSOR ,ACC)
32C-----------------------------------------------
33C M o d u l e s
34C-----------------------------------------------
35 USE sensor_mod
36C-----------------------------------------------
37C I m p l i c i t T y p e s
38C-----------------------------------------------
39#include "implicit_f.inc"
40C-----------------------------------------------
41C C o m m o n B l o c k s
42C-----------------------------------------------
43#include "param_c.inc"
44#include "com08_c.inc"
45#include "units_c.inc"
46#include "comlock.inc"
47#include "task_c.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 my_real, DIMENSION(LLACCELM,*) :: acc
52 TYPE (SENSOR_STR_) ,TARGET :: SENSOR
53C----------------------------------------------------------
54C Local Variables
55C----------------------------------------------------------
56 INTEGER I,J,K,NACC,IACC,IDIR,ICRIT
57c
58 my_real :: acc_x,acc_y,acc_z,accmin,tstart,tmin,tdelay,infinity
59 parameter(infinity = 1.0e20)
60C=======================================================================
61 IF (sensor%STATUS == 1) RETURN ! already activated
62c
63 tmin = sensor%TMIN
64 tdelay = sensor%TDELAY
65 nacc = sensor%IPARAM(1)
66c
67 DO i = 1,nacc
68 j = (i-1)*2 + 1
69 k = (i-1)*3
70 iacc = sensor%IPARAM(j+1)
71 idir = sensor%IPARAM(j+2)
72 accmin = sensor%RPARAM(k+1)
73 tmin = sensor%RPARAM(k+2)
74 tstart = sensor%RPARAM(k+3)
75 icrit = 0
76 IF (idir == 1) THEN
77C X
78 IF (abs(acc(20,iacc)) > accmin) icrit = 1
79 ELSEIF (idir == 2) THEN
80C Y
81 IF (abs(acc(21,iacc)) > accmin) icrit = 1
82 ELSEIF (idir == 4) THEN
83C Z
84 IF (abs(acc(22,iacc)) > accmin) icrit = 1
85 ELSEIF (idir == 3) THEN
86C XY
87 IF (sqrt(acc(20,iacc)*acc(20,iacc)
88 . + acc(21,iacc)*acc(21,iacc)) > accmin) icrit = 1
89 ELSEIF (idir == 5) THEN
90C XZ
91 IF (sqrt(acc(20,iacc)*acc(20,iacc)
92 . + acc(22,iacc)*acc(22,iacc)) > accmin) icrit = 1
93 ELSEIF (idir == 6) THEN
94C YZ
95 IF (sqrt(acc(21,iacc)*acc(21,iacc)
96 . + acc(22,iacc)*acc(22,iacc)) > accmin) icrit = 1
97 ELSEIF (idir == 7) THEN
98C XYZ
99 IF (sqrt(acc(20,iacc)*acc(20,iacc)
100 . + acc(21,iacc)*acc(21,iacc)
101 . + acc(22,iacc)*acc(22,iacc)) > accmin) icrit = 1
102 ENDIF
103c----------------------------------------------------------------
104c check activation status
105c----------------------------------------------------------------
106 IF (sensor%TCRIT + tmin > tt) THEN
107 IF (icrit == 0) THEN
108 sensor%TCRIT = infinity
109 ELSE IF (sensor%TCRIT == infinity) THEN
110 sensor%TCRIT = min(sensor%TCRIT, tt)
111 END IF
112 END IF
113c
114 IF (sensor%TSTART == infinity .and. sensor%TCRIT < infinity) THEN
115 sensor%RPARAM(k+3) = sensor%TCRIT + tmin + tdelay
116 END IF
117 IF (sensor%RPARAM(k+3) <= tt) THEN ! sensor activation
118 sensor%STATUS = 1
119 sensor%TSTART = tt
120 END IF
121
122 END DO
123c-----------------------------------------------------------------------
124 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
125#include "lockon.inc"
126 WRITE (istdo,1100) sensor%SENS_ID,sensor%TSTART
127 WRITE (iout ,1100) sensor%SENS_ID,sensor%TSTART
128#include "lockoff.inc"
129 ENDIF
130c-----------------------------------------------------------------------
1311100 FORMAT(' SENSOR NUMBER ',i10,' ,ACTIVATED AT TIME ',1pe12.5)
132c-----------------------------------------------------------------------
133 RETURN
134 END SUBROUTINE
#define my_real
Definition cppsort.cpp:32
#define min(a, b)
Definition macros.h:20
subroutine sensor_acc(sensor, acc)
Definition sensor_acc.F:32