FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
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
12contains
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)
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
68end module hecmw_comm_group
I/O and Utility.
integer(kind=kint) function hecmw_ngrp_get_number(hecmesh, ngrpid)
real(kind=kreal) function hecmw_ngrp_get_totalvalue(hecmesh, ngrpid, ndof, idof, vector)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=kint), parameter hecmw_sum
integer(kind=4), parameter kreal
subroutine hecmw_allreduce_i1(hecmesh, s, ntag)
subroutine hecmw_allreduce_r1(hecmesh, s, ntag)