@@ -76,7 +76,7 @@ function init_material_model(datamanager::Module, nodes::Union{SubArray,Vector{I
76
76
end
77
77
properties[iID] = material_parameter[" Property_$iID " ]
78
78
end
79
- println ()
79
+
80
80
if ! haskey (material_parameter, " UMAT Material Name" )
81
81
@warn " No UMAT Material Name is defined. Please check if you use it as method to check different material in your UMAT."
82
82
material_parameter[" UMAT Material Name" ] = " "
@@ -169,7 +169,11 @@ Example:
169
169
function compute_stresses (datamanager:: Module , nodes:: Union{SubArray,Vector{Int64}} , dof:: Int64 , material_parameter:: Dict , time:: Float64 , dt:: Float64 , strain_increment:: SubArray , stress_N:: SubArray , stress_NP1:: SubArray )
170
170
# the notation from the Abaqus Fortran subroutine is used.
171
171
nstatev = material_parameter[" Number of State Variables" ]
172
+ nprops = material_parameter[" Number of Properties" ]
173
+ props = datamanager. get_field (" Properties" )
174
+
172
175
statev = datamanager. get_field (" State Variables" )
176
+
173
177
stress_temp:: Vector{Float64} = zeros (Float64, 3 * dof - 3 )
174
178
DDSDDE = zeros (Float64, 3 * dof - 3 , 3 * dof - 3 )
175
179
SSE = datamanager. get_field (" Specific Elastic Strain Energy" )
@@ -195,15 +199,15 @@ function compute_stresses(datamanager::Module, nodes::Union{SubArray,Vector{Int6
195
199
nshr = 2 * dof - 3
196
200
# Size of the stress or strain component array
197
201
ntens = ndi + nshr
198
- not_supported_float = 0.0
202
+ not_supported_float:: Float64 = 0.0
199
203
angles = datamanager. get_field (" Angles" )
200
204
DFGRD0 = datamanager. get_field (" Deformation Gradient" , " N" )
201
205
DFGRD1 = datamanager. get_field (" Deformation Gradient" , " NP1" )
202
- not_supported_int = 0
206
+ not_supported_int:: Int64 = 0
203
207
for iID in nodes
204
208
stress_NP1[iID, :, :] = UMAT_interface
205
209
rotNP1[iID, :, :] = Geometry. rotation_tensor (angles[iID, :])
206
- UMAT_interface (material_parameter[" file" ], stress_temp, statev[iID, :], DDSDDE, SSE, SPD, SCD, RPL, DDSDDT, DRPLDE, DRPLDT, matrix_to_voigt (strain_N[iID, :, :]), matrix_to_voigt (strain_increment[iID, :, :]), time, time + dt, dt, temperature_N[iID], temperature_increment[iID], PREDEF[iID, :], DPRED[iID, :], CMNAME, ndi, nshr, ntens, nstatev, coords[iID, :], rot_NP1[iID, :, :] - rot_N[iID, :, :], not_supported_float, not_supported_float, DFGRD0, DFGRD1, not_supported_int, not_supported_int, not_supported_int, not_supported_int, not_supported_int, not_supported_int)
210
+ UMAT_interface (material_parameter[" file" ], stress_temp, statev[iID, :], DDSDDE, SSE, SPD, SCD, RPL, DDSDDT, DRPLDE, DRPLDT, matrix_to_voigt (strain_N[iID, :, :]), matrix_to_voigt (strain_increment[iID, :, :]), time, dt, temperature_N[iID], temperature_increment[iID], PREDEF[iID, :], DPRED[iID, :], CMNAME, ndi, nshr, ntens, nstatev, props, nprops , coords[iID, :], rot_NP1[iID, :, :] - rot_N[iID, :, :], not_supported_float, not_supported_float, DFGRD0, DFGRD1, not_supported_int, not_supported_int, not_supported_int, not_supported_int, not_supported_int, not_supported_int)
207
211
stress_NP1[iID, :, :] = voigt_to_matrix (stress_temp)
208
212
end
209
213
# CORRESPONDENCE::UMATINT(sigmaNP1LocVoigt, statev, DDSDDE, &SSE, &SPD, &SCD, &RPL,
@@ -236,10 +240,58 @@ Example:
236
240
```julia
237
241
```
238
242
"""
239
- function UMAT_interface (filename:: String )
240
- # ccall((:__simplemodule_MOD_foo, "./simplemodule.so"), Int32, (Ptr{Int32},), a)
241
- # ccall((:__simplemodule_MOD_foo, filename), Int32, (Ptr{Int32},), a)
242
-
243
+ function UMAT_interface (filename:: String , STRESS:: Vector{Float64} , STATEV:: Vector{Float64} , DDSDDE:: Matrix{Float64} , SSE:: Float64 , SPD:: Float64 , SCD:: Float64 , RPL:: Float64 , DDSDDT:: Vector{Float64} , DRPLDE:: Vector{Float64} , DRPLDT:: Float64 , STRAN:: Vector{Float64} , DSTRAN:: Vector{Float64} , TIME:: Float64 , DTIME:: Float64 , TEMP:: Float64 , DTEMP:: Float64 , PREDEF:: Vector{Float64} , DPRED:: Vector{Float64} , CMNAME:: Cstring , NDI:: Int64 , NSHR:: Int64 , NTENS:: Int64 , NSTATEV:: Int64 , PROPS:: Vector{Float64} , NPROPS:: Int64 , COORDS:: Vector{Float64} , DROT:: Matrix{Float64} , PNEWDT:: Float64 , CELENT:: Float64 , DFGRD0:: Matrix{Float64} , DFGRD1:: Matrix{Float64} , NOEL:: Int64 , NPT:: Int64 , LAYER:: Int64 , KSPT:: Int64 , JSTEP:: Int64 , KINC:: Int64 )
244
+ # Define the path to the shared library
245
+ global libtest = filename
246
+ println ()
247
+ # Call the UMAT subroutine with uppercase variables
248
+ """
249
+ ccall((:UMAT, libtest), Cvoid,
250
+ (
251
+ Ptr{Float64}, # STRESS
252
+ Ptr{Float64}, # STATEV
253
+ Ptr{Float64}, # DDSDDE
254
+ Ptr{Float64}, # SSE
255
+ Ptr{Float64}, # SPD
256
+ Ptr{Float64}, # SCD
257
+ Ptr{Float64}, # RPL
258
+ Ptr{Float64}, # DDSDDT
259
+ Ptr{Float64}, # DRPLDE
260
+ Ptr{Float64}, # DRPLDT
261
+ Ptr{Float64}, # STRAN
262
+ Ptr{Float64}, # DSTRAN
263
+ Ptr{Float64}, # TIME
264
+ Ptr{Float64}, # DTIME
265
+ Ptr{Float64}, # TEMP
266
+ Ptr{Float64}, # DTEMP
267
+ Ptr{Float64}, # PREDEF
268
+ Ptr{Float64}, # DPRED
269
+ Ptr{UInt8}, # CMNAME
270
+ Cint, # NDI
271
+ Cint, # NSHR
272
+ Cint, # NTENS
273
+ Cint, # NSTATEV
274
+ Ptr{Float64}, # PROPS
275
+ Cint, # NPROPS
276
+ Ptr{Float64}, # COORDS
277
+ Ptr{Float64}, # DROT
278
+ Ptr{Float64}, # PNEWDT
279
+ Ptr{Float64}, # CELENT
280
+ Ptr{Float64}, # DFGRD0
281
+ Ptr{Float64}, # DFGRD1
282
+ Ptr{Cint}, # NOEL
283
+ Ptr{Cint}, # NPT
284
+ Ptr{Cint}, # LAYER
285
+ Ptr{Cint}, # KSPT
286
+ Ptr{Cint}, # JSTEP
287
+ Ptr{Cint} # KINC
288
+ ),
289
+ STRESS, STATEV, DDSDDE, SSE, SPD, SCD, RPL, DDSDDT, DRPLDE, DRPLDT,
290
+ STRAN, DSTRAN, TIME, DTIME, TEMP, DTEMP, PREDEF, DPRED, CMNAME,
291
+ NDI, NSHR, NTENS, NSTATEV, PROPS, NPROPS, COORDS, DROT, PNEWDT,
292
+ CELENT, DFGRD0, DFGRD1, NOEL, NPT, LAYER, KSPT, JSTEP, KINC
293
+ )
294
+ """
243
295
end
244
296
245
297
0 commit comments