FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
m_step.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_step
7  use hecmw
9 
10  implicit none
11 
12  integer, parameter :: stepstatic = 1
13  integer, parameter :: stepvisco = 2
14  integer, parameter :: stepfixedinc = 1
15  integer, parameter :: stepautoinc = 2
16  integer, parameter :: stepampramp = 1 ! prescribed disp. ramped over the step (default for static)
17  integer, parameter :: stepampstep = 2 ! prescribed disp. applied in full at step start (default for visco)
18 
19  ! statistics of newton iteration
20  integer(kind=kint),parameter :: knstmaxit = 1 ! maximum number of newton iteration
21  integer(kind=kint),parameter :: knstsumit = 2 ! total number of newton iteration
22  integer(kind=kint),parameter :: knstciter = 3 ! number of contact iteration
23  integer(kind=kint),parameter :: knstdresn = 4 ! reason of not to converged
24 
26  type step_info
27  integer :: solution
28  integer :: inc_type
29  character( len=80 ) :: control
30  character( len=80 ) :: convcontrol
32  real(kind=kreal) :: converg
33  real(kind=kreal) :: converg_lag
34  real(kind=kreal) :: converg_ddisp
35  real(kind=kreal) :: maxres
36 
37  integer :: num_substep
38  integer :: max_iter
39  integer :: max_contiter
40  integer :: amp_id
41  integer :: amp_default_type
42  real(kind=kreal) :: initdt
43  real(kind=kreal) :: elapsetime
44  real(kind=kreal) :: mindt
45  real(kind=kreal) :: maxdt
46  real(kind=kreal) :: starttime
47  integer, pointer :: boundary(:)=>null()
48  integer, pointer :: load(:)=>null()
49  integer, pointer :: contact(:)=>null()
50  integer, pointer :: elemactivation(:)=>null()
51  integer :: timepoint_id
52  integer :: aincparam_id
53  end type
54 
56  character(HECMW_NAME_LEN) :: name
57  real(kind=kreal) :: ainc_rs
58  real(kind=kreal) :: ainc_rl
59  integer( kind=kint ) :: nrbound_s(10)
60  integer( kind=kint ) :: nrbound_l(10)
61  integer( kind=kint ) :: nrtimes_s
62  integer( kind=kint ) :: nrtimes_l
63  real(kind=kreal) :: ainc_rc
64  integer( kind=kint ) :: cbbound
65  end type
66 
67 contains
68 
70  subroutine init_stepinfo( stepinfo )
71  type( step_info ), intent(out) :: stepinfo
72  stepinfo%solution = stepstatic
73  stepinfo%inc_type = stepfixedinc
74  stepinfo%num_substep = 1
75  stepinfo%max_iter = 50
76  stepinfo%max_contiter = 10
77  stepinfo%amp_id = -1
78  stepinfo%amp_default_type = stepampramp
79  stepinfo%initdt = 1.d0
80  stepinfo%mindt = 1.d-4
81  stepinfo%maxdt = 1.d0
82  stepinfo%elapsetime = 1.d0
83  stepinfo%starttime = 0.d0
84  stepinfo%converg = 1.d-3
85  stepinfo%converg_lag = 1.d-4
86  stepinfo%converg_ddisp = 1.d-8
87  stepinfo%maxres = 1.d+10
88  stepinfo%timepoint_id = 0
89  stepinfo%AincParam_id = 0
90  end subroutine
91 
92  subroutine setup_stepinfo_starttime( stepinfos )
93  type( step_info ), pointer, intent(inout) :: stepinfos(:)
94 
95  integer :: i
96 
97  stepinfos(1)%starttime = 0.d0
98  do i=1,size(stepinfos)-1
99  stepinfos(i+1)%starttime = stepinfos(i)%starttime + stepinfos(i)%elapsetime
100  end do
101  end subroutine
102 
104  logical function isboundaryactive( bnd, stepinfo )
105  integer, intent(in) :: bnd
106  type( step_info ), intent(in) :: stepinfo
107  isboundaryactive = .false.
108  if( .not. associated( stepinfo%Boundary ) ) return
109  if( any( stepinfo%Boundary== bnd ) ) isboundaryactive = .true.
110  end function
111 
113  logical function isloadactive( bnd, stepinfo )
114  integer, intent(in) :: bnd
115  type( step_info ), intent(in) :: stepinfo
116  isloadactive = .false.
117  if( .not. associated( stepinfo%Load ) ) return
118  if( any( stepinfo%Load == bnd ) ) isloadactive = .true.
119  end function
120 
122  logical function iscontactactive( bnd, stepinfo )
123  integer, intent(in) :: bnd
124  type( step_info ), intent(in) :: stepinfo
125  iscontactactive = .false.
126  if( .not. associated( stepinfo%Contact ) ) return
127  if( any( stepinfo%Contact== bnd ) ) iscontactactive = .true.
128  end function
129 
131  logical function iselemactivationactive( bnd, stepinfo )
132  integer, intent(in) :: bnd
133  type( step_info ), intent(in) :: stepinfo
134  iselemactivationactive = .false.
135  if( .not. associated( stepinfo%ElemActivation ) ) return
136  if( any( stepinfo%ElemActivation== bnd ) ) iselemactivationactive = .true.
137  end function
138 
140  subroutine free_stepinfo( step )
141  type(step_info), intent(inout) :: step
142  if( associated( step%Boundary ) ) deallocate( step%Boundary )
143  if( associated( step%Load ) ) deallocate( step%Load )
144  if( associated( step%Contact ) ) deallocate( step%Contact )
145  if( associated( step%ElemActivation ) ) deallocate( step%ElemActivation )
146  end subroutine
147 
149  subroutine fstr_print_steps( nfile, steps )
150  integer, intent(in) :: nfile
151  type(step_info), intent(in) :: steps(:)
152  integer :: i, j, nstep, nbc
153  nstep = size(steps)
154 
155  write( nfile, * ) "-----Information of steps:",nstep
156 
157  do i=1,nstep
158  write( nfile, * ) " -----Step:",i
159  write(nfile,*) steps(i)%solution, steps(i)%elapsetime, steps(i)%converg, &
160  steps(i)%num_substep, steps(i)%max_iter
161  if( associated( steps(i)%Boundary ) ) then
162  nbc = size( steps(i)%Boundary )
163  write(nfile,*) " Boundary conditions"
164  write(nfile,*) ( steps(i)%Boundary(j),j=1,nbc )
165  endif
166  if( associated( steps(i)%Load ) ) then
167  nbc = size( steps(i)%Load )
168  write(nfile,*) " External load conditions"
169  write(nfile,*) ( steps(i)%Load(j),j=1,nbc )
170  endif
171  if( associated( steps(i)%Contact ) ) then
172  nbc = size( steps(i)%Contact )
173  write(nfile,*) " Contact conditions"
174  write(nfile,*) ( steps(i)%Contact(j),j=1,nbc )
175  endif
176  if( associated( steps(i)%ElemActivation ) ) then
177  nbc = size( steps(i)%ElemActivation )
178  write(nfile,*) " ElemActivation conditions"
179  write(nfile,*) ( steps(i)%ElemActivation(j),j=1,nbc )
180  endif
181  enddo
182  end subroutine
183 
185  subroutine init_aincparam( aincparam )
186  type( tparamautoinc ), intent(out) :: aincparam
187 
188  aincparam%name = ''
189  aincparam%ainc_Rs = 0.5d0
190  aincparam%ainc_Rl = 1.75d0
191  aincparam%NRbound_s = 0
192  aincparam%NRbound_s(knstmaxit) = 20
193  aincparam%NRbound_s(knstsumit) = 100
194  aincparam%NRbound_s(knstciter) = 10
195  aincparam%NRbound_l = 0
196  aincparam%NRbound_l(knstmaxit) = 10
197  aincparam%NRbound_l(knstsumit) = 50
198  aincparam%NRbound_l(knstciter) = 5
199  aincparam%NRtimes_s = 2
200  aincparam%NRtimes_l = 2
201  aincparam%ainc_Rc = 0.25d0
202  aincparam%CBbound = 5
203  end subroutine
204 
205 end module
Definition: hecmw.f90:6
This module manages step information.
Definition: m_step.f90:6
logical function iscontactactive(bnd, stepinfo)
Is contact condition in this step active.
Definition: m_step.f90:123
subroutine fstr_print_steps(nfile, steps)
Print out step control.
Definition: m_step.f90:150
subroutine free_stepinfo(step)
Finalizer.
Definition: m_step.f90:141
integer, parameter stepampstep
Definition: m_step.f90:17
subroutine init_stepinfo(stepinfo)
Initializer.
Definition: m_step.f90:71
logical function iselemactivationactive(bnd, stepinfo)
Is elemact condition in this step active.
Definition: m_step.f90:132
integer, parameter stepvisco
Definition: m_step.f90:13
integer, parameter stepfixedinc
Definition: m_step.f90:14
subroutine init_aincparam(aincparam)
Initializer.
Definition: m_step.f90:186
logical function isboundaryactive(bnd, stepinfo)
Is boundary condition in this step active.
Definition: m_step.f90:105
integer, parameter stepampramp
Definition: m_step.f90:16
integer(kind=kint), parameter knstmaxit
Definition: m_step.f90:20
integer, parameter stepautoinc
Definition: m_step.f90:15
integer(kind=kint), parameter knstdresn
Definition: m_step.f90:23
integer(kind=kint), parameter knstsumit
Definition: m_step.f90:21
integer(kind=kint), parameter knstciter
Definition: m_step.f90:22
subroutine setup_stepinfo_starttime(stepinfos)
Definition: m_step.f90:93
logical function isloadactive(bnd, stepinfo)
Is external load in this step active.
Definition: m_step.f90:114
integer, parameter stepstatic
Definition: m_step.f90:12
Step control such as active boundary condition, convergent condition etc.
Definition: m_step.f90:26