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