OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_mat_user29_31.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_mat29_31 ../starter/source/materials/mat/matuser/hm_read_mat_user29_31.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_mat ../starter/source/materials/mat/hm_read_mat.F90
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| arret ../starter/source/system/arret.F
30!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
31!|| hm_get_string_index ../starter/source/devtools/hm_reader/hm_get_string_index.F
32!|| init_mat_keyword ../starter/source/materials/mat/init_mat_keyword.F
33!|| user_output ../starter/source/user_interface/user_output.F
34!||--- uses -----------------------------------------------------
35!|| format_mod ../starter/share/modules1/format_mod.F90
36!|| message_mod ../starter/share/message_module/message_mod.F
37!|| reader_old_mod ../starter/share/modules1/reader_old_mod.F90
38!|| submodel_mod ../starter/share/modules1/submodel_mod.F
39!||====================================================================
40 SUBROUTINE hm_read_mat29_31(ILAW,IUSER_KEY,
41 . USERL_AVAIL,
42 . UPARAM,MAXUPARAM,NUPARAM,
43 . NUVAR ,IFUNC,MAXFUNC,NFUNC,
44 . PARMAT,
45 . LSUBMODEL,
46 . PM,MATPARAM)
47C-----------------------------------------------
48C ROUTINE DESCRIPTION :
49C ===================
50C Read user material 29 to 31 - generic routine
51C------------------------------------------------------------------
52C DUMMY ARGUMENTS DESCRIPTION:
53C ===================
54C
55C NAME DESCRIPTION
56C
57C USERL_AVAIL Flag if userlibrary was load
58C MATNUM Number of Material 29, 30, 31
59C IS_AVAILABLE Bool / Result of HM_interface
60C LSUBMODEL SUBMODEL Structure.
61C------------------------------------------------------------------
62C
63C-----------------------------------------------
64C M o d u l e s
65C-----------------------------------------------
66 USE message_mod
68 USE matparam_def_mod
70 USE format_mod , ONLY : fmt_2f
71 USE reader_old_mod , ONLY : kcur, kline, line,key0
72C-----------------------------------------------
73C I m p l i c i t T y p e s
74C-----------------------------------------------
75#include "implicit_f.inc"
76C-----------------------------------------------
77C C o m m o n B l o c k s
78C-----------------------------------------------
79#include "scr15_c.inc"
80#include "scr17_c.inc"
81#include "param_c.inc"
82#include "units_c.inc"
83C-----------------------------------------------
84C D u m m y A r g u m e n t s
85C-----------------------------------------------
86 INTEGER ILAW
87 INTEGER USERL_AVAIL
88 INTEGER MAXUPARAM
89 INTEGER NUPARAM
90 INTEGER NUVAR
91 INTEGER NFUNC,MAXFUNC
92 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(NSUBMOD)
93 INTEGER, DIMENSION(MAXFUNC) :: IFUNC
94 my_real, DIMENSION(100) :: parmat
95 my_real, DIMENSION(MAXUPARAM) :: uparam
96 my_real, DIMENSION(NPROPM) ,INTENT(INOUT) :: pm
97 CHARACTER(LEN=NCHARLINE) :: IUSER_KEY
98 TYPE (MATPARAM_STRUCT_) ,INTENT(INOUT) :: MATPARAM
99C-----------------------------------------------
100C L o c a l V a r i a b l e s
101C-----------------------------------------------
102 CHARACTER(LEN=4096) :: SCR_FILE_NAME
103 CHARACTER(LEN=NCHARLINE) :: RLINE
104 CHARACTER (LEN=4) :: CLAW
105 LOGICAL :: IS_AVAILABLE
106 INTEGER NLINES,J
107 INTEGER SCR_FILE_NAME_LEN
108 my_real rho0,rhor
109!
110 CHARACTER OPTION*256
111 INTEGER SIZE
112C-----------------------------------------------
113 is_available = .false.
114!
115 IF (userl_avail == 0)THEN
116 ! ERROR to be printed & exit
117 option='/MAT/'//iuser_key
118 size=len_trim(option)
119 CALL ancmsg(msgid=1130,
120 . msgtype=msgerror,c1=option(1:size),anmode=aninfo)
121 CALL arret(2)
122 ENDIF
123
124
125 CALL hm_get_intv ('Number_of_datalines' ,nlines ,is_available, lsubmodel)
126
127 IF(nlines > 1)THEN
128
129 ! Rho & Rho0_r are read out of user laws
130 j=1
131 CALL hm_get_string_index('arraydatalines', rline, 1, ncharline, is_available)
132 READ(rline,err=999,fmt=fmt_2f)rho0,rhor
133
134 pm(1)=rhor
135 pm(89)=rho0
136
137 ! Create tempo file
138 WRITE(claw,'(I4.4)')ilaw
139 scr_file_name='si'//ROOTNAM(1:ROOTLEN)//'_'//CLAW//'.scr'
140 SCR_FILE_NAME_LEN=LEN_TRIM(SCR_FILE_NAME)
141 OPEN(UNIT=30,FILE=TRIM(SCR_FILE_NAME),FORM='formatted',RECL=ncharline)
142
143 ! Read & Dump in scratch file
144 DO J=2,NLINES
145 CALL HM_GET_STRING_INDEX('arraydatalines', RLINE, J, ncharline, IS_AVAILABLE)
146 WRITE(30,FMT='(a)')TRIM(RLINE)
147 ENDDO
148 CLOSE(UNIT=30)
149
150 CALL ST_USERLIB_USERMAT(ILAW,ROOTNAM,ROOTLEN,
151 . UPARAM,MAXUPARAM,NUPARAM,
152 . NUVAR ,IFUNC,MAXFUNC,NFUNC ,PARMAT)
153
154 CALL USER_OUTPUT(IOUT,ILAW,ROOTNAM,ROOTLEN,1)
155 ELSE
156 ! Error MESSAGE_Mess
157 ENDIF
158
159 ! Properties compatibility
160 CALL INIT_MAT_KEYWORD(MATPARAM,"SOLID_ALL")
161 CALL INIT_MAT_KEYWORD(MATPARAM,"SHELL_ALL")
162 CALL INIT_MAT_KEYWORD(MATPARAM,"SPH")
163
164 RETURN
165 999 CALL ANCMSG(MSGID=55,ANMODE=ANINFO,MSGTYPE=MSGERROR,C1=KEY0(KCUR),C2=KLINE,C3=LINE)
166 CALL ARRET(2)
167 END
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_get_string_index(name, sval, index, size, is_available)
subroutine hm_read_mat29_31(ilaw, iuser_key, userl_avail, uparam, maxuparam, nuparam, nuvar, ifunc, maxfunc, nfunc, parmat, lsubmodel, pm, matparam)
integer, parameter nchartitle
integer, parameter ncharline
integer nsubmod
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