FrontISTR  6.0.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)
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 
20  integer(kind=kint) :: grpid, ndof, ig0, ig, ityp, iS0, iE0, ik, in, idx, jj_n_amp
21  real(kind=kreal) :: fval, factor, ctime
22 
23  ndof = hecmat%NDOF
24  do ig0= 1, fstrsolid%SPRING_ngrp_tot
25  grpid = fstrsolid%SPRING_ngrp_GRPID(ig0)
26  if( .not. fstr_isloadactive( fstrsolid, grpid, cstep ) ) cycle
27  ig= fstrsolid%SPRING_ngrp_ID(ig0)
28  ityp= fstrsolid%SPRING_ngrp_DOF(ig0)
29  fval= fstrsolid%SPRING_ngrp_val(ig0)
30  jj_n_amp = fstrsolid%SPRING_ngrp_amp(ig0)
31  if (jj_n_amp <= 0) then ! Amplitude not defined
32  factor = fstrsolid%FACTOR(2)
33  if( fval < 0.d0 ) fval = -fval*(1.d0-factor)
34  else
36  factor = 1.d0
37  call fstr_get_amplitude(hecmesh, fstrsolid, cstep, jj_n_amp, ctime, factor)
38  if( fval < 0.d0 )then
39  fval = -fval*(1.d0-factor)
40  else
41  fval = fval*factor
42  end if
43  endif
44 
45  is0= hecmesh%node_group%grp_index(ig-1) + 1
46  ie0= hecmesh%node_group%grp_index(ig )
47  do ik= is0, ie0
48  in = hecmesh%node_group%grp_item(ik)
49  idx = ndof**2 * (in - 1) + ndof * (ityp - 1) + ityp
50  hecmat%D(idx) = hecmat%D(idx) + fval
51  enddo
52  enddo
53 
54  end subroutine fstr_addspring
55 
56  subroutine fstr_update_ndforce_spring( cstep, hecMESH, fstrSOLID, B )
57  use m_fstr
58  integer(kind=kint), intent(in) :: cstep
59  type (hecmwST_local_mesh),intent(in) :: hecMESH
60  type (fstr_solid), intent(in) :: fstrSOLID
61  real(kind=kreal), intent(inout) :: b(:)
62  ! Local variables
63  integer(kind=kint) ndof,ig0,ig,ityp,iS0,iE0,ik,in,idx,jj_n_amp
64  integer(kind=kint) :: grpid, incremental
65  real(kind=kreal) :: fval, factor, ctime
66 
67  ndof = hecmesh%n_dof
68  do ig0= 1, fstrsolid%SPRING_ngrp_tot
69  grpid = fstrsolid%SPRING_ngrp_GRPID(ig0)
70  if( .not. fstr_isloadactive( fstrsolid, grpid, cstep ) ) cycle
71  incremental = fstrsolid%SPRING_incremental(ig0)
72  ig= fstrsolid%SPRING_ngrp_ID(ig0)
73  ityp= fstrsolid%SPRING_ngrp_DOF(ig0)
74  fval= fstrsolid%SPRING_ngrp_val(ig0)
75  jj_n_amp = fstrsolid%SPRING_ngrp_amp(ig0)
76  if (jj_n_amp <= 0) then ! Amplitude not defined
77  factor = fstrsolid%FACTOR(2)
78  if( fval < 0.d0 ) fval = -fval*(1.d0-factor)
79  else
81  factor = 1.d0
82  call fstr_get_amplitude(hecmesh, fstrsolid, cstep, jj_n_amp, ctime, factor)
83  if( fval < 0.d0 )then
84  fval = -fval*(1.d0-factor)
85  else
86  fval = fval*factor
87  end if
88  endif
89 
90  is0= hecmesh%node_group%grp_index(ig-1) + 1
91  ie0= hecmesh%node_group%grp_index(ig )
92  do ik= is0, ie0
93  in = hecmesh%node_group%grp_item(ik)
94  idx = ndof * (in - 1) + ityp
95  ! incremental=1: resist the displacement increment of the current step only
96  b(idx) = b(idx) - fval * ( fstrsolid%dunode( idx ) + fstrsolid%unode( idx ) * (1-incremental) )
97  enddo
98  enddo
99  end subroutine fstr_update_ndforce_spring
100 
101 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:57
subroutine fstr_addspring(cstep, hecMESH, hecMAT, fstrSOLID)
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:1261
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:1412
This modules just summarizes all modules used in static analysis.
Definition: static_LIB.f90:6