12 private :: read_user_matl
14 include
'fstr_ctrl_util_f.inc'
22 integer(kind=kint),
intent(in) :: ctrl
23 character(len=*),
intent(out) :: matname
32 integer(kind=kint),
intent(in) :: ctrl
33 integer(kind=kint),
intent(inout) :: mattype
34 integer(kind=kint),
intent(out) :: nlgeom
35 integer(kind=kint),
intent(out) :: nstatus
36 real(kind=kreal),
intent(out) :: matval(:)
38 integer(kind=kint) :: ipt
39 character(len=HECMW_NAME_LEN) :: data_fmt
40 character(len=256) :: s, fname
56 integer(kind=kint),
intent(in) :: ctrl
57 integer(kind=kint),
intent(inout) :: mattype
58 integer(kind=kint),
intent(out) :: nlgeom
59 real(kind=kreal),
intent(out) :: matval(:)
60 type(dict_struct),
pointer :: dict
62 integer(kind=kint) :: i,j, rcode, depends, ipt, n
63 real(kind=kreal),
pointer :: fval(:,:)
64 character(len=HECMW_NAME_LEN) :: data_fmt
67 character(len=256) :: s
72 if( depends>1 ) depends=1
73 if( depends > 3 ) stop
"We cannot read dependencies>3 right now"
84 write(*,*)
"Warning : !ELASTIC : parameter 'INFINITE' is deprecated." &
85 & //
" Pleaase use the replacement parameter 'INFINITESIMAL'"
90 s =
'ISOTROPIC,ORTHOTROPIC,USER '
96 allocate( fval(2+depends,n) )
102 if( depends==1 )
then
110 call init_table( mattable, depends, 2+depends,n, fval )
117 else if( ipt==2 )
then
118 allocate( fval(9+depends,n) )
119 if( depends==0 )
then
120 data_fmt =
"RRRRRRRRR "
123 fval(1,:), fval(2,:), fval(3,:), fval(4,:), fval(5,:), fval(6,:), &
124 fval(7,:), fval(8,:), fval(9,:) )
125 else if( depends==1 )
then
126 data_fmt =
"RRRRRRRRRR "
129 fval(1,:), fval(2,:), fval(3,:), fval(4,:), fval(5,:), fval(6,:), &
130 fval(7,:), fval(8,:), fval(9,:), fval(10,:) )
135 if( fval(1,i)<=0.d0 .or. fval(2,i)<=0.d0 .or. fval(3,i)<=0.d0 .or. &
136 fval(7,i)<=0.d0 .or. fval(8,i)<=0.d0 .or. fval(9,i)<=0.d0 )
then
141 call init_table( mattable, depends, 9+depends,n, fval )
147 else if( ipt==3 )
then
148 allocate( fval(10,10) )
151 fval(1,:), fval(2,:), fval(3,:), fval(4,:), fval(5,:), fval(6,:), &
152 fval(7,:), fval(8,:), fval(9,:), fval(10,:) )
156 matval(100+(i-1)*10+j)=fval(i,j)
164 stop
"ERROR: Material type not supported"
169 if(
associated(fval) )
deallocate(fval)
176 integer(kind=kint),
intent(in) :: ctrl
177 integer(kind=kint),
intent(inout) :: mattype
178 integer(kind=kint),
intent(out) :: nlgeom
179 real(kind=kreal),
intent(out) :: matval(:)
181 integer(kind=kint) :: i,j, rcode, depends, ipt
182 real(kind=kreal),
pointer :: fval(:,:)
183 character(len=HECMW_NAME_LEN) :: data_fmt
184 character(len=256) :: s
189 if( depends > 3 ) stop
"We cannot read dependencies>3 right now"
195 s =
'NEOHOOKE,MOONEY-RIVLIN,ARRUDA-BOYCE,USER,MOONEY-RIVLIN-ANISO '
200 allocate( fval(2,depends+1) )
202 if( depends==0 )
then
208 if( fval(2,1)==0.d0 ) stop
"We cannot deal with incompressible material currently"
218 else if( ipt==2 )
then
219 allocate( fval(3,depends+1) )
221 if( depends==0 )
then
234 else if( ipt==3 )
then
235 allocate( fval(3,depends+1) )
237 if( depends==0 )
then
249 else if( ipt==4 )
then
250 allocate( fval(10,10) )
253 fval(1,:), fval(2,:), fval(3,:), fval(4,:), fval(5,:), fval(6,:), &
254 fval(7,:), fval(8,:), fval(9,:), fval(10,:) )
258 matval(100+(i-1)*10+j)=fval(i,j)
265 else if( ipt==5 )
then
266 allocate( fval(10,depends+1) )
268 if( depends==0 )
then
269 data_fmt =
"RRRRRrrrrr "
272 fval(1,:), fval(2,:), fval(3,:), fval(4,:), fval(5,:), &
273 fval(6,:), fval(7,:), fval(8,:), fval(9,:), fval(10,:) )
291 if(
associated(fval) )
deallocate(fval)
298 integer(kind=kint),
intent(in) :: ctrl
299 integer(kind=kint),
intent(inout) :: mattype
300 integer(kind=kint),
intent(out) :: nlgeom
301 type(dict_struct),
pointer :: dict
303 integer(kind=kint) :: i,j, rcode, depends, ipt, n
304 real(kind=kreal),
pointer :: fval(:,:)
305 character(len=HECMW_NAME_LEN) :: data_fmt
306 type(
ttable ) :: mattable
307 character(len=256) :: s
312 if( depends>1 ) depends=1
321 write(*,*)
"Warning : !VISCOELASTIC : parameter 'INFINITE' is deprecated." &
322 & //
" Pleaase use the replacement parameter 'INFINITESIMAL'"
327 s =
'ISOTROPIC,USER '
334 allocate( fval(2+depends,n) )
335 if( depends==0 )
then
339 if( fval(2,1)==0.d0 ) stop
"Error in defining viscoelasticity: Relaxation time cannot be zero!"
341 if( depends==1 )
then
347 call init_table( mattable, 1, 2+depends,n, fval )
354 stop
"ERROR: Material type not supported"
359 if(
associated(fval) )
deallocate(fval)
365 integer(kind=kint),
intent(in) :: ctrl
366 integer(kind=kint),
intent(inout) :: mattype
367 real(kind=kreal),
intent(out) :: matval(:)
370 character(len=256) :: s
379 mattype = mattype+ipt
387 integer(kind=kint),
intent(in) :: ctrl
388 integer(kind=kint),
intent(inout) :: mattype
389 integer(kind=kint),
intent(out) :: nlgeom
390 real(kind=kreal),
intent(out) :: matval(:)
391 real(kind=kreal),
pointer :: mattable(:)
392 type(dict_struct),
pointer :: dict
394 integer(kind=kint) :: i, n, rcode, depends, ipt, hipt
395 real(kind=kreal),
pointer :: fval(:,:)
396 real(kind=kreal) :: dum, fdum
397 character(len=HECMW_NAME_LEN) :: data_fmt
398 character(len=256) :: s
400 real(kind=kreal),
parameter :: pi=3.14159265358979d0
407 if( depends>1 ) depends = 1
408 if( depends > 3 ) stop
"We cannot read dependencies>3 right now"
419 write(*,*)
"Warning : !PLASTIC : parameter 'INFINITE' is deprecated." &
420 & //
" Pleaase use the replacement parameter 'INFINITESIMAL'"
428 s =
'BILINEAR,MULTILINEAR,SWIFT,RAMBERG-OSGOOD,KINEMATIC,COMBINED '
434 s =
'MISES,MOHR-COULOMB,DRUCKER-PRAGER,USER '
442 if( hipt==2 .and. n<2 )
return
443 if( ( ipt==3 .or. ipt==4 ) .and. hipt>2 ) hipt = 1
449 allocate( fval(2,n) )
463 allocate( fval(depends+2,n) )
464 if( depends==0 )
then
469 if( fval(2,1)/=0.d0 )
then
470 print *,
"Multilinear hardening: First plastic strain must be zero"
474 if( fval(2,i)<0.0 ) &
475 stop
"Multilinear hardening: Error in plastic strain definition"
477 call init_table( mttable,1, 2+depends, n, fval )
478 call dict_add_key( dict,
mc_yield, mttable )
486 call init_table( mttable,2, 2+depends,n, fval )
487 call dict_add_key( dict,
mc_yield, mttable )
491 allocate( fval(3,1) )
501 print *,
"Error in hardening definition!"
506 allocate( fval(3,depends+1) )
514 dum = fval(2,1)*pi/180.d0
515 fdum = 2.d0*sin(dum)/ ( sqrt(3.d0)*(3.d0+sin(dum)) )
517 fdum = 6.d0* cos(dum)/ ( sqrt(3.d0)*(3.d0+sin(dum)) )
528 stop
"Yield function not supported"
531 if(
associated(fval) )
deallocate(fval)
539 integer(kind=kint),
intent(in) :: ctrl
540 integer(kind=kint),
intent(inout) :: mattype
541 integer(kind=kint),
intent(out) :: nlgeom
542 type(dict_struct),
pointer :: dict
544 integer(kind=kint) :: i,j, rcode, depends, ipt, n
545 real(kind=kreal),
pointer :: fval(:,:)
546 character(len=HECMW_NAME_LEN) :: data_fmt
547 type(
ttable ) :: mattable
548 character(len=256) :: s
553 if( depends>1 ) depends=1
567 allocate( fval(3+depends,n) )
568 if( depends==0 )
then
573 if( depends==1 )
then
579 call init_table( mattable, depends, 3+depends,n, fval )
580 call dict_add_key( dict,
mc_norton, mattable )
586 stop
"ERROR: Material type not supported"
591 if(
associated(fval) )
deallocate(fval)
597 integer(kind=kint),
intent(in) :: ctrl
598 real(kind=kreal),
intent(out) :: matval(:)
600 integer(kind=kint) :: i, rcode, depends
601 real(kind=kreal),
pointer :: fval(:,:)
602 character(len=HECMW_NAME_LEN) :: data_fmt
610 if( depends>1 ) depends = 1
612 allocate( fval(1,depends+1) )
614 data_fmt = data_fmt //
"R "
620 if(
associated(fval) )
deallocate(fval)
628 integer(kind=kint),
intent(in) :: ctrl
629 real(kind=kreal),
intent(out) :: matval(:)
630 type(dict_struct),
pointer :: dict
632 integer(kind=kint) :: i, n, rcode, depends, ipt
633 real(kind=kreal),
pointer :: fval(:,:)
635 character(len=HECMW_NAME_LEN) :: data_fmt, ss
643 ss =
'ISOTROPIC,ORTHOTROPIC '
649 if( depends>1 ) depends = 1
652 allocate( fval(depends+1, n) )
654 data_fmt = data_fmt //
"R "
656 if( depends==0 )
then
665 call init_table( mttable,depends, 1+depends, n, fval )
669 allocate( fval(3+depends,n) )
671 data_fmt = trim(data_fmt) //
"R "
673 if( depends==0 )
then
676 elseif( depends==1 )
then
681 call init_table( mttable, depends, 3+depends,n, fval )
687 if(
associated(fval) )
deallocate(fval)
691 integer function read_user_matl( ctrl, matval )
692 integer(kind=kint),
intent(in) :: ctrl
693 real(kind=kreal),
intent(out) :: matval(:)
695 integer(kind=kint) :: i, j
696 real(kind=kreal) :: fval(10,10)
702 fval(4,:), fval(5,:), fval(6,:), fval(7,:), fval(8,:), fval(9,:), fval(10,:) ) /= 0 )
return
705 matval((i-1)*10+j)=fval(i,j)
710 end function read_user_matl
715 integer(kind=kint),
intent(in) :: ctrl
716 integer(kind=kint),
intent(inout) :: mattype
717 integer(kind=kint),
intent(out) :: nlgeom
718 real(kind=kreal),
intent(out) :: matval(:)
719 type(dict_struct),
pointer :: dict
721 integer(kind=kint) :: i,j, rcode, depends, ipt, n
722 real(kind=kreal),
pointer :: fval(:,:)
723 character(len=HECMW_NAME_LEN) :: data_fmt
724 type(
ttable ) :: mattable
726 character(len=256) :: s
731 if( depends>1 ) depends=1
732 if( depends > 3 ) stop
"We cannot read dependencies>3 right now"
736 s =
'INCOMP_NEWTONIAN '
742 allocate( fval(1+depends,n) )
743 if( depends==0 )
then
748 if( depends==1 )
then
755 call init_table( mattable, depends, 1+depends,n, fval )
762 stop
"ERROR: Material type not supported"
767 if(
associated(fval) )
deallocate(fval)
int fstr_ctrl_get_param_ex(int *ctrl, const char *param_name, const char *value_list, int *necessity, char *type, void *val)
int fstr_ctrl_get_data_line_n(int *ctrl)
int fstr_ctrl_get_data_array_ex(int *ctrl, const char *format,...)
int fstr_ctrl_get_data_ex(int *ctrl, int *line_no, const char *format,...)
This module manages read in of various material properties.
integer function fstr_ctrl_get_hyperelastic(ctrl, mattype, nlgeom, matval)
Read in !HYPERELASTIC.
integer function fstr_ctrl_get_viscoelasticity(ctrl, mattype, nlgeom, dict)
Read in !VISCOELASTIC.
integer function fstr_ctrl_get_viscoplasticity(ctrl, mattype, nlgeom, dict)
Read in !VISCOELASTIC.
integer function fstr_ctrl_get_usermaterial(ctrl, mattype, nlgeom, nstatus, matval)
Read in !USER_MATERIAL.
integer function fstr_ctrl_get_expansion_coeff(ctrl, matval, dict)
Read in !EXPANSION_COEFF.
integer function fstr_ctrl_get_trs(ctrl, mattype, matval)
Read in !TRS.
integer function fstr_ctrl_get_elasticity(ctrl, mattype, nlgeom, matval, dict)
Read in !ELASTIC.
integer function fstr_ctrl_get_plasticity(ctrl, mattype, nlgeom, matval, mattable, dict)
Read in !PLASTIC.
integer function fstr_ctrl_get_material(ctrl, matname)
Read in !MATERIAL.
integer function fstr_ctrl_get_density(ctrl, matval)
Read in !DENSITY.
integer function fstr_ctrl_get_fluid(ctrl, mattype, nlgeom, matval, dict)
Read in !FLUID.
This module provides data structure table which would be dictionaried afterwards.
subroutine finalize_table(table)
subroutine init_table(table, ndp, col, row, tbval)
This module summarizes all infomation of material properties.
integer(kind=kint), parameter m_youngs
integer(kind=kint), parameter m_plconst5
character(len=dict_key_length) mc_incomp_newtonian
integer(kind=kint), parameter m_plconst6
integer(kind=kint), parameter mooneyrivlin
integer(kind=kint), parameter mooneyrivlin_aniso
character(len=dict_key_length) mc_viscoelastic
integer(kind=kint), parameter m_plconst4
integer(kind=kint), parameter viscoelastic
integer(kind=kint), parameter m_exapnsion
integer(kind=kint), parameter m_plconst1
character(len=dict_key_length) mc_themoexp
character(len=dict_key_length) mc_norton
integer(kind=kint), parameter m_plconst10
integer(kind=kint), parameter elastic
integer(kind=kint), parameter m_plconst2
integer(kind=kint), parameter arrudaboyce
integer(kind=kint), parameter mn_orthoelastic
integer(kind=kint), parameter incomp_newtonian
integer(kind=kint), parameter totallag
integer(kind=kint), parameter m_density
subroutine setdigit(npos, ival, mtype)
Modify material type.
integer(kind=kint), parameter norton
integer(kind=kint), parameter m_plconst9
integer(kind=kint), parameter m_poisson
integer(kind=kint), parameter m_plconst8
character(len=dict_key_length) mc_orthoexp
integer(kind=kint), parameter infinitesimal
character(len=dict_key_length) mc_yield
integer(kind=kint), parameter userelastic
integer(kind=kint), parameter m_viscocity
integer(kind=kint), parameter neohooke
integer(kind=kint), parameter m_plconst7
integer(kind=kint), parameter usermaterial
character(len=dict_key_length) mc_isoelastic
integer(kind=kint), parameter userhyperelastic
integer(kind=kint), parameter m_plconst3
character(len=dict_key_length) mc_orthoelastic
integer(kind=kint), parameter updatelag