OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_monvol_type1.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!|| hm_read_monvol_type1_mod ../starter/source/airbag/hm_read_monvol_type1.F
25!||--- called by ------------------------------------------------------
26!|| read_monvol ../starter/source/airbag/read_monvol.F
27!||====================================================================
29 CONTAINS
30!||====================================================================
31!|| hm_read_monvol_type1 ../starter/source/airbag/hm_read_monvol_type1.F
32!||--- called by ------------------------------------------------------
33!|| read_monvol ../starter/source/airbag/read_monvol.F
34!||--- calls -----------------------------------------------------
35!|| ancmsg ../starter/source/output/message/message.F
36!|| freerr ../starter/source/starter/freform.F
37!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
38!|| monvol_check_surfclose ../starter/share/modules1/monvol_struct_mod.F
39!|| monvol_compute_volume ../starter/share/modules1/monvol_struct_mod.F
40!|| monvol_orient_surf ../starter/share/modules1/monvol_struct_mod.F
41!|| monvol_reverse_normals ../starter/share/modules1/monvol_struct_mod.F
42!||--- uses -----------------------------------------------------
43!|| message_mod ../starter/share/message_module/message_mod.F
44!|| monvol_struct_mod ../starter/share/modules1/monvol_struct_mod.F
45!|| submodel_mod ../starter/share/modules1/submodel_mod.F
46!||====================================================================
47 SUBROUTINE hm_read_monvol_type1(T_MONVOLN,
48 . UNITAB, LUID, IGRSURF,
49 . ITAB, X, PM, GEO, IXC, IXTG,LSUBMODEL)
50C-----------------------------------------------
51C M o d u l e s
52C-----------------------------------------------
53 USE unitab_mod
54 USE groupdef_mod
55 USE message_mod
57 USE submodel_mod
58C-----------------------------------------------
59C I m p l i c i t T y p e s
60C-----------------------------------------------
61#include "implicit_f.inc"
62C-----------------------------------------------
63C C o m m o n B l o c k s
64C-----------------------------------------------
65C NSURF
66#include "com04_c.inc"
67C KMONVO, IREC
68C NIMV, NRVOLU
69#include "param_c.inc"
70C IIN
71#include "units_c.inc"
72C-----------------------------------------------
73C D u m m y A r g u m e n t s
74C-----------------------------------------------
75 TYPE(UNIT_TYPE_), INTENT(IN) :: UNITAB
76 INTEGER, INTENT(IN) :: LUID
77 INTEGER, INTENT(IN) :: ITAB(*), IXC(NIXC, *), IXTG(NIXTG, *)
78 my_real, INTENT(IN) :: x(3, *), geo(npropg, *), pm(npropm, *)
79 TYPE (SURF_), INTENT(INOUT), DIMENSION(NSURF) :: IGRSURF
80 TYPE(monvol_struct_), INTENT(INOUT) :: T_MONVOLN
81 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
82C-----------------------------------------------
83C L o c a l V a r i a b l e s
84C-----------------------------------------------
85 INTEGER :: II
86 INTEGER :: SURFID
87 my_real :: fac_m, fac_l, fac_t, fac_c
88 my_real :: scal_t, scal_p, scal_s, scal_a, scal_d
89 LOGICAL :: FOUND
90 my_real :: sa, rot, vol, vmin, veps, amu, sv
91 LOGICAL :: IS_AVAILABLE
92C-----------------------------------------------
93C B e g i n n i n g o f s o u r c e
94C-----------------------------------------------
95
96 is_available = .false.
97C =======
98C Reading
99C =======
100C Line 1
101 CALL hm_get_intv('surf_IDex', surfid, is_available, lsubmodel)
102C ================
103C Check operations
104C ================
105C External surface check
106 t_monvoln%IVOLU(4) = 0
107 found = .false.
108 DO ii = 1, nsurf
109 IF (surfid == igrsurf(ii)%ID) THEN
110 t_monvoln%IVOLU(4) = ii
111 t_monvoln%EXT_SURFID = ii
112 found = .true.
113 EXIT
114 ENDIF
115 ENDDO
116 IF (.NOT. found) THEN
117 CALL freerr(3)
118 ELSEIF (igrsurf(t_monvoln%IVOLU(4))%ISH4N3N == 0) THEN
119 CALL ancmsg(msgid = 18, anmode = aninfo, msgtype = msgerror,
120 . i1 = t_monvoln%ID, c1 = t_monvoln%TITLE, i2 = surfid)
121 CALL freerr(3)
122 ENDIF
123
124C Check surface closure
125 CALL monvol_check_surfclose(t_monvoln, itab, igrsurf(t_monvoln%EXT_SURFID), x)
126C Set all normal on same side
127 CALL monvol_orient_surf(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
128 . igrsurf(t_monvoln%EXT_SURFID),ixc, ixtg, x, 1)
129C Compute Monvon volume
130 CALL monvol_compute_volume(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, igrsurf(t_monvoln%EXT_SURFID),
131 . itab, x, pm, geo, ixc, ixtg,
132 . sa, rot, vol, vmin, veps, sv)
133C Reverse all normals to ensure positive volume
134 CALL monvol_reverse_normals(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
135 . igrsurf(t_monvoln%EXT_SURFID),ixc,ixtg,vol, x, 1)
136
137C =====
138C Units
139C =====
140 fac_m = unitab%FAC_M(luid)
141 fac_l = unitab%FAC_L(luid)
142 fac_t = unitab%FAC_T(luid)
143 fac_c = fac_m / (fac_l * fac_t * fac_t)
144
145C Default values
146 scal_t = one * fac_t
147 scal_p = one * fac_c
148 scal_s = one * fac_l * fac_l
149 scal_a = one
150 scal_d = one * fac_l
151
152C =====
153C Store
154C =====
155 t_monvoln%RVOLU(26) = one / scal_t
156 t_monvoln%RVOLU(27) = one / scal_p
157 t_monvoln%RVOLU(28) = one / scal_s
158 t_monvoln%RVOLU(29) = one / scal_a
159 t_monvoln%RVOLU(30) = one / scal_d
160C
161 amu = zero
162 t_monvoln%RVOLU(2) = amu
163 t_monvoln%RVOLU(16) = vol + veps
164 t_monvoln%RVOLU(18) = sa
165 t_monvoln%RVOLU(21) = rot
166 t_monvoln%RVOLU(22:24) = zero
167
168C =========
169C Print out
170C =========
171 WRITE(iout, 1005) surfid
172 WRITE(iout, 1003) scal_t, scal_p, scal_s, scal_a, scal_d
173 WRITE(iout, 1002) sa, sv, vol
174C-----------------------------------------------
175C E n d o f s o u r c e
176C-----------------------------------------------
177
178 RETURN
179 1002 FORMAT(
180 . /5x,'INITIAL SURFACE OF MONITORED VOLUME . .=',1pg20.13,
181 . /5x,'SURFACE ERROR(NE.0 FOR NON CLOSED SURF)=',1pg20.13,
182 . /5x,'INITIAL VOLUME OF MONITORED VOLUME. . .=',1pg20.13)
183 1003 FORMAT(
184 . 5x,'UNIT SCALE FOR TIME FUNCTIONS =',1pg20.13,
185 . /5x,'UNIT SCALE FOR PRESSURE FUNCTIONS =',1pg20.13,
186 . /5x,'UNIT SCALE FOR AREA FUNCTIONS =',1pg20.13,
187 . /5x,'UNIT SCALE FOR ANGLE FUNCTIONS =',1pg20.13,
188 . /5x,'UNIT SCALE FOR DISTANCE FUNCTIONS =',1pg20.13)
189 1005 FORMAT( 5x,'EXTERNAL SURFACE ID . . . . . . . . . .=',i10)
190 END SUBROUTINE hm_read_monvol_type1
191 END MODULE hm_read_monvol_type1_mod
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_read_monvol_type1(t_monvoln, unitab, luid, igrsurf, itab, x, pm, geo, ixc, ixtg, lsubmodel)
subroutine monvol_compute_volume(t_monvoln, title, ivolu, surf, itab, node_coord, pm, geo, ixc, ixtg, sa, rot, vol, vmin, veps, sv)
subroutine monvol_check_surfclose(t_monvoln, itab, surf, x)
subroutine monvol_orient_surf(t_monvoln, title, ivolu, itab, surf, ixc, ixtg, x, itype)
subroutine monvol_reverse_normals(t_monvoln, title, ivolu, itab, surf, ixc, ixtg, vol, x, itype)
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 freerr(it)
Definition freform.F:506