FrontISTR  5.7.1
Large-scale structural analysis program with finit element method
calMatMatrix.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 m_matmatrix
7  use hecmw_util
8  use mmaterial
9  use mmechgauss
10  use m_elasticlinear
11  use mhyperelastic
12  use m_elastoplastic
13  use mviscoelastic
14  use mcreep
15  use muelastic
16  use mumat
17 
18  implicit none
19 
20 contains
21 
23  integer function getnlgeomflag( gauss )
24  type( tgaussstatus ), intent(in) :: gauss
25  getnlgeomflag = gauss%pMaterial%nlgeom_flag
26  end function
27 
29  subroutine matlmatrix( gauss, sectType, matrix, time, dtime, cdsys, temperature, isEp, hdflag )
30  type( tgaussstatus ), intent(in) :: gauss
31  integer, intent(in) :: sectType
32  real(kind=kreal), intent(out) :: matrix(:,:)
33  real(kind=kreal), intent(in) :: time
34  real(kind=kreal), intent(in) :: dtime
35  real(kind=kreal), intent(in) :: cdsys(3,3)
36  real(kind=kreal), intent(in) :: temperature
37  integer(kind=kint), intent(in), optional :: isEp
38  integer(kind=kint), intent(in), optional :: hdflag
39 
40  integer :: i
41  integer :: flag, hdflag_in
42  real(kind=kreal) :: cijkl(3,3,3,3)
43  type( tmaterial ), pointer :: matl
44  matl=>gauss%pMaterial
45 
46  flag = 0
47  if( present(isep) )then
48  if( isep == 1 )flag = 1
49  endif
50 
51  hdflag_in = 0
52  if( present(hdflag) ) hdflag_in = hdflag
53 
54  if( matl%mtype==userelastic ) then
55  call uelasticmatrix( matl%variables(101:), gauss%strain, matrix )
56  elseif( isviscoelastic(matl%mtype) ) then
57  call calviscoelasticmatrix( matl, secttype, dtime, matrix, temperature )
58  elseif( iselastic(matl%mtype) .or. flag==1 ) then
59  if(flag==1)then
61  else
62  i = getelastictype(gauss%pMaterial%mtype)
63  endif
64 
65  if( i==0 ) then
66  call calelasticmatrix( matl, secttype, matrix, temperature, hdflag=hdflag_in )
67  elseif( i==1 ) then
68  call calelasticmatrix_ortho( gauss%pMaterial, secttype, cdsys, matrix, temperature )
69  else
70  print *, "Elasticity type", matl%mtype, "not supported"
71  stop
72  endif
73 
74  elseif( matl%mtype==neohooke .or. matl%mtype==mooneyrivlin ) then
75  call calelasticmooneyrivlin( matl, secttype, cijkl, gauss%strain, hdflag=hdflag_in )
76  call mat_c2d( cijkl, matrix, secttype )
77  elseif( matl%mtype==arrudaboyce ) then
78  call calelasticarrudaboyce( matl, secttype, cijkl, gauss%strain )
79  call mat_c2d( cijkl, matrix, secttype )
80  elseif( matl%mtype==mooneyrivlin_aniso ) then
81  call calelasticmooneyrivlinaniso( matl, secttype, cijkl, gauss%strain, cdsys, hdflag=hdflag_in )
82  call mat_c2d( cijkl, matrix, secttype )
83  elseif( matl%mtype==userhyperelastic ) then
84  call uelasticmatrix( matl%variables(101:), gauss%strain, matrix )
85  elseif( iselastoplastic(matl%mtype) ) then
86  call calelastoplasticmatrix( matl, secttype, gauss%stress, &
87  gauss%istatus(1), gauss%fstatus, gauss%plstrain, matrix, temperature, hdflag=hdflag_in )
88  elseif( matl%mtype==usermaterial ) then
89  call umatlmatrix( matl%name, matl%variables(101:), gauss%strain, &
90  gauss%stress, gauss%fstatus, matrix, dtime, time )
91  elseif( matl%mtype==norton ) then
92  call iso_creep( matl, secttype, gauss%stress, gauss%strain, gauss%fstatus, &
93  gauss%plstrain, dtime, time, matrix, temperature, hdflag=hdflag_in )
94  else
95  stop "Material type not supported!"
96  endif
97 
98  end subroutine
99 
100  !
102  subroutine stressupdate( gauss, sectType, strain, stress, cdsys, time, dtime, temp, tempn, hdflag )
103  type( tgaussstatus ), intent(inout) :: gauss
104  integer, intent(in) :: sectType
105  real(kind=kreal), intent(in) :: strain(6)
106  real(kind=kreal), intent(out) :: stress(6)
107  real(kind=kreal), intent(in) :: cdsys(3,3)
108  real(kind=kreal), intent(in), optional :: time
109  real(kind=kreal), intent(in), optional :: dtime
110  real(kind=kreal), intent(in) :: temp
111  real(kind=kreal), intent(in) :: tempn
112  integer(kind=kint), intent(in) :: hdflag
113 
114  if( gauss%pMaterial%mtype==neohooke .or. gauss%pMaterial%mtype==mooneyrivlin ) then
115  call calupdateelasticmooneyrivlin( gauss%pMaterial, secttype, strain, stress, gauss%strain_energy, hdflag=hdflag )
116  elseif( gauss%pMaterial%mtype==arrudaboyce ) then ! Arruda-Boyce Hyperelastic material
117  call calupdateelasticarrudaboyce( gauss%pMaterial, secttype, strain, stress )
118  elseif( gauss%pMaterial%mtype==mooneyrivlin_aniso ) then
119  call calupdateelasticmooneyrivlinaniso( gauss%pMaterial, secttype, strain, stress, cdsys, hdflag=hdflag )
120  elseif( gauss%pMaterial%mtype==userhyperelastic .or. gauss%pMaterial%mtype==userelastic ) then ! user-defined
121  call uelasticupdate( gauss%pMaterial%variables(101:), strain, stress )
122  elseif( isviscoelastic( gauss%pMaterial%mtype) ) then
123  if( .not. present(dtime) ) stop "error in viscoelastic update!"
124  call updateviscoelastic( gauss%pMaterial, secttype, strain, stress, gauss%fstatus, dtime, temp, tempn )
125  elseif ( gauss%pMaterial%mtype==norton ) then
126  if( .not. present(dtime) ) stop "error in viscoelastic update!"
127  call update_iso_creep( gauss%pMaterial, secttype, strain, stress, gauss%fstatus, &
128  & gauss%plstrain, dtime, time, temp, hdflag=hdflag )
129  elseif ( gauss%pMaterial%mtype==usermaterial) then ! user-defined
130  call uupdate( gauss%pMaterial%name, gauss%pMaterial%variables(101:), &
131  strain, stress, gauss%fstatus, dtime, time )
132  end if
133 
134  end subroutine stressupdate
135 
137  subroutine mat_c2d( cijkl, dij, itype )
138  real(kind=kreal), intent(in) :: cijkl(3,3,3,3)
139  real(kind=kreal), intent(out) :: dij(6,6)
140  integer, intent(in) :: itype
141 
142  dij(:,:) = 0.d0
143  select case( itype )
144  case( d3 )
145  dij(1,1) = cijkl(1,1,1,1) ! ---
146  dij(1,2) = cijkl(1,1,2,2)
147  dij(1,3) = cijkl(1,1,3,3)
148  dij(1,4) = cijkl(1,1,1,2)
149  dij(1,5) = cijkl(1,1,2,3)
150  dij(1,6) = cijkl(1,1,3,1)
151  dij(2,1) = cijkl(2,2,1,1) ! ---
152  dij(2,2) = cijkl(2,2,2,2)
153  dij(2,3) = cijkl(2,2,3,3)
154  dij(2,4) = cijkl(2,2,1,2)
155  dij(2,5) = cijkl(2,2,2,3)
156  dij(2,6) = cijkl(2,2,3,1)
157  dij(3,1) = cijkl(3,3,1,1) ! ---
158  dij(3,2) = cijkl(3,3,2,2)
159  dij(3,3) = cijkl(3,3,3,3)
160  dij(3,4) = cijkl(3,3,1,2)
161  dij(3,5) = cijkl(3,3,2,3)
162  dij(3,6) = cijkl(3,3,3,1)
163  dij(4,1) = cijkl(1,2,1,1) ! ---
164  dij(4,2) = cijkl(1,2,2,2)
165  dij(4,3) = cijkl(1,2,3,3)
166  dij(4,4) = cijkl(1,2,1,2)
167  dij(4,5) = cijkl(1,2,2,3)
168  dij(4,6) = cijkl(1,2,3,1)
169  dij(5,1) = cijkl(2,3,1,1) ! ---
170  dij(5,2) = cijkl(2,3,2,2)
171  dij(5,3) = cijkl(2,3,3,3)
172  dij(5,4) = cijkl(2,3,1,2)
173  dij(5,5) = cijkl(2,3,2,3)
174  dij(5,6) = cijkl(2,3,3,1)
175  dij(6,1) = cijkl(3,1,1,1) ! ---
176  dij(6,2) = cijkl(3,1,2,2)
177  dij(6,3) = cijkl(3,1,3,3)
178  dij(6,4) = cijkl(3,1,1,2)
179  dij(6,5) = cijkl(3,1,2,3)
180  dij(6,6) = cijkl(3,1,3,1)
181  !
182  case( planestress, planestrain )
183  dij(1,1) = cijkl(1,1,1,1) ! ---
184  dij(1,2) = cijkl(1,1,2,2)
185  dij(1,3) = cijkl(1,1,1,2)
186  dij(2,1) = cijkl(2,2,1,1) ! ---
187  dij(2,2) = cijkl(2,2,2,2)
188  dij(2,3) = cijkl(2,2,1,2)
189  dij(3,1) = cijkl(1,2,1,1) ! ---
190  dij(3,2) = cijkl(1,2,2,2)
191  dij(3,3) = cijkl(1,2,1,2)
192  case( axissymetric )
193  dij(1,1) = cijkl(1,1,1,1)
194  dij(1,2) = cijkl(1,1,2,2)
195  dij(1,3) = cijkl(1,1,1,2)
196  dij(1,4) = cijkl(1,1,3,3)
197  dij(2,1) = cijkl(2,2,1,1)
198  dij(2,2) = cijkl(2,2,2,2)
199  dij(2,3) = cijkl(2,2,1,2)
200  dij(2,4) = cijkl(2,2,3,3)
201  dij(3,1) = cijkl(1,2,1,1)
202  dij(3,2) = cijkl(1,2,2,2)
203  dij(3,3) = cijkl(1,2,1,2)
204  dij(3,4) = cijkl(1,2,3,3)
205  dij(4,1) = cijkl(3,3,1,1)
206  dij(4,2) = cijkl(3,3,2,2)
207  dij(4,3) = cijkl(3,3,1,2)
208  dij(4,4) = cijkl(3,3,3,3)
209  case( shell )
210  end select
211 
212  end subroutine mat_c2d
213 
214  ! (Gaku Hashimoto, The University of Tokyo, 2012/11/15) <
215  !####################################################################
216  subroutine matlmatrix_shell &
217  (gauss, secttype, d, &
218  e1_hat, e2_hat, e3_hat, cg1, cg2, cg3, &
219  alpha, n_layer)
220  !####################################################################
221 
222  type(tgaussstatus), intent(in) :: gauss
223  integer, intent(in) :: sectType, n_layer
224  real(kind = kreal), intent(out) :: d(:, :)
225  real(kind = kreal), intent(in) :: e1_hat(3), e2_hat(3), e3_hat(3)
226  real(kind = kreal), intent(in) :: cg1(3), cg2(3), cg3(3)
227  real(kind = kreal), intent(out) :: alpha
228 
229  !--------------------------------------------------------------------
230 
231  real(kind = kreal) :: c(3, 3, 3, 3)
232  type(tmaterial), pointer :: matl
233 
234  !--------------------------------------------------------------------
235 
236  matl => gauss%pMaterial
237 
238  !--------------------------------------------------------------------
239 
240  if( iselastic(matl%mtype) ) then
241  call linearelastic_shell &
242  (matl, secttype, c, &
243  e1_hat, e2_hat, e3_hat, cg1, cg2, cg3, &
244  alpha, n_layer)
245 
246  call mat_c2d_shell(c, d, secttype)
247  else
248  stop "Material type not supported!"
249  end if
250 
251  !--------------------------------------------------------------------
252 
253  return
254 
255  !####################################################################
256  end subroutine matlmatrix_shell
257  !####################################################################
258  ! > (Gaku Hashimoto, The University of Tokyo, 2012/11/15)
259 
260 
261  ! (Gaku Hashimoto, The University of Tokyo, 2012/11/15) <
262  !####################################################################
263  subroutine mat_c2d_shell(c, D, itype)
264  !####################################################################
265 
266  real(kind = kreal), intent(in) :: c(:, :, :, :)
267  real(kind = kreal), intent(out) :: d(:, :)
268  integer, intent(in) :: itype
269 
270  !--------------------------------------------------------------------
271 
272  integer :: index_i(5), index_j(5), &
273  index_k(5), index_l(5)
274  integer :: i, j, k, l
275  integer :: is, js
276 
277  !--------------------------------------------------------------------
278 
279  index_i(1) = 1
280  index_i(2) = 2
281  index_i(3) = 1
282  index_i(4) = 2
283  index_i(5) = 3
284 
285  index_j(1) = 1
286  index_j(2) = 2
287  index_j(3) = 2
288  index_j(4) = 3
289  index_j(5) = 1
290 
291  index_k(1) = 1
292  index_k(2) = 2
293  index_k(3) = 1
294  index_k(4) = 2
295  index_k(5) = 3
296 
297  index_l(1) = 1
298  index_l(2) = 2
299  index_l(3) = 2
300  index_l(4) = 3
301  index_l(5) = 1
302 
303  !--------------------------------------------------------------------
304 
305  d(:, :) = 0.0d0
306 
307  !--------------------------------------------------------------------
308 
309  select case( itype )
310  case( shell )
311 
312  do js = 1, 5
313 
314  do is = 1, 5
315 
316  i = index_i(is)
317  j = index_j(is)
318  k = index_k(js)
319  l = index_l(js)
320 
321  d(is, js) = c(i, j, k, l)
322 
323  end do
324 
325  end do
326 
327  end select
328 
329  !--------------------------------------------------------------------
330 
331  return
332 
333  !####################################################################
334  end subroutine mat_c2d_shell
335  !####################################################################
336  ! > (Gaku Hashimoto, The University of Tokyo, 2012/11/15)
337 
338  subroutine getconnectorproperty( gauss, ctype, dofid, rparams, iparams, stretch )
339  type( tgaussstatus ), intent(in) :: gauss
340  integer(kind=kint), intent(in) :: ctype
341  integer(kind=kint), intent(in) :: dofid
342  real(kind=kreal), intent(out) :: rparams(:)
343  integer(kind=kint), intent(out) :: iparams(:)
344  real(kind=kreal), intent(in), optional :: stretch
345 
346  real(kind=kreal) ina(1), outa(4)
347  logical :: ierr
348  character(len=DICT_KEY_LENGTH) :: cnkey
349 
350  rparams(:) = 0.d0
351  iparams(:) = 0
352 
353  if( ctype == m_spring_dof ) then ! Dof Spring
354  write(cnkey,'(A,I0)') trim(mc_spring),dofid
355  iparams(1) = gauss%pMaterial%variables_i(m_spring_d_ndoffset+2*dofid )
356  iparams(2) = gauss%pMaterial%variables_i(m_spring_d_ndoffset+2*dofid+1)
357  else if( ctype == m_spring_axial ) then ! Dof Spring
358  write(cnkey,'(A,A)') trim(mc_spring),'_A'
359  else if( ctype == m_dashpot_dof ) then ! Dof Dashpot
360  write(cnkey,'(A,I0)') trim(mc_dashpot),dofid
361  iparams(1) = gauss%pMaterial%variables_i(m_dashpot_d_ndoffset+2*dofid )
362  iparams(2) = gauss%pMaterial%variables_i(m_dashpot_d_ndoffset+2*dofid+1)
363  else if( ctype == m_dashpot_axial ) then ! Dof Dashpot
364  write(cnkey,'(A,A)') trim(mc_dashpot),'_A'
365  else
366  stop "CONNECTOR ctype is not defined"
367  endif
368 
369  if( present(stretch) ) then
370  ina(1) = stretch
371  call fetch_tabledata( cnkey, gauss%pMaterial%dict, outa(1:1), ierr, ina )
372  else
373  call fetch_tabledata( cnkey, gauss%pMaterial%dict, outa(1:1), ierr )
374  endif
375  rparams(1) = outa(1)
376 
377  end subroutine
378 
379 end module m_matmatrix
I/O and Utility.
Definition: hecmw_util_f.F90:7
This module provides functions for elastic material.
subroutine calelasticmatrix(matl, sectType, D, temp, hdflag)
Calculate isotropic elastic matrix.
subroutine linearelastic_shell(matl, sectType, c, e1_hat, e2_hat, e3_hat, cg1, cg2, cg3, alpha, n_layer)
subroutine calelasticmatrix_ortho(matl, sectType, bij, DMAT, temp)
Calculate orthotropic elastic matrix.
This module provide functions for elastoplastic calculation.
subroutine, public calelastoplasticmatrix(matl, sectType, stress, istat, extval, plstrain, D, temperature, hdflag)
This subroutine calculates elastoplastic constitutive relation.
This module manages calculation relates with materials.
Definition: calMatMatrix.f90:6
subroutine getconnectorproperty(gauss, ctype, dofid, rparams, iparams, stretch)
subroutine matlmatrix(gauss, sectType, matrix, time, dtime, cdsys, temperature, isEp, hdflag)
Calculate constituive matrix.
subroutine mat_c2d_shell(c, D, itype)
integer function getnlgeomflag(gauss)
Fetch the nlgeom flag of the material.
subroutine matlmatrix_shell(gauss, sectType, D, e1_hat, e2_hat, e3_hat, cg1, cg2, cg3, alpha, n_layer)
subroutine mat_c2d(cijkl, dij, itype)
Transfer rank 4 constituive matrix to rank 2 form.
subroutine stressupdate(gauss, sectType, strain, stress, cdsys, time, dtime, temp, tempn, hdflag)
Update strain and stress for elastic and hyperelastic materials.
This module provides functions for creep calculation.
Definition: creep.f90:6
subroutine update_iso_creep(matl, sectType, strain, stress, extval, plstrain, dtime, ttime, temp, hdflag)
This subroutine calculates stresses and creep status for an elastically isotropic material with isotr...
Definition: creep.f90:122
subroutine iso_creep(matl, sectType, stress, strain, extval, plstrain, dtime, ttime, stiffness, temp, hdflag)
This subroutine calculates stiffness for elastically isotropic materials with isotropic creep.
Definition: creep.f90:19
This module provides functions for hyperelastic calculation.
Definition: Hyperelastic.f90:6
subroutine calupdateelasticarrudaboyce(matl, sectType, dstrain, dstress)
This subroutine provides to update stress and strain for Arrude-Royce material.
subroutine calelasticarrudaboyce(matl, sectType, cijkl, strain)
This subroutine provides elastic tangent coefficient for Arruda-Boyce hyperelastic material.
subroutine calelasticmooneyrivlinaniso(matl, sectType, cijkl, strain, cdsys, hdflag)
This subroutine provides elastic tangent coefficient for anisotropic Mooney-Rivlin hyperelastic mater...
subroutine calupdateelasticmooneyrivlinaniso(matl, sectType, strain, stress, cdsys, hdflag)
This subroutine provides to update stress and strain for anisotropic Mooney-Rivlin material.
subroutine calelasticmooneyrivlin(matl, sectType, cijkl, strain, hdflag)
This subroutine provides elastic tangent coefficient for Mooney-Rivlin hyperelastic material.
subroutine calupdateelasticmooneyrivlin(matl, sectType, strain, stress, strain_energy, hdflag)
This subroutine provides to update stress and strain for Mooney-Rivlin material.
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 mooneyrivlin
Definition: material.f90:72
integer(kind=kint), parameter mooneyrivlin_aniso
Definition: material.f90:75
integer(kind=kint), parameter planestress
Definition: material.f90:85
integer(kind=kint), parameter m_spring_axial
Definition: material.f90:130
integer function getelastictype(mtype)
Get elastic type.
Definition: material.f90:307
character(len=dict_key_length) mc_spring
Definition: material.f90:148
integer(kind=kint), parameter d3
Definition: material.f90:84
integer(kind=kint), parameter planestrain
Definition: material.f90:86
integer(kind=kint), parameter elastic
Definition: material.f90:65
integer(kind=kint), parameter arrudaboyce
Definition: material.f90:73
integer(kind=kint), parameter shell
Definition: material.f90:88
integer(kind=kint), parameter norton
Definition: material.f90:78
character(len=dict_key_length) mc_dashpot
Definition: material.f90:149
integer(kind=kint), parameter axissymetric
Definition: material.f90:87
integer(kind=kint), parameter m_dashpot_dof
Definition: material.f90:131
integer(kind=kint), parameter userelastic
Definition: material.f90:67
integer(kind=kint), parameter neohooke
Definition: material.f90:71
integer(kind=kint), parameter usermaterial
Definition: material.f90:63
integer(kind=kint), parameter m_spring_dof
Definition: material.f90:129
logical function iselastic(mtype)
If it is an elastic material?
Definition: material.f90:352
integer(kind=kint), parameter userhyperelastic
Definition: material.f90:74
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:379
logical function iselastoplastic(mtype)
If it is an elastoplastic material?
Definition: material.f90:361
This modules defines a structure to record history dependent parameter in static analysis.
Definition: mechgauss.f90:6
This module provides interface for elastic or hyperelastic calculation.
Definition: uelastic.f90:7
subroutine uelasticmatrix(matl, strain, D)
This subroutine calculates constitutive relation.
Definition: uelastic.f90:13
subroutine uelasticupdate(matl, strain, stress)
This subroutine calculate updated strain and stress.
Definition: uelastic.f90:41
This subroutine read in used-defined material properties tangent.
Definition: umat.f90:7
subroutine uupdate(mname, matl, strain, stress, fstat, dtime, ttime, temperature)
This subroutine calculate strain and stress increment.
Definition: umat.f90:31
subroutine umatlmatrix(mname, matl, strain, stress, fstat, D, dtime, ttime, temperature)
This subroutine calculates constitutive matrix.
Definition: umat.f90:17
This module provides functions for viscoelastic calculation.
Definition: Viscoelastic.f90:6
subroutine updateviscoelastic(matl, sectType, eps, sig, vsig, dt, temp, tempn)
This subroutine provides to update stress for viscoelastic material.
subroutine calviscoelasticmatrix(matl, sectType, dt, D, temp)
This subroutine calculates tangent moduli for isotropic viscoelastic material.
Structure to manage all material related data.
Definition: material.f90:167
All data should be recorded in every quadrature points.
Definition: mechgauss.f90:13