FrontISTR  6.0.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 viscoelastic deformation, time-temperature superposition
61  ! 1: WLF i.e. 140001
62  ! 2: Arrhenius 140002
63  ! For elastoplastic deformation, creep law
64  ! 0: none i.e. 120000
65  ! 1: Norton 120001
66  integer(kind=kint), parameter :: usermaterial = 100000
67 
68  integer(kind=kint), parameter :: elastic = 110000
69  integer(kind=kint), parameter :: mn_orthoelastic = 111000
70  integer(kind=kint), parameter :: userelastic = 112000
71 
72  integer(kind=kint), parameter :: eplastic = 120000
73 
74  integer(kind=kint), parameter :: neohooke = 130000
75  integer(kind=kint), parameter :: mooneyrivlin = 131000
76  integer(kind=kint), parameter :: arrudaboyce = 132000
77  integer(kind=kint), parameter :: userhyperelastic = 133000
78  integer(kind=kint), parameter :: mooneyrivlin_aniso = 134000
79 
80  integer(kind=kint), parameter :: viscoelastic = 140000
81  integer(kind=kint), parameter :: norton = 150000
82 
83  integer(kind=kint), parameter :: incomp_newtonian = 160000
84  integer(kind=kint), parameter :: connector = 170000
85 
86  ! Following section type
87  integer(kind=kint), parameter :: d3 = -1
88  integer(kind=kint), parameter :: planestress = 1
89  integer(kind=kint), parameter :: planestrain = 0
90  integer(kind=kint), parameter :: axissymetric = 2
91  integer(kind=kint), parameter :: shell = 3
92 
93  ! Material constants are saved in an array of size 100 and their physical meaning
94  ! correspond to their position in the array
95  integer(kind=kint), parameter :: m_youngs = 1
96  integer(kind=kint), parameter :: m_poisson = 2
97  integer(kind=kint), parameter :: m_density = 3
98 
99  ! following plastic constitutive parameter
100  integer(kind=kint), parameter :: m_plconst1 = 5
101  integer(kind=kint), parameter :: m_plconst2 = 6
102  integer(kind=kint), parameter :: m_plconst3 = 7
103  integer(kind=kint), parameter :: m_plconst4 = 8
104  integer(kind=kint), parameter :: m_plconst5 = 9
105  integer(kind=kint), parameter :: m_kinehard = 10
106 
107  integer(kind=kint), parameter :: m_expansion = 20
108 
109  integer(kind=kint), parameter :: m_alpha_over_mu = 21
110 
111  integer(kind=kint), parameter :: m_beam_radius = 22
112  integer(kind=kint), parameter :: m_beam_angle1 = 23
113  integer(kind=kint), parameter :: m_beam_angle2 = 24
114  integer(kind=kint), parameter :: m_beam_angle3 = 25
115  integer(kind=kint), parameter :: m_beam_angle4 = 26
116  integer(kind=kint), parameter :: m_beam_angle5 = 27
117  integer(kind=kint), parameter :: m_beam_angle6 = 28
118 
119  integer(kind=kint), parameter :: m_viscocity = 29
120 
121  ! additional plastic constitutive parameter
122  integer(kind=kint), parameter :: m_plconst6 = 30
123  integer(kind=kint), parameter :: m_plconst7 = 31
124  integer(kind=kint), parameter :: m_plconst8 = 32
125  integer(kind=kint), parameter :: m_plconst9 = 33
126  integer(kind=kint), parameter :: m_plconst10 = 34
127 
128  integer(kind=kint), parameter :: m_damping_rm = 35
129  integer(kind=kint), parameter :: m_damping_rk = 36
130 
131  integer(kind=kint), parameter :: m_spring_dof = 0
132  integer(kind=kint), parameter :: m_spring_axial = 1
133  integer(kind=kint), parameter :: m_dashpot_dof = 2
134  integer(kind=kint), parameter :: m_dashpot_axial = 3
135 
136  integer(kind=kint), parameter :: m_spring_d_ndoffset = 0
137  integer(kind=kint), parameter :: m_spring_a_ndoffset = 72
138  integer(kind=kint), parameter :: m_dashpot_d_ndoffset = 73
139  integer(kind=kint), parameter :: m_dashpot_a_ndoffset = 145
140 
141  ! Dictionary constants
142  character(len=DICT_KEY_LENGTH) :: mc_isoelastic= 'ISOELASTIC' ! youngs modulus, poisson's ratio
143  character(len=DICT_KEY_LENGTH) :: mc_orthoelastic= 'ORTHOELASTIC' ! ortho elastic modulus
144  character(len=DICT_KEY_LENGTH) :: mc_yield = 'YIELD' ! plastic strain, yield stress
145  character(len=DICT_KEY_LENGTH) :: mc_themoexp = 'THEMOEXP' ! thermo expansion coefficient
146  character(len=DICT_KEY_LENGTH) :: mc_orthoexp = 'ORTHOEXP' ! thermo expansion coefficient
147  character(len=DICT_KEY_LENGTH) :: mc_viscoelastic = 'VISCOELASTIC' ! Prony coeff only curr.
148  character(len=DICT_KEY_LENGTH) :: mc_norton = 'NORTON' ! NOrton's creep law
149  character(len=DICT_KEY_LENGTH) :: mc_incomp_newtonian = 'INCOMP_FLUID' ! viscocity
150  character(len=DICT_KEY_LENGTH) :: mc_spring= 'SPRING' ! spring
151  character(len=DICT_KEY_LENGTH) :: mc_dashpot= 'DASHPOT' ! dashpot
152 
154  integer(kind=kint) :: ortho
155  real(kind=kreal) :: ee
156  real(kind=kreal) :: pp
157  real(kind=kreal) :: ee2
158  real(kind=kreal) :: g12
159  real(kind=kreal) :: g23
160  real(kind=kreal) :: g31
161  real(kind=kreal) :: angle
162  real(kind=kreal) :: rho
163  real(kind=kreal) :: alpha
164  real(kind=kreal) :: alpha_over_mu
165  real(kind=kreal) :: weight
166  end type tshellmat
167 
170  integer(kind=kint) :: nlgeom_flag
171  integer(kind=kint) :: mtype
172  integer(kind=kint) :: nfstatus
173  character(len=HECMW_NAME_LEN) :: name
174  real(kind=kreal) :: variables(200)
175  integer(kind=kint) :: variables_i(200)
176  type(tshellmat), pointer :: shell_var(:) => null()
177  integer(kind=kint) :: totallyr
178  integer(kind=kint) :: cdsys_id
179  integer(kind=kint) :: n_table
180  real(kind=kreal), pointer :: table(:)=>null()
181  type(dict_struct), pointer :: dict
182  logical :: is_elem_rayleigh_damping
183  end type tmaterial
184 
185  type(tmaterial), allocatable :: materials(:)
186 
187 contains
188 
190  subroutine initmaterial( material )
191  type( tmaterial ), intent(inout) :: material
192  material%mtype = -1 ! not defined yet
193  material%nfstatus = 0 ! Default: no status
194  material%nlgeom_flag = infinitesimal ! Default: INFINITESIMAL ANALYSIS
195  material%variables = 0.d0 ! not defined yet
196  material%variables_i = 0 ! not defined yet
197  material%totallyr = 0 ! not defined yet
198  material%is_elem_Rayleigh_damping = .false. ! not defined yet
199 
200  call dict_create( material%dict, 'INIT', dict_null )
201  end subroutine
202 
204  subroutine finalizematerial( material )
205  type( tmaterial ), intent(inout) :: material
206  if( associated(material%table) ) deallocate( material%table )
207  if( associated(material%dict) ) call dict_destroy( material%dict )
208  end subroutine finalizematerial
209 
211  subroutine initializematls( nm )
212  integer, intent(in) :: nm
213  integer :: i
214  if( allocated(materials) ) deallocate( materials )
215  allocate( materials( nm ) )
216  do i=1,nm
217  call initmaterial( materials(i) )
218  enddo
219  end subroutine
220 
222  subroutine finalizematls()
223  integer :: i
224  if( allocated( materials ) ) then
225  do i=1,size(materials)
226  call finalizematerial( materials(i) )
227  enddo
228  deallocate( materials )
229  endif
230  end subroutine
231 
233  integer function fetchdigit( npos, cnum )
234  integer, intent(in) :: npos
235  integer, intent(in) :: cnum
236  integer :: i, idum,cdum,dd
237  fetchdigit = -1
238  cdum = cnum
239  if( npos<=0 .or. npos>6) return
240  if( cnum<100000 .or. cnum>999999 ) return
241  dd = 100000
242  do i=1,npos-1
243  idum = cdum/dd
244  cdum = cdum-idum*dd
245  dd = dd/10
246  enddo
247  fetchdigit = cdum/10**(6-npos)
248  end function
249 
251  subroutine setdigit( npos, ival, mtype )
252  integer, intent(in) :: npos
253  integer, intent(in) :: ival
254  integer, intent(inout) :: mtype
255  integer :: i, idum,cdum, cdum1, dd
256  cdum = mtype
257  if( npos<=0 .or. npos>6 ) return
258  if( ival<0 .or. ival>9 ) return
259  dd =100000
260  cdum1 = 0
261  do i=1,npos-1
262  idum = cdum/dd
263  cdum1 = cdum1+ idum*dd
264  cdum = cdum-idum*dd
265  dd=dd/10
266  enddo
267  cdum1 = cdum1 + ival*dd
268  idum = cdum/dd
269  cdum = cdum-idum*dd
270  dd=dd/10
271  do i=npos+1,6
272  idum = cdum/dd
273  cdum1 = cdum1+ idum*dd
274  cdum = cdum-idum*dd
275  dd=dd/10
276  enddo
277  mtype = cdum1
278  end subroutine
279 
281  integer function getelastictype( mtype )
282  integer, intent(in) :: mtype
283  integer :: itype
284  getelastictype = -1
285  itype = fetchdigit( 1, mtype )
286  if( itype/=1 ) return ! not defomration problem
287  itype = fetchdigit( 2, mtype )
288  if( itype/=1 .and. itype/=2 ) return ! not defomration problem
289  getelastictype = fetchdigit( 3, mtype )
290  end function
291 
293  integer function getyieldfunction( mtype )
294  integer, intent(in) :: mtype
295  integer :: itype
296  getyieldfunction = -1
297  itype = fetchdigit( 1, mtype )
298  if( itype/=1 ) return ! not defomration problem
299  itype = fetchdigit( 2, mtype )
300  if( itype/=2 ) return ! not elstoplastic problem
301  getyieldfunction = fetchdigit( 4, mtype )
302  end function
303 
305  integer function gethardentype( mtype )
306  integer, intent(in) :: mtype
307  integer :: itype
308  gethardentype = -1
309  itype = fetchdigit( 1, mtype )
310  if( itype/=1 ) return ! not defomration problem
311  itype = fetchdigit( 2, mtype )
312  if( itype/=2 ) return ! not elstoplastic problem
313  gethardentype = fetchdigit( 5, mtype )
314  end function
315 
317  logical function iskinematicharden( mtype )
318  integer, intent(in) :: mtype
319  integer :: itype
320  iskinematicharden = .false.
321  itype = fetchdigit( 5, mtype )
322  if( itype==4 .or. itype==5 ) iskinematicharden = .true.
323  end function
324 
326  logical function iselastic( mtype )
327  integer, intent(in) :: mtype
328  integer :: itype
329  iselastic = .false.
330  itype = fetchdigit( 2, mtype )
331  if( itype==1 ) iselastic = .true.
332  end function
333 
335  logical function iselastoplastic( mtype )
336  integer, intent(in) :: mtype
337  integer :: itype
338  iselastoplastic = .false.
339  itype = fetchdigit( 2, mtype )
340  if( itype==2 ) iselastoplastic = .true.
341  end function
342 
344  logical function ishyperelastic( mtype )
345  integer, intent(in) :: mtype
346  integer :: itype
347  ishyperelastic = .false.
348  itype = fetchdigit( 2, mtype )
349  if( itype==3 ) ishyperelastic = .true.
350  end function
351 
353  logical function isviscoelastic( mtype )
354  integer, intent(in) :: mtype
355  integer :: itype
356  isviscoelastic = .false.
357  itype = fetchdigit( 2, mtype )
358  if( itype==4 ) isviscoelastic = .true.
359  end function
360 
362  logical function iscreep( mtype )
363  integer, intent(in) :: mtype
364  iscreep = .false.
365  if( mtype==norton ) then
366  iscreep = .true.
367  else if( iselastoplastic( mtype ) ) then
368  if( fetchdigit( 6, mtype )==1 ) iscreep = .true.
369  endif
370  end function
371 
373  subroutine ep2e( mtype )
374  integer, intent(inout) :: mtype
375  if( .not. iselastoplastic( mtype ) ) return
376  call setdigit( 2, 1, mtype )
377  end subroutine
378 
380  integer function getconnectortype( mtype )
381  integer, intent(in) :: mtype
382  integer :: itype
383  getconnectortype = -1
384  itype = fetchdigit( 1, mtype )
385  if( itype/=1 ) return ! not defomration problem
386  itype = fetchdigit( 2, mtype )
387  if( itype/=7 ) return ! not connector
388  getconnectortype = fetchdigit( 3, mtype )
389  end function
390 
392  integer function getnumofspring_dparam( material )
393  type( tmaterial ), intent(in) :: material
394  getnumofspring_dparam = material%variables_i(m_spring_d_ndoffset+1)
395  end function
396 
398  integer function getnumofspring_aparam( material )
399  type( tmaterial ), intent(in) :: material
400  getnumofspring_aparam = material%variables_i(m_spring_a_ndoffset+1)
401  end function
402 
404  integer function getnumofdashpot_dparam( material )
405  type( tmaterial ), intent(in) :: material
406  getnumofdashpot_dparam = material%variables_i(m_dashpot_d_ndoffset+1)
407  end function
408 
410  integer function getnumofdashpot_aparam( material )
411  type( tmaterial ), intent(in) :: material
412  getnumofdashpot_aparam = material%variables_i(m_dashpot_a_ndoffset+1)
413  end function
414 
415 end module
416 
417 
418 
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:134
integer(kind=kint), parameter m_youngs
Definition: material.f90:95
integer function getyieldfunction(mtype)
Get type of yield function.
Definition: material.f90:294
integer(kind=kint), parameter m_plconst5
Definition: material.f90:104
character(len=dict_key_length) mc_incomp_newtonian
Definition: material.f90:149
integer(kind=kint), parameter m_plconst6
Definition: material.f90:122
integer(kind=kint), parameter connector
Definition: material.f90:84
integer(kind=kint), parameter mooneyrivlin
Definition: material.f90:75
integer(kind=kint), parameter m_expansion
Definition: material.f90:107
integer(kind=kint), parameter m_beam_radius
Definition: material.f90:111
integer(kind=kint), parameter mooneyrivlin_aniso
Definition: material.f90:78
integer(kind=kint), parameter planestress
Definition: material.f90:88
integer(kind=kint), parameter m_spring_axial
Definition: material.f90:132
character(len=dict_key_length) mc_viscoelastic
Definition: material.f90:147
integer(kind=kint), parameter m_plconst4
Definition: material.f90:103
integer(kind=kint), parameter viscoelastic
Definition: material.f90:80
integer function getelastictype(mtype)
Get elastic type.
Definition: material.f90:282
integer(kind=kint), parameter m_plconst1
Definition: material.f90:100
logical function ishyperelastic(mtype)
If it is a hyperelastic material?
Definition: material.f90:345
integer function getnumofdashpot_dparam(material)
Get number of dashpot_d parameters.
Definition: material.f90:405
integer function gethardentype(mtype)
Get type of hardening.
Definition: material.f90:306
character(len=dict_key_length) mc_themoexp
Definition: material.f90:145
character(len=dict_key_length) mc_spring
Definition: material.f90:150
character(len=dict_key_length) mc_norton
Definition: material.f90:148
integer(kind=kint), parameter d3
Definition: material.f90:87
integer(kind=kint), parameter planestrain
Definition: material.f90:89
type(tmaterial), dimension(:), allocatable materials
Definition: material.f90:185
integer(kind=kint), parameter m_dashpot_a_ndoffset
Definition: material.f90:139
integer(kind=kint), parameter m_beam_angle6
Definition: material.f90:117
integer function getnumofdashpot_aparam(material)
Get number of dashpot_a parameters.
Definition: material.f90:411
integer(kind=kint), parameter m_plconst10
Definition: material.f90:126
integer(kind=kint), parameter elastic
Definition: material.f90:68
integer(kind=kint), parameter m_plconst2
Definition: material.f90:101
integer(kind=kint), parameter arrudaboyce
Definition: material.f90:76
integer(kind=kint), parameter shell
Definition: material.f90:91
integer(kind=kint), parameter mn_orthoelastic
Definition: material.f90:69
integer(kind=kint), parameter incomp_newtonian
Definition: material.f90:83
integer(kind=kint), parameter m_beam_angle3
Definition: material.f90:114
integer(kind=kint), parameter totallag
Definition: material.f90:14
integer(kind=kint), parameter m_density
Definition: material.f90:97
subroutine initializematls(nm)
Initializer.
Definition: material.f90:212
integer(kind=kint), parameter m_beam_angle4
Definition: material.f90:115
integer(kind=kint), parameter m_kinehard
Definition: material.f90:105
integer function getnumofspring_aparam(material)
Get number of spring_a parameters.
Definition: material.f90:399
subroutine setdigit(npos, ival, mtype)
Modify material type.
Definition: material.f90:252
integer(kind=kint), parameter norton
Definition: material.f90:81
integer(kind=kint), parameter m_plconst9
Definition: material.f90:125
integer(kind=kint), parameter m_damping_rk
Definition: material.f90:129
character(len=dict_key_length) mc_dashpot
Definition: material.f90:151
integer(kind=kint), parameter m_poisson
Definition: material.f90:96
subroutine finalizematerial(material)
Finalizer.
Definition: material.f90:205
integer(kind=kint), parameter m_plconst8
Definition: material.f90:124
integer(kind=kint), parameter m_damping_rm
Definition: material.f90:128
integer(kind=kint), parameter axissymetric
Definition: material.f90:90
integer(kind=kint), parameter m_beam_angle1
Definition: material.f90:112
integer(kind=kint), parameter m_dashpot_dof
Definition: material.f90:133
character(len=dict_key_length) mc_orthoexp
Definition: material.f90:146
integer(kind=kint), parameter infinitesimal
Definition: material.f90:13
character(len=dict_key_length) mc_yield
Definition: material.f90:144
integer(kind=kint), parameter userelastic
Definition: material.f90:70
logical function iscreep(mtype)
If it is a material with creep?
Definition: material.f90:363
integer(kind=kint), parameter m_viscocity
Definition: material.f90:119
integer(kind=kint), parameter neohooke
Definition: material.f90:74
integer(kind=kint), parameter m_plconst7
Definition: material.f90:123
subroutine finalizematls()
Finalizer.
Definition: material.f90:223
logical function iskinematicharden(mtype)
If it is a kinematic hardening material?
Definition: material.f90:318
integer(kind=kint), parameter usermaterial
Definition: material.f90:66
integer function fetchdigit(npos, cnum)
Fetch material type.
Definition: material.f90:234
integer(kind=kint), parameter m_beam_angle5
Definition: material.f90:116
integer(kind=kint), parameter m_spring_dof
Definition: material.f90:131
character(len=dict_key_length) mc_isoelastic
Definition: material.f90:142
integer(kind=kint), parameter m_beam_angle2
Definition: material.f90:113
logical function iselastic(mtype)
If it is an elastic material?
Definition: material.f90:327
integer function getnumofspring_dparam(material)
Get number of spring_d parameters.
Definition: material.f90:393
integer(kind=kint), parameter userhyperelastic
Definition: material.f90:77
integer(kind=kint), parameter m_plconst3
Definition: material.f90:102
character(len=dict_key_length) mc_orthoelastic
Definition: material.f90:143
integer(kind=kint), parameter updatelag
Definition: material.f90:15
subroutine ep2e(mtype)
Set material type of elastoplastic to elastic.
Definition: material.f90:374
integer(kind=kint), parameter m_alpha_over_mu
Definition: material.f90:109
integer(kind=kint), parameter m_spring_d_ndoffset
Definition: material.f90:136
integer(kind=kint), parameter m_dashpot_d_ndoffset
Definition: material.f90:138
logical function isviscoelastic(mtype)
If it is an viscoelastic material?
Definition: material.f90:354
subroutine initmaterial(material)
Initializer.
Definition: material.f90:191
integer(kind=kint), parameter m_spring_a_ndoffset
Definition: material.f90:137
logical function iselastoplastic(mtype)
If it is an elastoplastic material?
Definition: material.f90:336
integer(kind=kint), parameter eplastic
Definition: material.f90:72
integer function getconnectortype(mtype)
Get type of connector.
Definition: material.f90:381
This module provides data structure of dictionaried table list.
Definition: ttable.f90:140
Structure to manage all material related data.
Definition: material.f90:169