FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
material.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
6 module mmaterial
7  use hecmw_util
8  use m_table
9  use table_dicts
10  implicit none
11 
12  ! Following algorithm type
13  integer(kind=kint), parameter :: infinitesimal = 0
14  integer(kind=kint), parameter :: totallag = 1
15  integer(kind=kint), parameter :: updatelag = 2
16 
17  ! Following material types. All material type number consists with integer of six digits.
18  ! First digit: Indicates physical type
19  ! 1: mechanical deformation analysis
20  ! 2: heat conduct analysis
21  ! ......
22  ! Second digit:
23  ! Mechanical analysis
24  ! 1: Elastic
25  ! 2: Elastoplastic
26  ! 3: Hyperelastic
27  ! 4: Viscoelastic
28  ! 5: Viscoplastic
29  ! 6: Incomp newtonian
30  ! 7: Connector(Spring, Dashpot, Joint etc.)
31  ! Heat conductiovity
32  ! ......
33  ! Third digit:
34  ! For elastic or elastoplastic deformation, elastic
35  ! 0: isotropic ie. 110000
36  ! 1: with transever anisotropity 111000
37  ! For hyperelastic deformation
38  ! 0: Neo-Hooke 130000
39  ! 1: Mooney-Rivlin 131000
40  ! 2: Arruda-Boyce 132000
41  ! For spring or dashpot, joint etc.
42  ! 0: spring dof ie. 170000
43  ! 1: spring axial 171000
44  ! 2: dashpot dof 172000
45  ! 3: dashpot axial 173000
46  ! Fourth digit
47  ! For spring_d or dashpot_d, joint_d etc.
48  ! k: number of dof param (1st digit)
49  ! Fifth digit:
50  ! For elastoplastic deformation, hardening law
51  ! 0: Linear hardening i.e. 120000
52  ! 1: Multilinear hardening 120010
53  ! 2: Swift
54  ! 3: Ramberg-Osgood
55  ! 4: linear kinematic
56  ! 5: combined (linear kinematic + linear isotropic)
57  ! For spring_d or dashpot_d, joint_d etc.
58  ! k: number of dof param (2nd digit)
59  ! Six digit:
60  ! For visco-elastoplastic deformation, visco law
61  ! 0: Norton i.e. 150000
62  ! 1: Striab 150001
63  integer(kind=kint), parameter :: usermaterial = 100000
64 
65  integer(kind=kint), parameter :: elastic = 110000
66  integer(kind=kint), parameter :: mn_orthoelastic = 111000
67  integer(kind=kint), parameter :: userelastic = 112000
68 
69  integer(kind=kint), parameter :: eplastic = 120000
70 
71  integer(kind=kint), parameter :: neohooke = 130000
72  integer(kind=kint), parameter :: mooneyrivlin = 131000
73  integer(kind=kint), parameter :: arrudaboyce = 132000
74  integer(kind=kint), parameter :: userhyperelastic = 133000
75  integer(kind=kint), parameter :: mooneyrivlin_aniso = 134000
76 
77  integer(kind=kint), parameter :: viscoelastic = 140000
78  integer(kind=kint), parameter :: norton = 150000
79 
80  integer(kind=kint), parameter :: incomp_newtonian = 160000
81  integer(kind=kint), parameter :: connector = 170000
82 
83  ! Following section type
84  integer(kind=kint), parameter :: d3 = -1
85  integer(kind=kint), parameter :: planestress = 1
86  integer(kind=kint), parameter :: planestrain = 0
87  integer(kind=kint), parameter :: axissymetric = 2
88  integer(kind=kint), parameter :: shell = 3
89 
90  ! Material constants are saved in an array of size 100 and their physical meaning
91  ! correspond to their position in the array
92  integer(kind=kint), parameter :: m_youngs = 1
93  integer(kind=kint), parameter :: m_poisson = 2
94  integer(kind=kint), parameter :: m_density = 3
95  integer(kind=kint), parameter :: m_thick = 4
96 
97  ! following plastic constitutive parameter
98  integer(kind=kint), parameter :: m_plconst1 = 5
99  integer(kind=kint), parameter :: m_plconst2 = 6
100  integer(kind=kint), parameter :: m_plconst3 = 7
101  integer(kind=kint), parameter :: m_plconst4 = 8
102  integer(kind=kint), parameter :: m_plconst5 = 9
103  integer(kind=kint), parameter :: m_kinehard = 10
104 
105  integer(kind=kint), parameter :: m_exapnsion = 20
106 
107  integer(kind=kint), parameter :: m_alpha_over_mu = 21
108 
109  integer(kind=kint), parameter :: m_beam_radius = 22
110  integer(kind=kint), parameter :: m_beam_angle1 = 23
111  integer(kind=kint), parameter :: m_beam_angle2 = 24
112  integer(kind=kint), parameter :: m_beam_angle3 = 25
113  integer(kind=kint), parameter :: m_beam_angle4 = 26
114  integer(kind=kint), parameter :: m_beam_angle5 = 27
115  integer(kind=kint), parameter :: m_beam_angle6 = 28
116 
117  integer(kind=kint), parameter :: m_viscocity = 29
118 
119  ! additional plastic constitutive parameter
120  integer(kind=kint), parameter :: m_plconst6 = 30
121  integer(kind=kint), parameter :: m_plconst7 = 31
122  integer(kind=kint), parameter :: m_plconst8 = 32
123  integer(kind=kint), parameter :: m_plconst9 = 33
124  integer(kind=kint), parameter :: m_plconst10 = 34
125 
126  integer(kind=kint), parameter :: m_damping_rm = 35
127  integer(kind=kint), parameter :: m_damping_rk = 36
128 
129  integer(kind=kint), parameter :: m_spring_dof = 0
130  integer(kind=kint), parameter :: m_spring_axial = 1
131  integer(kind=kint), parameter :: m_dashpot_dof = 2
132  integer(kind=kint), parameter :: m_dashpot_axial = 3
133 
134  integer(kind=kint), parameter :: m_spring_d_ndoffset = 0
135  integer(kind=kint), parameter :: m_spring_a_ndoffset = 72
136  integer(kind=kint), parameter :: m_dashpot_d_ndoffset = 73
137  integer(kind=kint), parameter :: m_dashpot_a_ndoffset = 145
138 
139  ! Dictionary constants
140  character(len=DICT_KEY_LENGTH) :: mc_isoelastic= 'ISOELASTIC' ! youngs modulus, poisson's ratio
141  character(len=DICT_KEY_LENGTH) :: mc_orthoelastic= 'ORTHOELASTIC' ! ortho elastic modulus
142  character(len=DICT_KEY_LENGTH) :: mc_yield = 'YIELD' ! plastic strain, yield stress
143  character(len=DICT_KEY_LENGTH) :: mc_themoexp = 'THEMOEXP' ! thermo expansion coefficient
144  character(len=DICT_KEY_LENGTH) :: mc_orthoexp = 'ORTHOEXP' ! thermo expansion coefficient
145  character(len=DICT_KEY_LENGTH) :: mc_viscoelastic = 'VISCOELASTIC' ! Prony coeff only curr.
146  character(len=DICT_KEY_LENGTH) :: mc_norton = 'NORTON' ! NOrton's creep law
147  character(len=DICT_KEY_LENGTH) :: mc_incomp_newtonian = 'INCOMP_FLUID' ! viscocity
148  character(len=DICT_KEY_LENGTH) :: mc_spring= 'SPRING' ! spring
149  character(len=DICT_KEY_LENGTH) :: mc_dashpot= 'DASHPOT' ! dashpot
150 
152  integer(kind=kint) :: ortho
153  real(kind=kreal) :: ee
154  real(kind=kreal) :: pp
155  real(kind=kreal) :: ee2
156  real(kind=kreal) :: g12
157  real(kind=kreal) :: g23
158  real(kind=kreal) :: g31
159  real(kind=kreal) :: angle
160  real(kind=kreal) :: rho
161  real(kind=kreal) :: alpha
162  real(kind=kreal) :: alpha_over_mu
163  real(kind=kreal) :: weight
164  end type tshellmat
165 
168  integer(kind=kint) :: nlgeom_flag
169  integer(kind=kint) :: mtype
170  integer(kind=kint) :: nfstatus
171  character(len=30) :: name
172  real(kind=kreal) :: variables(200)
173  integer(kind=kint) :: variables_i(200)
174  type(tshellmat), pointer :: shell_var(:) => null()
175  integer(kind=kint) :: totallyr
176  integer(kind=kint) :: cdsys_id
177  integer(kind=kint) :: n_table
178  real(kind=kreal), pointer :: table(:)=>null()
179  type(dict_struct), pointer :: dict
180  logical :: is_elem_rayleigh_damping
181  end type tmaterial
182 
183  type(tmaterial), allocatable :: materials(:)
184 
185 contains
186 
188  subroutine initmaterial( material )
189  type( tmaterial ), intent(inout) :: material
190  material%mtype = -1 ! not defined yet
191  material%nfstatus = 0 ! Default: no status
192  material%nlgeom_flag = infinitesimal ! Default: INFINITESIMAL ANALYSIS
193  material%variables = 0.d0 ! not defined yet
194  material%variables_i = 0 ! not defined yet
195  material%totallyr = 0 ! not defined yet
196  material%is_elem_Rayleigh_damping = .false. ! not defined yet
197 
198  call dict_create( material%dict, 'INIT', dict_null )
199  end subroutine
200 
202  subroutine finalizematerial( material )
203  type( tmaterial ), intent(inout) :: material
204  if( associated(material%table) ) deallocate( material%table )
205  if( associated(material%dict) ) call dict_destroy( material%dict )
206  end subroutine finalizematerial
207 
209  subroutine initializematls( nm )
210  integer, intent(in) :: nm
211  integer :: i
212  if( allocated(materials) ) deallocate( materials )
213  allocate( materials( nm ) )
214  do i=1,nm
215  call initmaterial( materials(i) )
216  enddo
217  end subroutine
218 
220  subroutine finalizematls()
221  integer :: i
222  if( allocated( materials ) ) then
223  do i=1,size(materials)
224  call finalizematerial( materials(i) )
225  enddo
226  deallocate( materials )
227  endif
228  end subroutine
229 
231  subroutine modifymatl( n,m,v)
232  integer, intent(in) :: n
233  integer, intent(in) :: m
234  real(kind=kreal), intent(in) :: v
235 
236  if( n>size(materials) .OR. m>100 ) return
237  materials(n)%variables(m) = v
238  end subroutine
239 
241  subroutine printmaterial( nfile, material )
242  integer, intent(in) :: nfile
243  type( tmaterial ), intent(in) :: material
244  integer :: i, nt
245  write( nfile, *) "Material type:",material%mtype,material%nlgeom_flag
246  do i=1,100
247  if( material%variables(i) /= 0.d0 ) write( nfile, *) i,material%variables(i)
248  enddo
249  if( associated( material%table ) ) then
250  nt = size(material%table)
251  write( nfile,* ) "--table--"
252  do i=1,nt
253  write(nfile,*) i,material%table(i)
254  enddo
255  endif
256  call print_tabledata( material%dict, nfile )
257  end subroutine
258 
260  integer function fetchdigit( npos, cnum )
261  integer, intent(in) :: npos
262  integer, intent(in) :: cnum
263  integer :: i, idum,cdum,dd
264  fetchdigit = -1
265  cdum = cnum
266  if( npos<=0 .or. npos>6) return
267  if( cnum<100000 .or. cnum>999999 ) return
268  dd = 100000
269  do i=1,npos-1
270  idum = cdum/dd
271  cdum = cdum-idum*dd
272  dd = dd/10
273  enddo
274  fetchdigit = cdum/10**(6-npos)
275  end function
276 
278  subroutine setdigit( npos, ival, mtype )
279  integer, intent(in) :: npos
280  integer, intent(in) :: ival
281  integer, intent(inout) :: mtype
282  integer :: i, idum,cdum, cdum1, dd
283  cdum = mtype
284  if( npos<=0 .or. npos>6 ) return
285  if( ival<0 .or. ival>9 ) return
286  dd =100000
287  cdum1 = 0
288  do i=1,npos-1
289  idum = cdum/dd
290  cdum1 = cdum1+ idum*dd
291  cdum = cdum-idum*dd
292  dd=dd/10
293  enddo
294  cdum1 = cdum1 + ival*dd
295  idum = cdum/dd
296  cdum = cdum-idum*dd
297  dd=dd/10
298  do i=npos+1,6
299  idum = cdum/dd
300  cdum1 = cdum1+ idum*dd
301  cdum = cdum-idum*dd
302  dd=dd/10
303  enddo
304  mtype = cdum1
305  end subroutine
306 
308  integer function getelastictype( mtype )
309  integer, intent(in) :: mtype
310  integer :: itype
311  getelastictype = -1
312  itype = fetchdigit( 1, mtype )
313  if( itype/=1 ) return ! not defomration problem
314  itype = fetchdigit( 2, mtype )
315  if( itype/=1 .and. itype/=2 ) return ! not defomration problem
316  getelastictype = fetchdigit( 3, mtype )
317  end function
318 
320  integer function getyieldfunction( mtype )
321  integer, intent(in) :: mtype
322  integer :: itype
323  getyieldfunction = -1
324  itype = fetchdigit( 1, mtype )
325  if( itype/=1 ) return ! not defomration problem
326  itype = fetchdigit( 2, mtype )
327  if( itype/=2 ) return ! not elstoplastic problem
328  getyieldfunction = fetchdigit( 4, mtype )
329  end function
330 
332  integer function gethardentype( mtype )
333  integer, intent(in) :: mtype
334  integer :: itype
335  gethardentype = -1
336  itype = fetchdigit( 1, mtype )
337  if( itype/=1 ) return ! not defomration problem
338  itype = fetchdigit( 2, mtype )
339  if( itype/=2 ) return ! not elstoplastic problem
340  gethardentype = fetchdigit( 5, mtype )
341  end function
342 
344  logical function iskinematicharden( mtype )
345  integer, intent(in) :: mtype
346  integer :: itype
347  iskinematicharden = .false.
348  itype = fetchdigit( 5, mtype )
349  if( itype==4 .or. itype==5 ) iskinematicharden = .true.
350  end function
351 
353  logical function iselastic( mtype )
354  integer, intent(in) :: mtype
355  integer :: itype
356  iselastic = .false.
357  itype = fetchdigit( 2, mtype )
358  if( itype==1 ) iselastic = .true.
359  end function
360 
362  logical function iselastoplastic( mtype )
363  integer, intent(in) :: mtype
364  integer :: itype
365  iselastoplastic = .false.
366  itype = fetchdigit( 2, mtype )
367  if( itype==2 ) iselastoplastic = .true.
368  end function
369 
371  logical function ishyperelastic( mtype )
372  integer, intent(in) :: mtype
373  integer :: itype
374  ishyperelastic = .false.
375  itype = fetchdigit( 2, mtype )
376  if( itype==3 ) ishyperelastic = .true.
377  end function
378 
380  logical function isviscoelastic( mtype )
381  integer, intent(in) :: mtype
382  integer :: itype
383  isviscoelastic = .false.
384  itype = fetchdigit( 2, mtype )
385  if( itype==4 ) isviscoelastic = .true.
386  end function
387 
389  subroutine ep2e( mtype )
390  integer, intent(inout) :: mtype
391  if( .not. iselastoplastic( mtype ) ) return
392  call setdigit( 2, 1, mtype )
393  end subroutine
394 
396  integer function getconnectortype( mtype )
397  integer, intent(in) :: mtype
398  integer :: itype
399  getconnectortype = -1
400  itype = fetchdigit( 1, mtype )
401  if( itype/=1 ) return ! not defomration problem
402  itype = fetchdigit( 2, mtype )
403  if( itype/=7 ) return ! not connector
404  getconnectortype = fetchdigit( 3, mtype )
405  end function
406 
408  integer function getnumofspring_dparam( material )
409  type( tmaterial ), intent(in) :: material
410  getnumofspring_dparam = material%variables_i(m_spring_d_ndoffset+1)
411  end function
412 
414  integer function getnumofspring_aparam( material )
415  type( tmaterial ), intent(in) :: material
416  getnumofspring_aparam = material%variables_i(m_spring_a_ndoffset+1)
417  end function
418 
420  integer function getnumofdashpot_dparam( material )
421  type( tmaterial ), intent(in) :: material
422  getnumofdashpot_dparam = material%variables_i(m_dashpot_d_ndoffset+1)
423  end function
424 
426  integer function getnumofdashpot_aparam( material )
427  type( tmaterial ), intent(in) :: material
428  getnumofdashpot_aparam = material%variables_i(m_dashpot_a_ndoffset+1)
429  end function
430 
431 end module
432 
433 
434 
I/O and Utility.
Definition: hecmw_util_f.F90:7
This module provides data structure table which would be dictionaried afterwards.
Definition: ttable.f90:7
type(ttable), parameter dict_null
Definition: ttable.f90:30
This module summarizes all information of material properties.
Definition: material.f90:6
integer(kind=kint), parameter m_dashpot_axial
Definition: material.f90:132
integer(kind=kint), parameter m_youngs
Definition: material.f90:92
integer function getyieldfunction(mtype)
Get type of yield function.
Definition: material.f90:321
integer(kind=kint), parameter m_plconst5
Definition: material.f90:102
character(len=dict_key_length) mc_incomp_newtonian
Definition: material.f90:147
integer(kind=kint), parameter m_plconst6
Definition: material.f90:120
integer(kind=kint), parameter connector
Definition: material.f90:81
integer(kind=kint), parameter mooneyrivlin
Definition: material.f90:72
integer(kind=kint), parameter m_beam_radius
Definition: material.f90:109
integer(kind=kint), parameter mooneyrivlin_aniso
Definition: material.f90:75
subroutine printmaterial(nfile, material)
Print out the material properties.
Definition: material.f90:242
integer(kind=kint), parameter planestress
Definition: material.f90:85
integer(kind=kint), parameter m_spring_axial
Definition: material.f90:130
character(len=dict_key_length) mc_viscoelastic
Definition: material.f90:145
integer(kind=kint), parameter m_plconst4
Definition: material.f90:101
integer(kind=kint), parameter viscoelastic
Definition: material.f90:77
integer(kind=kint), parameter m_exapnsion
Definition: material.f90:105
integer function getelastictype(mtype)
Get elastic type.
Definition: material.f90:309
subroutine modifymatl(n, m, v)
Set value of variable(m) of material n to v.
Definition: material.f90:232
integer(kind=kint), parameter m_plconst1
Definition: material.f90:98
logical function ishyperelastic(mtype)
If it is a hyperelastic material?
Definition: material.f90:372
integer function getnumofdashpot_dparam(material)
Get number of dashpot_d parameters.
Definition: material.f90:421
integer function gethardentype(mtype)
Get type of hardening.
Definition: material.f90:333
character(len=dict_key_length) mc_themoexp
Definition: material.f90:143
character(len=dict_key_length) mc_spring
Definition: material.f90:148
character(len=dict_key_length) mc_norton
Definition: material.f90:146
integer(kind=kint), parameter d3
Definition: material.f90:84
integer(kind=kint), parameter planestrain
Definition: material.f90:86
type(tmaterial), dimension(:), allocatable materials
Definition: material.f90:183
integer(kind=kint), parameter m_dashpot_a_ndoffset
Definition: material.f90:137
integer(kind=kint), parameter m_beam_angle6
Definition: material.f90:115
integer function getnumofdashpot_aparam(material)
Get number of dashpot_a parameters.
Definition: material.f90:427
integer(kind=kint), parameter m_plconst10
Definition: material.f90:124
integer(kind=kint), parameter elastic
Definition: material.f90:65
integer(kind=kint), parameter m_plconst2
Definition: material.f90:99
integer(kind=kint), parameter arrudaboyce
Definition: material.f90:73
integer(kind=kint), parameter shell
Definition: material.f90:88
integer(kind=kint), parameter mn_orthoelastic
Definition: material.f90:66
integer(kind=kint), parameter incomp_newtonian
Definition: material.f90:80
integer(kind=kint), parameter m_beam_angle3
Definition: material.f90:112
integer(kind=kint), parameter totallag
Definition: material.f90:14
integer(kind=kint), parameter m_density
Definition: material.f90:94
subroutine initializematls(nm)
Initializer.
Definition: material.f90:210
integer(kind=kint), parameter m_beam_angle4
Definition: material.f90:113
integer(kind=kint), parameter m_kinehard
Definition: material.f90:103
integer function getnumofspring_aparam(material)
Get number of spring_a parameters.
Definition: material.f90:415
subroutine setdigit(npos, ival, mtype)
Modify material type.
Definition: material.f90:279
integer(kind=kint), parameter norton
Definition: material.f90:78
integer(kind=kint), parameter m_plconst9
Definition: material.f90:123
integer(kind=kint), parameter m_damping_rk
Definition: material.f90:127
character(len=dict_key_length) mc_dashpot
Definition: material.f90:149
integer(kind=kint), parameter m_poisson
Definition: material.f90:93
subroutine finalizematerial(material)
Finalizer.
Definition: material.f90:203
integer(kind=kint), parameter m_plconst8
Definition: material.f90:122
integer(kind=kint), parameter m_damping_rm
Definition: material.f90:126
integer(kind=kint), parameter axissymetric
Definition: material.f90:87
integer(kind=kint), parameter m_beam_angle1
Definition: material.f90:110
integer(kind=kint), parameter m_dashpot_dof
Definition: material.f90:131
character(len=dict_key_length) mc_orthoexp
Definition: material.f90:144
integer(kind=kint), parameter infinitesimal
Definition: material.f90:13
character(len=dict_key_length) mc_yield
Definition: material.f90:142
integer(kind=kint), parameter userelastic
Definition: material.f90:67
integer(kind=kint), parameter m_viscocity
Definition: material.f90:117
integer(kind=kint), parameter neohooke
Definition: material.f90:71
integer(kind=kint), parameter m_plconst7
Definition: material.f90:121
subroutine finalizematls()
Finalizer.
Definition: material.f90:221
integer(kind=kint), parameter m_thick
Definition: material.f90:95
logical function iskinematicharden(mtype)
If it is a kinematic hardening material?
Definition: material.f90:345
integer(kind=kint), parameter usermaterial
Definition: material.f90:63
integer function fetchdigit(npos, cnum)
Fetch material type.
Definition: material.f90:261
integer(kind=kint), parameter m_beam_angle5
Definition: material.f90:114
integer(kind=kint), parameter m_spring_dof
Definition: material.f90:129
character(len=dict_key_length) mc_isoelastic
Definition: material.f90:140
integer(kind=kint), parameter m_beam_angle2
Definition: material.f90:111
logical function iselastic(mtype)
If it is an elastic material?
Definition: material.f90:354
integer function getnumofspring_dparam(material)
Get number of spring_d parameters.
Definition: material.f90:409
integer(kind=kint), parameter userhyperelastic
Definition: material.f90:74
integer(kind=kint), parameter m_plconst3
Definition: material.f90:100
character(len=dict_key_length) mc_orthoelastic
Definition: material.f90:141
integer(kind=kint), parameter updatelag
Definition: material.f90:15
subroutine ep2e(mtype)
Set material type of elastoplastic to elastic.
Definition: material.f90:390
integer(kind=kint), parameter m_alpha_over_mu
Definition: material.f90:107
integer(kind=kint), parameter m_spring_d_ndoffset
Definition: material.f90:134
integer(kind=kint), parameter m_dashpot_d_ndoffset
Definition: material.f90:136
logical function isviscoelastic(mtype)
If it is an viscoelastic material?
Definition: material.f90:381
subroutine initmaterial(material)
Initializer.
Definition: material.f90:189
integer(kind=kint), parameter m_spring_a_ndoffset
Definition: material.f90:135
logical function iselastoplastic(mtype)
If it is an elastoplastic material?
Definition: material.f90:363
integer(kind=kint), parameter eplastic
Definition: material.f90:69
integer function getconnectortype(mtype)
Get type of connector.
Definition: material.f90:397
This module provides data structure of dictionaried table list.
Definition: ttable.f90:140
subroutine print_tabledata(dict, fname)
Print our the contents of a dictionary.
Definition: ttable.f90:395
Structure to manage all material related data.
Definition: material.f90:167