FrontISTR  6.0.0
Large-scale structural analysis program with finit element method
fstr_Residual.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 
8  use hecmw
10  implicit none
11 
12  public :: fstr_update_ndforce
13  public :: fstr_update_ndforce_mpc
14  public :: fstr_update_ndforce_spc
15  public :: fstr_update_reaction_spc
17  public :: fstr_get_potential
18 
19 contains
20 
21  !C---------------------------------------------------------------------*
22  subroutine fstr_update_ndforce(cstep,hecMESH,hecMAT,fstrSOLID,conMAT)
23  !C---------------------------------------------------------------------*
29  use m_fstr
30  use muload
31  use m_fstr_spring
32  integer(kind=kint), intent(in) :: cstep
33  type(hecmwst_local_mesh), intent(in) :: hecmesh
34  type(hecmwst_matrix), intent(inout) :: hecmat
35  type(fstr_solid), intent(inout) :: fstrsolid
36  type(hecmwst_matrix), intent(inout), optional :: conmat
37  ! Local variables
38  integer(kind=kint) :: ndof, idof
39  real(kind=kreal) :: factor
40 
41  factor = fstrsolid%factor(2)
42 
43  ! Set residual load
44  do idof=1, hecmesh%n_node* hecmesh%n_dof
45  hecmat%B(idof)=fstrsolid%GL(idof)-fstrsolid%QFORCE(idof)
46  end do
47  ndof = hecmat%NDOF
48 
49  call fstr_update_ndforce_spring( cstep, hecmesh, fstrsolid, hecmat%B )
50 
51  ! Consider Uload
52  call uresidual( cstep, factor, hecmat%B )
53 
54  ! Consider EQUATION condition
55  call fstr_update_ndforce_mpc( hecmesh, hecmat%B )
56 
57  ! Consider SPC condition
58  call fstr_update_ndforce_spc( cstep, hecmesh, fstrsolid, hecmat%B )
59  if(present(conmat)) call fstr_update_ndforce_spc( cstep, hecmesh, fstrsolid, conmat%B )
60 
61  !
62  call hecmw_update_r(hecmesh,hecmat%B,hecmesh%n_node, ndof)
63  end subroutine fstr_update_ndforce
64 
65  subroutine fstr_update_ndforce_mpc( hecMESH, B )
66  use m_fstr
67  type(hecmwst_local_mesh), intent(in) :: hecmesh
68  real(kind=kreal), intent(inout) :: b(:)
69  ! Local variables
70  integer(kind=kint) ndof, ig0, is0, ie0, ik, in, idof
71  real(kind=kreal) :: rhs, lambda
72 
73  ndof = hecmesh%n_dof
74  outer: do ig0=1,hecmesh%mpc%n_mpc
75  is0= hecmesh%mpc%mpc_index(ig0-1)+1
76  ie0= hecmesh%mpc%mpc_index(ig0)
77  do ik= is0, ie0
78  if (hecmesh%mpc%mpc_dof(ik) > ndof) cycle outer
79  enddo
80  ! Suppose the lagrange multiplier= first dof of first node
81  in = hecmesh%mpc%mpc_item(is0)
82  idof = hecmesh%mpc%mpc_dof(is0)
83  rhs = hecmesh%mpc%mpc_val(is0)
84  lambda = b(ndof*(in-1)+idof)/rhs
85  ! update nodal residual
86  do ik= is0, ie0
87  in = hecmesh%mpc%mpc_item(ik)
88  idof = hecmesh%mpc%mpc_dof(ik)
89  rhs = hecmesh%mpc%mpc_val(ik)
90  b(ndof*(in-1)+idof) = b(ndof*(in-1)+idof) - rhs*lambda
91  enddo
92  enddo outer
93  end subroutine fstr_update_ndforce_mpc
94 
95  subroutine fstr_update_ndforce_spc( cstep, hecMESH, fstrSOLID, B )
96  use m_fstr
97  integer(kind=kint), intent(in) :: cstep
98  type(hecmwst_local_mesh), intent(in) :: hecmesh
99  type(fstr_solid), intent(in) :: fstrsolid
100  real(kind=kreal), intent(inout) :: b(:)
101  ! Local variables
102  integer(kind=kint) ndof, ig0, ig, ityp, is0, ie0, ik, in, idof1, idof2, idof
103  integer(kind=kint) :: grpid
104 
105  ndof = hecmesh%n_dof
106 
107  ! Clear RHS at constrained DOFs (SPC)
108  do ig0= 1, fstrsolid%BOUNDARY_ngrp_tot
109  grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
110  if( .not. fstr_isboundaryactive( fstrsolid, grpid, cstep ) ) cycle
111  ig= fstrsolid%BOUNDARY_ngrp_ID(ig0)
112  ityp= fstrsolid%BOUNDARY_ngrp_type(ig0)
113  is0= hecmesh%node_group%grp_index(ig-1) + 1
114  ie0= hecmesh%node_group%grp_index(ig )
115  do ik= is0, ie0
116  in = hecmesh%node_group%grp_item(ik)
117  idof1 = ityp/10
118  idof2 = ityp - idof1*10
119  if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 ) then
120  idof1 = 1
121  idof2 = ndof
122  end if
123  do idof=idof1,idof2
124  b( ndof*(in-1) + idof ) = 0.d0
125  enddo
126  enddo
127  enddo
128  end subroutine fstr_update_ndforce_spc
129 
135  subroutine fstr_update_reaction_spc( cstep, hecMESH, fstrSOLID )
136  use m_fstr
137  integer(kind=kint), intent(in) :: cstep
138  type(hecmwst_local_mesh), intent(in) :: hecmesh
139  type(fstr_solid), intent(in) :: fstrsolid
140  ! Local variables
141  integer(kind=kint) :: ndof, ig0, ig, ityp, is0, ie0, ik, in, idof1, idof2, idof
142  integer(kind=kint) :: grpid
143 
144  ndof = hecmesh%n_dof
145  fstrsolid%REACTION = 0.d0
146 
147  ! displacement boundary
148  do ig0= 1, fstrsolid%BOUNDARY_ngrp_tot
149  grpid = fstrsolid%BOUNDARY_ngrp_GRPID(ig0)
150  if( .not. fstr_isboundaryactive( fstrsolid, grpid, cstep ) ) cycle
151  ig= fstrsolid%BOUNDARY_ngrp_ID(ig0)
152  ityp= fstrsolid%BOUNDARY_ngrp_type(ig0)
153  is0= hecmesh%node_group%grp_index(ig-1) + 1
154  ie0= hecmesh%node_group%grp_index(ig )
155  do ik= is0, ie0
156  in = hecmesh%node_group%grp_item(ik)
157  idof1 = ityp/10
158  idof2 = ityp - idof1*10
159  if( fstrsolid%BOUNDARY_ngrp_rotID(ig0) > 0 ) then
160  idof1 = 1
161  idof2 = ndof
162  end if
163  do idof=idof1,idof2
164  fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
165  !count embed force as reaction force
166  if( associated(fstrsolid%EMBED_NFORCE) ) fstrsolid%REACTION(ndof*(in-1)+idof) = &
167  & fstrsolid%QFORCE(ndof*(in-1)+idof) - fstrsolid%EMBED_NFORCE(ndof*(in-1)+idof)
168  enddo
169  enddo
170  enddo
171 
172  ! velocity boundary (dynamic only; following type constrains the DOF)
173  if( fstrsolid%VELOCITY_type /= kbcinitial ) then
174  do ig0= 1, fstrsolid%VELOCITY_ngrp_tot
175  grpid = fstrsolid%VELOCITY_ngrp_GRPID(ig0)
176  if( .not. fstr_isboundaryactive( fstrsolid, grpid, cstep ) ) cycle
177  ig= fstrsolid%VELOCITY_ngrp_ID(ig0)
178  ityp= fstrsolid%VELOCITY_ngrp_type(ig0)
179  is0= hecmesh%node_group%grp_index(ig-1) + 1
180  ie0= hecmesh%node_group%grp_index(ig )
181  idof1 = ityp/10
182  idof2 = ityp - idof1*10
183  do ik= is0, ie0
184  in = hecmesh%node_group%grp_item(ik)
185  do idof=idof1,idof2
186  fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
187  enddo
188  enddo
189  enddo
190  endif
191 
192  ! acceleration boundary (dynamic only; following type constrains the DOF)
193  if( fstrsolid%ACCELERATION_type /= kbcinitial ) then
194  do ig0= 1, fstrsolid%ACCELERATION_ngrp_tot
195  grpid = fstrsolid%ACCELERATION_ngrp_GRPID(ig0)
196  if( .not. fstr_isboundaryactive( fstrsolid, grpid, cstep ) ) cycle
197  ig= fstrsolid%ACCELERATION_ngrp_ID(ig0)
198  ityp= fstrsolid%ACCELERATION_ngrp_type(ig0)
199  is0= hecmesh%node_group%grp_index(ig-1) + 1
200  ie0= hecmesh%node_group%grp_index(ig )
201  idof1 = ityp/10
202  idof2 = ityp - idof1*10
203  do ik= is0, ie0
204  in = hecmesh%node_group%grp_item(ik)
205  do idof=idof1,idof2
206  fstrsolid%REACTION(ndof*(in-1)+idof) = fstrsolid%QFORCE(ndof*(in-1)+idof)
207  enddo
208  enddo
209  enddo
210  endif
211  end subroutine fstr_update_reaction_spc
212 
213 
215  subroutine fstr_calc_residual_vector(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
216  use m_fstr_update
217  use m_fstr_ass_load
218  implicit none
219  integer, intent(in) :: cstep
220  type (hecmwST_local_mesh) :: hecMESH
221  type (hecmwST_matrix) :: hecMAT
222  type (fstr_solid) :: fstrSOLID
223  real(kind=kreal), intent(in) :: ctime
224  real(kind=kreal), intent(in) :: dtime
225  type (fstr_param) :: fstrPARAM
226  real(kind=kreal), intent(in) :: tincr
227  integer(kind=kint) :: iter
228 
229  ! ----- update the strain, stress, and internal force
230  call fstr_updatenewton(hecmesh, hecmat, fstrsolid, fstrparam, ctime, tincr, iter)
231 
232  ! ----- Set residual
233  if( fstrsolid%DLOAD_follow /= 0 .or. fstrsolid%CLOAD_ngrp_rot /= 0 ) &
234  & call fstr_ass_load(cstep, ctime+dtime, hecmesh, hecmat, fstrsolid, fstrparam )
235 
236 
237  if( fstrsolid%elemact%ELEMACT_egrp_tot > 0 ) then
238  call fstr_update_elemact_solid_by_value( hecmesh, fstrsolid, cstep, ctime+dtime )
239  endif
240 
241  call fstr_update_ndforce(cstep, hecmesh, hecmat, fstrsolid)
242 
243  end subroutine fstr_calc_residual_vector
244 
246  subroutine fstr_calc_residual_vector_with_x(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
249  implicit none
250  integer, intent(in) :: cstep
251  type (hecmwST_local_mesh) :: hecMESH
252  type (hecmwST_matrix) :: hecMAT
253  type (fstr_solid) :: fstrSOLID
254  real(kind=kreal), intent(in) :: ctime
255  real(kind=kreal), intent(in) :: dtime
256  type (fstr_param) :: fstrPARAM
257  real(kind=kreal), intent(in) :: tincr
258  integer(kind=kint) :: iter
259 
260  integer :: i
261  real(kind=kreal) :: dunode_bak(hecmat%ndof*hecmesh%n_node)
262  real(kind=kreal), allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
263 
264  do i=1, hecmat%ndof*hecmesh%n_node
265  dunode_bak(i) = fstrsolid%dunode(i)
266  enddo
267  if( associated(fstrsolid%shell_dtriad) ) then
268  allocate(shell_dtriad_bak(size(fstrsolid%shell_dtriad)))
269  shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
270  endif
271  if( associated(fstrsolid%shell_ddrill) ) then
272  allocate(shell_ddrill_bak(size(fstrsolid%shell_ddrill)))
273  shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
274  endif
275  call fstr_apply_solution_increment( hecmesh, fstrsolid, hecmat%ndof, hecmat%X )
276  call fstr_calc_residual_vector(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam)
277  do i=1, hecmat%ndof*hecmesh%n_node
278  fstrsolid%dunode(i) = dunode_bak(i)
279  enddo
280  if( allocated(shell_dtriad_bak) ) then
281  fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
282  deallocate(shell_dtriad_bak)
283  endif
284  if( allocated(shell_ddrill_bak) ) then
285  fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
286  deallocate(shell_ddrill_bak)
287  endif
288  end subroutine fstr_calc_residual_vector_with_x
289 
291  real(kind=kreal) function fstr_get_energy( force, displacement, hecMESH )
292  use m_fstr
293  real(kind=kreal), intent(in) :: force(:), displacement(:)
294  type(hecmwst_local_mesh), intent(in) :: hecmesh
295  integer :: ndof
296  ndof = hecmesh%n_dof
297  call hecmw_innerproduct_r(hecmesh, ndof, force, displacement, fstr_get_energy)
298  end function
299 
304  subroutine fstr_assemble_residual_contact(hecMAT, hecLagMAT, conMAT, hecMESH, resid_vec, nresid)
305  use m_fstr
306  implicit none
307  type(hecmwst_matrix), intent(in) :: hecmat
308  type(hecmwst_matrix_lagrange), intent(in) :: heclagmat
309  type(hecmwst_matrix), intent(in) :: conmat
310  type(hecmwst_local_mesh), intent(in) :: hecmesh
311  real(kind=kreal), intent(out) :: resid_vec(:)
312  integer(kind=kint), intent(out) :: nresid
313 
314  integer(kind=kint) :: i, ndof, nndof, npndof, num_lagrange
315 
316  ndof = conmat%ndof
317  nndof = conmat%N * ndof
318  npndof = conmat%NP * ndof
319  num_lagrange = heclagmat%num_lagrange
320  nresid = nndof + num_lagrange
321 
322  ! Copy conMAT%B and assemble across MPI
323  do i = 1, npndof
324  resid_vec(i) = conmat%B(i)
325  enddo
326  call hecmw_assemble_r(hecmesh, resid_vec, conmat%NP, conmat%NDOF)
327 
328  ! Add hecMAT%B (node DOFs only)
329  do i = 1, nndof
330  resid_vec(i) = resid_vec(i) + hecmat%B(i)
331  enddo
332 
333  ! Copy Lagrange multiplier residual
334  do i = 1, num_lagrange
335  resid_vec(nndof + i) = conmat%B(npndof + i)
336  enddo
337 
338  end subroutine fstr_assemble_residual_contact
339 
340  !C---------------------------------------------------------------------*
341  function fstr_get_potential(cstep,hecMESH,hecMAT,fstrSOLID,ptype) result(potential)
342  use m_fstr
343  use muload
344  use m_fstr_spring
345  integer(kind=kint), intent(in) :: cstep
346  type(hecmwst_local_mesh), intent(in) :: hecmesh
347  type(hecmwst_matrix), intent(inout) :: hecmat
348  type(fstr_solid), intent(inout) :: fstrsolid
349  integer(kind=kint), intent(in) :: ptype
350  real(kind=kreal) :: potential
351  ! Local variables
352  integer(kind=kint) :: ndof, i, icel, icel0, ig
353  real(kind=kreal), allocatable :: totload(:)
354  real(kind=kreal) :: factor
355  real(kind=kreal) :: extenal_work, internal_work
356 
357  ndof = hecmat%NDOF
358  factor = fstrsolid%factor(2)
359  potential = 0.d0
360 
361  allocate(totload(ndof*hecmesh%n_node))
362 
363  ! Set external load
364  do i=1,ndof*hecmesh%n_node
365  totload(i) = 0.5d0*(fstrsolid%GL(i)+fstrsolid%GL0(i))
366  end do
367  ! Consiter Spring
368  call fstr_update_ndforce_spring( cstep, hecmesh, fstrsolid, totload )
369  ! Consider Uload
370  call uresidual( cstep, factor, totload )
371  ! Consider EQUATION condition
372  call fstr_update_ndforce_mpc( hecmesh, totload )
373 
374  if( ptype == 1 ) then
375  ! calc internal work
376  internal_work = 0.d0
377  do icel0=1,hecmesh%ne_internal
378  icel=hecmesh%elem_internal_list(icel0)
379  do ig=1,size(fstrsolid%elements(icel)%gausses)
380  internal_work = internal_work + fstrsolid%elements(icel)%gausses(ig)%strain_energy
381  enddo
382  enddo
383  call hecmw_allreduce_r1(hecmesh, internal_work, hecmw_sum)
384  ! calc external work
385  call hecmw_innerproduct_r(hecmesh,ndof,totload,fstrsolid%dunode,extenal_work)
386  potential = internal_work - extenal_work
387  else if( ptype == 2 ) then ! multiply internal force with displacement
388  ! calc internal work
389  call hecmw_innerproduct_r(hecmesh,ndof,0.5d0*(fstrsolid%QFORCE+fstrsolid%QFORCE_bak),fstrsolid%dunode,internal_work)
390  ! calc external work
391  call hecmw_innerproduct_r(hecmesh,ndof,totload,fstrsolid%dunode,extenal_work)
392  potential = internal_work - extenal_work
393  else if( ptype == 3 ) then ! norm of residual
394  ! Consider internal force
395  totload(:) = fstrsolid%QFORCE(:) - totload(:)
396  ! Consider SPC condition
397  call fstr_update_ndforce_spc( cstep, hecmesh, fstrsolid, totload )
398  ! calc norm of residual
399  call hecmw_innerproduct_r(hecmesh,ndof,totload,totload,potential)
400  potential = dsqrt(potential)
401  else
402  stop "ptype error in fstr_get_potential"
403  endif
404  !write(IMSG,*) "internal_work,extenal_work",internal_work,extenal_work
405  end function fstr_get_potential
406 
407  function fstr_get_potential_with_x(cstep,hecMESH,hecMAT,fstrSOLID,ptype) result(potential)
408  use m_fstr
409  use muload
410  use m_fstr_spring
412  implicit none
413  integer(kind=kint), intent(in) :: cstep
414  type(hecmwst_local_mesh), intent(in) :: hecmesh
415  type(hecmwst_matrix), intent(inout) :: hecmat
416  type(fstr_solid), intent(inout) :: fstrsolid
417  integer(kind=kint), intent(in) :: ptype
418  real(kind=kreal) :: potential
419 
420  integer :: i
421  real(kind=kreal) :: dunode_bak(hecmat%ndof*hecmesh%n_node)
422  real(kind=kreal), allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
423 
424  do i=1, hecmat%ndof*hecmesh%n_node
425  dunode_bak(i) = fstrsolid%dunode(i)
426  enddo
427  if( associated(fstrsolid%shell_dtriad) ) then
428  allocate(shell_dtriad_bak(size(fstrsolid%shell_dtriad)))
429  shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
430  endif
431  if( associated(fstrsolid%shell_ddrill) ) then
432  allocate(shell_ddrill_bak(size(fstrsolid%shell_ddrill)))
433  shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
434  endif
435  call fstr_apply_solution_increment( hecmesh, fstrsolid, hecmat%ndof, hecmat%X )
436  potential = fstr_get_potential(cstep,hecmesh,hecmat,fstrsolid,ptype)
437  do i=1, hecmat%ndof*hecmesh%n_node
438  fstrsolid%dunode(i) = dunode_bak(i)
439  enddo
440  if( allocated(shell_dtriad_bak) ) then
441  fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
442  deallocate(shell_dtriad_bak)
443  endif
444  if( allocated(shell_ddrill_bak) ) then
445  fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
446  deallocate(shell_ddrill_bak)
447  endif
448  end function fstr_get_potential_with_x
449 
450  subroutine plot_potential_graph( cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, &
451  restrt_step_num, sub_step, ctime, dtime, iter, tincr )
452  use m_fstr
454  integer, intent(in) :: cstep
455  type (hecmwST_local_mesh) :: hecMESH
456  type (hecmwST_matrix) :: hecMAT
457  type (fstr_solid) :: fstrSOLID
458  integer, intent(in) :: sub_step
459  real(kind=kreal), intent(in) :: ctime
460  real(kind=kreal), intent(in) :: dtime
461  type (fstr_param) :: fstrPARAM
462  integer(kind=kint) :: restrt_step_num
463 
464  integer(kind=kint) :: iter, i
465  integer(kind=kint), parameter :: ntot = 30
466  real(kind=kreal) :: tincr, alpha, dulen
467  real(kind=kreal) :: pot(3)
468  real(kind=kreal), allocatable :: dunode_bak(:)
469  real(kind=kreal), allocatable :: shell_dtriad_bak(:), shell_ddrill_bak(:)
470 
471  dulen = dsqrt(dot_product(fstrsolid%dunode(:),fstrsolid%dunode(:)))
472  write(imsg,*) "dulen",dulen
473 
474  allocate(dunode_bak(size(fstrsolid%dunode)))
475  do i=1, hecmat%ndof*hecmesh%n_node
476  dunode_bak(i) = fstrsolid%dunode(i)
477  enddo
478  if( associated(fstrsolid%shell_dtriad) ) then
479  allocate(shell_dtriad_bak(size(fstrsolid%shell_dtriad)))
480  shell_dtriad_bak(:) = fstrsolid%shell_dtriad(:)
481  endif
482  if( associated(fstrsolid%shell_ddrill) ) then
483  allocate(shell_ddrill_bak(size(fstrsolid%shell_ddrill)))
484  shell_ddrill_bak(:) = fstrsolid%shell_ddrill(:)
485  endif
486 
487  do i=-ntot,ntot
488  alpha = 5.d-3*dble(i)/dble(ntot)
489  hecmat%X(:) = alpha*fstrsolid%dunode(:)
490  fstrsolid%dunode(:) = dunode_bak(:)
491  if( allocated(shell_dtriad_bak) ) fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
492  if( allocated(shell_ddrill_bak) ) fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
493  call fstr_apply_solution_increment( hecmesh, fstrsolid, hecmat%ndof, hecmat%X )
494  call fstr_calc_residual_vector(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam)
495  pot(1) = fstr_get_potential(cstep,hecmesh,hecmat,fstrsolid,1)
496  pot(2) = fstr_get_potential(cstep,hecmesh,hecmat,fstrsolid,2)
497  pot(3) = fstr_get_potential(cstep,hecmesh,hecmat,fstrsolid,3)
498  write(imsg,'(I4,5(",",1pE16.9))') i,alpha,alpha*dulen,pot(1:3)
499  enddo
500 
501  do i=1, size(fstrsolid%dunode)
502  fstrsolid%dunode(i) = dunode_bak(i)
503  enddo
504  if( allocated(shell_dtriad_bak) ) then
505  fstrsolid%shell_dtriad(:) = shell_dtriad_bak(:)
506  deallocate(shell_dtriad_bak)
507  endif
508  if( allocated(shell_ddrill_bak) ) then
509  fstrsolid%shell_ddrill(:) = shell_ddrill_bak(:)
510  deallocate(shell_ddrill_bak)
511  endif
512  hecmat%X(:) = 0.d0
513  call fstr_calc_residual_vector_with_x(hecmesh, hecmat, fstrsolid, ctime, tincr, iter, cstep, dtime, fstrparam)
514  end subroutine
515 
516 end module m_fstr_residual
Definition: hecmw.f90:6
This module provides functions to take into account external load.
subroutine fstr_ass_load(cstep, ctime, hecMESH, hecMAT, fstrSOLID, fstrPARAM)
This subroutine assmble following external force into fstrSOLIDGL and hecMATB afterwards.
This module provide a function to elemact elements.
subroutine fstr_update_elemact_solid_by_value(hecMESH, fstrSOLID, cstep, ctime)
Finite-rotation nodal kinematics for NLGEOM.
subroutine, public fstr_apply_solution_increment(hecMESH, fstrSOLID, ndof, x)
Apply the linear-solver solution increment x to the step displacement dunode.
This module provides function to calculate residual of nodal force.
subroutine, public fstr_update_ndforce_spc(cstep, hecMESH, fstrSOLID, B)
subroutine, public fstr_update_ndforce(cstep, hecMESH, hecMAT, fstrSOLID, conMAT)
subroutine plot_potential_graph(cstep, hecMESH, hecMAT, fstrSOLID, fstrPARAM, restrt_step_num, sub_step, ctime, dtime, iter, tincr)
real(kind=kreal) function, public fstr_get_potential(cstep, hecMESH, hecMAT, fstrSOLID, ptype)
subroutine fstr_calc_residual_vector(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
\breaf This subroutine calculate residual vector
subroutine fstr_calc_residual_vector_with_x(hecMESH, hecMAT, fstrSOLID, ctime, tincr, iter, cstep, dtime, fstrPARAM)
\breaf This subroutine calculate residual vector
real(kind=kreal) function fstr_get_potential_with_x(cstep, hecMESH, hecMAT, fstrSOLID, ptype)
real(kind=kreal) function fstr_get_energy(force, displacement, hecMESH)
Calculate magnitude of a real vector.
subroutine, public fstr_update_ndforce_mpc(hecMESH, B)
subroutine, public fstr_assemble_residual_contact(hecMAT, hecLagMAT, conMAT, hecMESH, resid_vec, nresid)
Assemble contact residual vector (hecMATB + conMATB + Lagrange) into a single vector.
subroutine, public fstr_update_reaction_spc(cstep, hecMESH, fstrSOLID)
Set fstrSOLIDREACTION at constrained DOFs using current fstrSOLIDQFORCE. Constrained DOFs are enumera...
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
This module provides function to calculate to do updates.
Definition: fstr_Update.f90:6
subroutine fstr_updatenewton(hecMESH, hecMAT, fstrSOLID, fstrPARAM, time, tincr, iter, strainEnergy)
Update displacement, stress, strain and internal forces.
Definition: fstr_Update.f90:28
This module defines common data and basic structures for analysis.
Definition: m_fstr.F90:15
integer(kind=kint), parameter imsg
Definition: m_fstr.F90:121
integer(kind=kint), parameter kbcinitial
Definition: m_fstr.F90:69
logical function fstr_isboundaryactive(fstrSOLID, nbc, cstep)
Definition: m_fstr.F90:1109
This subroutine read in used-defined loading tangent.
Definition: uload.f90:7
subroutine uresidual(cstep, factor, residual)
This subroutine take consider of user-defined external loading.
Definition: uload.f90:39