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
58 use element_mod , only : nixc,nixtg
59C-----------------------------------------------
60C I m p l i c i t T y p e s
61C-----------------------------------------------
62#include "implicit_f.inc"
63C-----------------------------------------------
64C C o m m o n B l o c k s
65C-----------------------------------------------
66C NSURF
67#include "com04_c.inc"
68C KMONVO, IREC
69C NIMV, NRVOLU
70#include "param_c.inc"
71C IIN
72#include "units_c.inc"
73C-----------------------------------------------
74C D u m m y A r g u m e n t s
75C-----------------------------------------------
76 TYPE(unit_type_), INTENT(IN) :: UNITAB
77 INTEGER, INTENT(IN) :: LUID
78 INTEGER, INTENT(IN) :: ITAB(*), IXC(NIXC, *), IXTG(NIXTG, *)
79 my_real, INTENT(IN) :: x(3, *), geo(npropg, *), pm(npropm, *)
80 TYPE (SURF_), INTENT(INOUT), DIMENSION(NSURF) :: IGRSURF
81 TYPE(monvol_struct_), INTENT(INOUT) :: T_MONVOLN
82 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
83C-----------------------------------------------
84C L o c a l V a r i a b l e s
85C-----------------------------------------------
86 INTEGER :: II
87 INTEGER :: SURFID
88 my_real :: fac_m, fac_l, fac_t, fac_c
89 my_real :: scal_t, scal_p, scal_s, scal_a, scal_d
90 LOGICAL :: FOUND
91 my_real :: sa, rot, vol, vmin, veps, amu, sv
92 LOGICAL :: IS_AVAILABLE
93C-----------------------------------------------
94C B e g i n n i n g o f s o u r c e
95C-----------------------------------------------
96
97 is_available = .false.
98C =======
99C Reading
100C =======
101C Line 1
102 CALL hm_get_intv('surf_IDex', surfid, is_available, lsubmodel)
103C ================
104C Check operations
105C ================
106C External surface check
107 t_monvoln%IVOLU(4) = 0
108 found = .false.
109 DO ii = 1, nsurf
110 IF (surfid == igrsurf(ii)%ID) THEN
111 t_monvoln%IVOLU(4) = ii
112 t_monvoln%EXT_SURFID = ii
113 found = .true.
114 EXIT
115 ENDIF
116 ENDDO
117 IF (.NOT. found) THEN
118 CALL freerr(3)
119 ELSEIF (igrsurf(t_monvoln%IVOLU(4))%ISH4N3N == 0) THEN
120 CALL ancmsg(msgid = 18, anmode = aninfo, msgtype = msgerror,
121 . i1 = t_monvoln%ID, c1 = t_monvoln%TITLE, i2 = surfid)
122 CALL freerr(3)
123 ENDIF
124
125C Check surface closure
126 CALL monvol_check_surfclose(t_monvoln, itab, igrsurf(t_monvoln%EXT_SURFID), x)
127C Set all normal on same side
128 CALL monvol_orient_surf(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
129 . igrsurf(t_monvoln%EXT_SURFID),ixc, ixtg, x, 1)
130C Compute Monvon volume
131 CALL monvol_compute_volume(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, igrsurf(t_monvoln%EXT_SURFID),
132 . itab, x, pm, geo, ixc, ixtg,
133 . sa, rot, vol, vmin, veps, sv)
134C Reverse all normals to ensure positive volume
135 CALL monvol_reverse_normals(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
136 . igrsurf(t_monvoln%EXT_SURFID),ixc,ixtg,vol, x, 1)
137
138C =====
139C Units
140C =====
141 fac_m = unitab%FAC_M(luid)
142 fac_l = unitab%FAC_L(luid)
143 fac_t = unitab%FAC_T(luid)
144 fac_c = fac_m / (fac_l * fac_t * fac_t)
145
146C Default values
147 scal_t = one * fac_t
148 scal_p = one * fac_c
149 scal_s = one * fac_l * fac_l
150 scal_a = one
151 scal_d = one * fac_l
152
153C =====
154C Store
155C =====
156 t_monvoln%RVOLU(26) = one / scal_t
157 t_monvoln%RVOLU(27) = one / scal_p
158 t_monvoln%RVOLU(28) = one / scal_s
159 t_monvoln%RVOLU(29) = one / scal_a
160 t_monvoln%RVOLU(30) = one / scal_d
161C
162 amu = zero
163 t_monvoln%RVOLU(2) = amu
164 t_monvoln%RVOLU(16) = vol + veps
165 t_monvoln%RVOLU(18) = sa
166 t_monvoln%RVOLU(21) = rot
167 t_monvoln%RVOLU(22:24) = zero
168
169C =========
170C Print out
171C =========
172 WRITE(iout, 1005) surfid
173 WRITE(iout, 1003) scal_t, scal_p, scal_s, scal_a, scal_d
174 WRITE(iout, 1002) sa, sv, vol
175C-----------------------------------------------
176C E n d o f s o u r c e
177C-----------------------------------------------
178
179 RETURN
180 1002 FORMAT(
181 . /5x,'INITIAL SURFACE OF MONITORED VOLUME . .=',1pg20.13,
182 . /5x,'SURFACE ERROR(NE.0 FOR NON CLOSED SURF)=',1pg20.13,
183 . /5x,'INITIAL VOLUME OF MONITORED VOLUME. . .=',1pg20.13)
184 1003 FORMAT(
185 . 5x,'UNIT SCALE FOR TIME FUNCTIONS =',1pg20.13,
186 . /5x,'UNIT SCALE FOR PRESSURE FUNCTIONS =',1pg20.13,
187 . /5x,'UNIT SCALE FOR AREA FUNCTIONS =',1pg20.13,
188 . /5x,'UNIT SCALE FOR ANGLE FUNCTIONS =',1pg20.13,
189 . /5x,'UNIT SCALE FOR DISTANCE FUNCTIONS =',1pg20.13)
190 1005 FORMAT( 5x,'EXTERNAL SURFACE ID . . . . . . . . . .=',i10)
191 END SUBROUTINE hm_read_monvol_type1
192 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 read_monvol(t_monvol, t_monvol_metadata, itab, itabm1, ipm, igeo, x, pm, geo, ixc, ixtg, sensors, unitab, npc, npt, pld, igrsurf, igrbric, nom_opt, iframe, xframe, lsubmodel)
Definition read_monvol.F:66
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:895
subroutine freerr(it)
Definition freform.F:501
program starter
Definition starter.F:39