FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
fstr_Spring.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 
9  implicit none
10 contains
11 
12  subroutine fstr_addspring(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
13  use m_fstr
14  use m_static_lib
15  integer, intent(in) :: cstep
16  type (hecmwST_matrix),intent(inout) :: hecMAT
17  type (hecmwST_local_mesh),intent(in) :: hecMESH
18  type (fstr_solid),intent(inout) :: fstrSOLID
19  type (fstr_param),intent(inout) :: fstrPARAM
20 
21  integer(kind=kint) :: grpid, ndof, ig0, ig, ityp, iS0, iE0, ik, in, idx, num, jj_n_amp
22  real(kind=kreal) :: fval, factor, ctime
23 
24  ndof = hecmat%NDOF
25  do ig0= 1, fstrsolid%SPRING_ngrp_tot
26  grpid = fstrsolid%SPRING_ngrp_GRPID(ig0)
27  if( .not. fstr_isloadactive( fstrsolid, grpid, cstep ) ) cycle
28  ig= fstrsolid%SPRING_ngrp_ID(ig0)
29  ityp= fstrsolid%SPRING_ngrp_DOF(ig0)
30  fval= fstrsolid%SPRING_ngrp_val(ig0)
31  jj_n_amp = fstrsolid%SPRING_ngrp_amp(ig0)
32  if (jj_n_amp <= 0) then ! Amplitude not defined
33  factor = fstrsolid%FACTOR(2)
34  if( fval < 0.d0 ) fval = -fval*(1.d0-factor)
35  else
37  factor = 1.d0
38  call fstr_get_amplitude(hecmesh, fstrsolid, cstep, jj_n_amp, ctime, factor)
39  if( fval < 0.d0 )then
40  fval = -fval*(1.d0-factor)
41  else
42  fval = fval*factor
43  end if
44  endif
45 
46  is0= hecmesh%node_group%grp_index(ig-1) + 1
47  ie0= hecmesh%node_group%grp_index(ig )
48  do ik= is0, ie0
49  in = hecmesh%node_group%grp_item(ik)
50  idx = ndof**2 * (in - 1) + ndof * (ityp - 1) + ityp
51  hecmat%D(idx) = hecmat%D(idx) + fval
52  enddo
53  enddo
54 
55  end subroutine fstr_addspring
56 
57  subroutine fstr_update_ndforce_spring( cstep, hecMESH, fstrSOLID, B )
58  use m_fstr
59  integer(kind=kint), intent(in) :: cstep
60  type (hecmwST_local_mesh),intent(in) :: hecMESH
61  type (fstr_solid), intent(in) :: fstrSOLID
62  real(kind=kreal), intent(inout) :: b(:)
63  ! Local variables
64  integer(kind=kint) ndof,ig0,ig,ityp,iS0,iE0,ik,in,idx,num,jj_n_amp
65  integer(kind=kint) :: grpid, incremental
66  real(kind=kreal) :: fval, factor, ctime
67 
68  ndof = hecmesh%n_dof
69  do ig0= 1, fstrsolid%SPRING_ngrp_tot
70  grpid = fstrsolid%SPRING_ngrp_GRPID(ig0)
71  if( .not. fstr_isloadactive( fstrsolid, grpid, cstep ) ) cycle
72  incremental = fstrsolid%SPRING_incremental(ig0)
73  ig= fstrsolid%SPRING_ngrp_ID(ig0)
74  ityp= fstrsolid%SPRING_ngrp_DOF(ig0)
75  fval= fstrsolid%SPRING_ngrp_val(ig0)
76  jj_n_amp = fstrsolid%SPRING_ngrp_amp(ig0)
77  if (jj_n_amp <= 0) then ! Amplitude not defined
78  factor = fstrsolid%FACTOR(2)
79  if( fval < 0.d0 ) fval = -fval*(1.d0-factor)
80  else
82  factor = 1.d0
83  call fstr_get_amplitude(hecmesh, fstrsolid, cstep, jj_n_amp, ctime, factor)
84  if( fval < 0.d0 )then
85  fval = -fval*(1.d0-factor)
86  else
87  fval = fval*factor
88  end if
89  endif
90 
91  is0= hecmesh%node_group%grp_index(ig-1) + 1
92  ie0= hecmesh%node_group%grp_index(ig )
93  do ik= is0, ie0
94  in = hecmesh%node_group%grp_item(ik)
95  idx = ndof * (in - 1) + ityp
96  ! incremental=1: resist the displacement increment of the current step only
97  b(idx) = b(idx) - fval * ( fstrsolid%dunode( idx ) + fstrsolid%unode( idx ) * (1-incremental) )
98  enddo
99  enddo
100  end subroutine fstr_update_ndforce_spring
101 
102 end module m_fstr_spring
This module provides functions to deal with spring force.
Definition: fstr_Spring.f90:7
subroutine fstr_update_ndforce_spring(cstep, hecMESH, fstrSOLID, B)
Definition: fstr_Spring.f90:58
subroutine fstr_addspring(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
Definition: fstr_Spring.f90:13
This module provides functions to deal with time and increment of stress analysis.
real(kind=kreal) function fstr_get_timeinc()
real(kind=kreal) function fstr_get_time()
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
logical function fstr_isloadactive(fstrSOLID, nbc, cstep)
Definition: m_fstr.F90:1096
subroutine fstr_get_amplitude(hecMESH, fstrSOLID, cstep, jj_n_amp, time, value)
Evaluate the amplitude-scaled target value a(t) for static analysis.
Definition: m_fstr.F90:1248
This modules just summarizes all modules used in static analysis.
Definition: static_LIB.f90:6