FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
fstr_ctrl_modifier.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 !-------------------------------------------------------------------------------
7 
9  use hecmw_util
10  implicit none
11 
12 contains
13 
15  subroutine fstr_append_mpc( np, nodes, dofs, values, mpcs )
16  use hecmw_setup_util, only &
20  integer, intent(in) :: np
21  integer, intent(in) :: nodes(np)
22  integer, intent(in) :: dofs(np)
23  real(kind=kreal), intent(in) :: values(np+1)
24  type( hecmwst_mpc ), intent(inout) :: mpcs
25 
26  integer :: i, n_mpc, old_size, new_size
27  n_mpc = mpcs%n_mpc
28  new_size= n_mpc+1
29  mpcs%n_mpc = new_size
30  call hecmw_expand_index_array( mpcs%mpc_index, n_mpc+1, new_size+1 )
31  call hecmw_expand_real_array( mpcs%mpc_const, n_mpc, n_mpc+1 )
32  old_size = mpcs%mpc_index( n_mpc )
33  new_size = old_size+np
34  call hecmw_expand_integer_array( mpcs%mpc_item, old_size, new_size )
35  call hecmw_expand_integer_array( mpcs%mpc_dof, old_size, new_size )
36  call hecmw_expand_real_array( mpcs%mpc_val, old_size, new_size )
37 
38  mpcs%mpc_index(mpcs%n_mpc) = mpcs%mpc_index(mpcs%n_mpc-1)+np
39  mpcs%mpc_const(mpcs%n_mpc) = values(np+1)
40  do i=1,np
41  mpcs%mpc_item(old_size+i) = nodes(i)
42  mpcs%mpc_dof(old_size+i) = dofs(i)
43  mpcs%mpc_val(old_size+i) = values(i)
44  enddo
45  end subroutine
46 
48  subroutine fstr_delete_mpc( np, mpcs )
49  use hecmw_setup_util, only &
53  implicit none
54  integer, intent(in) :: np
55  type( hecmwst_mpc ), intent(inout) :: mpcs
56 
57  integer :: n_mpc, old_size, nitem
58  n_mpc = mpcs%n_mpc
59  old_size = mpcs%mpc_index( n_mpc )
60  nitem = old_size- mpcs%mpc_index( n_mpc-np )
61  call hecmw_delete_real_array( mpcs%mpc_val, old_size, nitem )
62  call hecmw_delete_integer_array( mpcs%mpc_dof, old_size, nitem )
63  call hecmw_delete_integer_array( mpcs%mpc_item, old_size, nitem )
64 
65  call hecmw_delete_real_array( mpcs%mpc_const, n_mpc, np )
66  call hecmw_delete_index_array( mpcs%mpc_index, n_mpc, np )
67  mpcs%n_mpc = n_mpc-np
68  end subroutine
69 
70 end module
71 
This module provides functions to modify MPC conditions.
subroutine fstr_delete_mpc(np, mpcs)
Delete last n equation conditions from current mpc condition.
subroutine fstr_append_mpc(np, nodes, dofs, values, mpcs)
Append new equation condition at end of existing mpc conditions.
This module contains auxiliary functions in calculation setup.
This module contains auxiliary functions in calculation setup.
subroutine hecmw_expand_integer_array(array, old_size, new_size)
subroutine hecmw_expand_real_array(array, old_size, new_size)
subroutine hecmw_delete_integer_array(array, old_size, nitem)
subroutine hecmw_expand_index_array(array, old_size, new_size)
subroutine hecmw_delete_real_array(array, old_size, nitem)
subroutine hecmw_delete_index_array(array, old_size, nindex)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal