OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_mat_user_99.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_mat_99 ../starter/source/materials/mat/matuser/hm_read_mat_user_99.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!|| law_user ../starter/source/user_interface/law_user.F
37!|| message_mod ../starter/share/message_module/message_mod.F
38!|| reader_old_mod ../starter/share/modules1/reader_old_mod.F90
39!|| submodel_mod ../starter/share/modules1/submodel_mod.f
40!||====================================================================
41 SUBROUTINE hm_read_mat_99(ILAW,IUSER_LAW,IUSER_KEY,
42 . USERL_AVAIL,
43 . UPARAM,MAXUPARAM,NUPARAM,
44 . NUVAR ,IFUNC,MAXFUNC,NFUNC,
45 . PARMAT,USERBUF,
46 . LSUBMODEL,
47 . PM,MATPARAM)
48C-----------------------------------------------
49C ROUTINE DESCRIPTION :
50C ===================
51C Read user material 01 - 99 - generic routine
52C------------------------------------------------------------------
53C DUMMY ARGUMENTS DESCRIPTION:
54C ===================
55C
56C NAME DESCRIPTION
57C
58C USERL_AVAIL Flag if userlibrary was load
59C MATNUM Number of Material 01 - 99
60C IS_AVAILABLE Bool / Result of HM_interface
61C LSUBMODEL SUBMODEL Structure.
62C------------------------------------------------------------------
63C
64C-----------------------------------------------
65C M o d u l e s
66C-----------------------------------------------
67 USE message_mod
69 USE law_user
70 USE matparam_def_mod
72 USE format_mod , ONLY : fmt_2f
73 USE reader_old_mod , ONLY : line, kline, kcur, key0
74C-----------------------------------------------
75C I m p l i c i t T y p e s
76C-----------------------------------------------
77#include "implicit_f.inc"
78C-----------------------------------------------
79C C o m m o n B l o c k s
80C-----------------------------------------------
81#include "scr15_c.inc"
82#include "scr17_c.inc"
83#include "param_c.inc"
84#include "units_c.inc"
85C-----------------------------------------------
86C D u m m y A r g u m e n t s
87C-----------------------------------------------
88 INTEGER ILAW,IUSER_LAW
89 INTEGER USERL_AVAIL
90 INTEGER MAXUPARAM
91 INTEGER NUPARAM
92 INTEGER NUVAR
93 INTEGER NFUNC,MAXFUNC
94 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(NSUBMOD)
95 INTEGER, DIMENSION(MAXFUNC) :: IFUNC
96 my_real, DIMENSION(100) :: parmat
97 my_real, DIMENSION(MAXUPARAM) :: uparam
98 my_real, DIMENSION(NPROPM) ,INTENT(INOUT) :: pm
99 TYPE(ulawbuf) :: USERBUF
100 CHARACTER(LEN=NCHARLINE) :: IUSER_KEY
101 TYPE(matparam_struct_),INTENT(INOUT) :: MATPARAM
102C-----------------------------------------------
103C L o c a l V a r i a b l e s
104C-----------------------------------------------
105 CHARACTER(LEN=4096) :: SCR_FILE_NAME
106 CHARACTER(LEN=NCHARLINE) :: RLINE
107 CHARACTER (LEN=4) :: CLAW
108 CHARACTER(LEN=NCHARTITLE) :: TITLE
109 LOGICAL :: IS_AVAILABLE
110 INTEGER NLINES,J,MAT_ID
111 INTEGER SCR_FILE_NAME_LEN
112 my_real rho0,rhor
113 CHARACTER OPTION*256
114 INTEGER SIZE
115C-----------------------------------------------
116 is_available = .false.
117!
118 IF (userl_avail == 0)THEN
119 ! ERROR to be printed & exit
120 option='/MAT/'//iuser_key
121 size=len_trim(option)
122 CALL ancmsg(msgid=1130,msgtype=msgerror,c1=option(1:size),anmode=aninfo)
123 CALL arret(2)
124 ENDIF
125
126
127 CALL hm_get_intv ('Number_of_datalines' ,nlines ,is_available, lsubmodel)
128
129 IF(nlines > 1)THEN
130
131 ! Rho & Rho0_r are read out of user laws
132 j=1
133 CALL hm_get_string_index('arraydatalines', rline, 1, ncharline, is_available)
134 READ(rline,err=999,fmt=fmt_2f)rho0,rhor
135
136 pm(1)=rhor
137 pm(89)=rho0
138
139 ! Create tempo file
140 WRITE(claw,'(I4.4)')ilaw
141 scr_file_name='SI'//rootnam(1:rootlen)//'_'//claw//'.scr'
142 scr_file_name_len=len_trim(scr_file_name)
143 OPEN(unit=30,file=trim(scr_file_name),form='FORMATTED',recl=ncharline)
144
145 ! Read & Dump in scratch file
146 DO j=2,nlines
147 CALL hm_get_string_index('arraydatalines', rline, j, ncharline, is_available)
148 WRITE(30,fmt='(A)')trim(rline)
149 ENDDO
150 CLOSE(unit=30)
151
152 CALL st_userlib_lecm99(ilaw,rootnam,rootlen,iuser_law ,
153 . uparam,maxuparam,
154 . nuparam,nuvar ,ifunc ,maxfunc,nfunc ,
155 . parmat ,userbuf)
156 mat_id = userbuf%ID
157 title = userbuf%NAME
158 title = trim(title)
159 CALL st_get_userbuf_var(mat_id,title)
160
161 CALL user_output(iout,ilaw,rootnam,rootlen,1)
162 ELSE
163 ! Error MESSAGE_Mess
164 ENDIF
165
166 ! Properties compatibility
167 CALL init_mat_keyword(matparam,"SOLID_ALL")
168 CALL init_mat_keyword(matparam,"SHELL_ALL")
169
170 RETURN
171 999 CALL ancmsg(msgid=55,anmode=aninfo,msgtype=msgerror,c1=key0(kcur),c2=kline,c3=line)
172 CALL arret(2)
173 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_mat_99(ilaw, iuser_law, iuser_key, userl_avail, uparam, maxuparam, nuparam, nuvar, ifunc, maxfunc, nfunc, parmat, userbuf, lsubmodel, pm, matparam)
subroutine init_mat_keyword(matparam, keyword)
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
subroutine user_output(iout, ilaw, rootn, rootlen, inpf)
Definition user_output.F:38
program starter
Definition starter.F:39