FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_comm_group.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_util
10  implicit none
11 
12 contains
13 
14  function hecmw_ngrp_get_number(hecMESH, ngrpid)
15  type(hecmwst_local_mesh) :: hecmesh
16  integer(kind=kint) :: ngrpid
17  integer(kind=kint) :: hecmw_ngrp_get_number
18 
19  integer(kind=kint) :: is, ie, ik, in
20  integer(kind=kint) :: n_ngrp_internal, nn_internal
21 
22  nn_internal = hecmesh%nn_internal
23 
24  is = hecmesh%node_group%grp_index(ngrpid-1)+1
25  ie = hecmesh%node_group%grp_index(ngrpid)
26 
27  n_ngrp_internal = 0
28  do ik=is,ie
29  in = hecmesh%node_group%grp_item(ik)
30  if( in > nn_internal ) cycle
31  n_ngrp_internal = n_ngrp_internal + 1
32  enddo
33 
34  call hecmw_allreduce_i1 (hecmesh, n_ngrp_internal, hecmw_sum)
35  hecmw_ngrp_get_number = n_ngrp_internal
36 
37  end function hecmw_ngrp_get_number
38 
39  function hecmw_ngrp_get_totalvalue(hecMESH, ngrpid, ndof, idof, vector)
40  type(hecmwst_local_mesh) :: hecmesh ! local mesh
41  integer(kind=kint) :: ngrpid ! node group id
42  integer(kind=kint) :: idof ! dof to be returned
43  integer(kind=kint) :: ndof ! dof of noval value
44  real(kind=kreal), pointer :: vector(:) ! nodal value vector (size=nodf*hecMESH&n_node)
45  real(kind=kreal) :: hecmw_ngrp_get_totalvalue
46 
47  integer(kind=kint) :: is, ie, ik, in
48  integer(kind=kint) :: nn_internal
49  real(kind=kreal) :: value
50 
51  nn_internal = hecmesh%nn_internal
52 
53  is = hecmesh%node_group%grp_index(ngrpid-1)+1
54  ie = hecmesh%node_group%grp_index(ngrpid)
55 
56  value = 0.d0
57  do ik=is,ie
58  in = hecmesh%node_group%grp_item(ik)
59  if( in > nn_internal ) cycle
60  value = value + vector(ndof*(in-1)+idof)
61  enddo
62 
63  call hecmw_allreduce_r1 (hecmesh, value, hecmw_sum)
65 
66  end function hecmw_ngrp_get_totalvalue
67 
68 end module hecmw_comm_group
hecmw_comm_group
I/O and Utility.
Definition: hecmw_comm_group.f90:7
hecmw_util::hecmw_sum
integer(kind=kint), parameter hecmw_sum
Definition: hecmw_util_f.F90:23
hecmw_comm_group::hecmw_ngrp_get_number
integer(kind=kint) function hecmw_ngrp_get_number(hecMESH, ngrpid)
Definition: hecmw_comm_group.f90:15
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
hecmw_util::hecmwst_local_mesh
Definition: hecmw_util_f.F90:234
m_hecmw_comm_f::hecmw_allreduce_r1
subroutine hecmw_allreduce_r1(hecMESH, s, ntag)
Definition: hecmw_comm_f.F90:403
m_hecmw_comm_f
Definition: hecmw_comm_f.F90:6
hecmw_util::kreal
integer(kind=4), parameter kreal
Definition: hecmw_util_f.F90:16
hecmw_comm_group::hecmw_ngrp_get_totalvalue
real(kind=kreal) function hecmw_ngrp_get_totalvalue(hecMESH, ngrpid, ndof, idof, vector)
Definition: hecmw_comm_group.f90:40
m_hecmw_comm_f::hecmw_allreduce_i1
subroutine hecmw_allreduce_i1(hecMESH, s, ntag)
Definition: hecmw_comm_f.F90:458