43 procedure,
public :: init => meshfieldcommcubedom3d_init
44 procedure,
public :: put => meshfieldcommcubedom3d_put
45 procedure,
public :: get => meshfieldcommcubedom3d_get
46 procedure,
public :: exchange => meshfieldcommcubedom3d_exchange
47 procedure,
public :: final => meshfieldcommcubedom3d_final
59 private :: push_localsendbuf
66 integer,
parameter :: comm_face_num = 6
69 subroutine meshfieldcommcubedom3d_init( this, &
70 sfield_num, hvfield_num, htensorfield_num, mesh3d )
75 integer,
intent(in) :: sfield_num
76 integer,
intent(in) :: hvfield_num
77 integer,
intent(in) :: htensorfield_num
83 integer :: nnode_lcmeshface(comm_face_num,mesh3d%local_mesh_num)
87 lcmesh => mesh3d%lcmesh_list(1)
88 elem => lcmesh%refElem3D
90 + 2*lcmesh%NeX*lcmesh%NeY*elem%Nfp_v
92 do n=1, this%mesh3d%LOCAL_MESH_NUM
93 lcmesh => this%mesh3d%lcmesh_list(n)
94 nnode_lcmeshface(:,n) = &
95 (/ lcmesh%NeX, lcmesh%NeY, lcmesh%NeX, lcmesh%NeY, 0, 0 /) * lcmesh%NeZ * lcmesh%refElem3D%Nfp_h &
96 + (/ 0, 0, 0, 0, 1, 1 /) * lcmesh%NeX*lcmesh%NeY * lcmesh%refElem3D%Nfp_v
102 end subroutine meshfieldcommcubedom3d_init
104 subroutine meshfieldcommcubedom3d_final( this )
112 end subroutine meshfieldcommcubedom3d_final
114 subroutine meshfieldcommcubedom3d_put(this, field_list, varid_s)
118 integer,
intent(in) :: varid_s
127 field_num =
size(field_list)
128 do n=1, this%mesh%LOCAL_MESH_NUM
129 lcmesh => this%mesh3d%lcmesh_list(n)
132 this%send_buf(:,varid_s+i-1,n) )
138 end subroutine meshfieldcommcubedom3d_put
140 subroutine meshfieldcommcubedom3d_get(this, field_list, varid_s)
147 integer,
intent(in) :: varid_s
154 if ( this%call_wait_flag_sub_get )
then
159 do i=1,
size(field_list)
160 do n=1, this%mesh3d%LOCAL_MESH_NUM
161 lcmesh => this%mesh3d%lcmesh_list(n)
163 field_list(i)%field3d%local(n)%val )
169 end subroutine meshfieldcommcubedom3d_get
172 subroutine meshfieldcommcubedom3d_exchange( this, do_wait )
179 logical,
intent(in),
optional :: do_wait
187 do n=1, this%mesh%LOCAL_MESH_NUM
188 lcmesh => this%mesh3d%lcmesh_list(n)
189 do f=1, this%nfaces_comm
190 commdata => this%commdata_list(f,n)
191 call push_localsendbuf( commdata%send_buf(:,:), &
192 this%send_buf(:,:,n), commdata%s_faceID, this%is_f(f,n), &
193 commdata%Nnode_LCMeshFace, this%field_num_tot, lcmesh )
203 end subroutine meshfieldcommcubedom3d_exchange
208 subroutine push_localsendbuf( lc_send_buf, send_buf, s_faceID, is, Nnode_LCMeshFace, var_num, lcmesh )
211 integer,
intent(in) :: nnode_lcmeshface
212 integer,
intent(in) :: var_num
214 real(rp),
intent(out) :: lc_send_buf(nnode_lcmeshface,var_num)
216 integer,
intent(in) :: s_faceid, is
223 if ( s_faceid > 0 )
then
226 do i=1, nnode_lcmeshface
227 lc_send_buf(i,vid) = send_buf(is+i-1,vid)
230 else if ( -5 < s_faceid .and. s_faceid < 0)
then
231 e3d => lcmesh%refElem3D
232 ie = is + nnode_lcmeshface - 1
233 call revert_hori( lc_send_buf(:,:), send_buf(is:ie,:), nnode_lcmeshface/lcmesh%NeZ, lcmesh%NeZ )
238 subroutine revert_hori(revert, ori, Ne_h1D, NeZ)
239 integer,
intent(in) :: ne_h1d, nez
240 real(rp),
intent(out) :: revert(e3d%nnode_h1d, e3d%nnode_v, ne_h1d, nez, var_num)
241 real(rp),
intent(in) :: ori(e3d%nnode_h1d, e3d%nnode_v, ne_h1d, nez, var_num)
243 integer :: p1, p3, i, k, n
252 do p1=1, e3d%Nnode_h1D
253 p1_ = e3d%Nnode_h1D - p1 + 1
254 revert(p1,p3,i,k,n) = ori(p1_,p3,i_,k,n)
260 end subroutine revert_hori
261 end subroutine push_localsendbuf
262end module scale_meshfieldcomm_cubedom3d
module FElib / Element / Base
module FElib / Mesh / Local 3D
module FElib / Mesh / Cubic 3D domain
module FElib / Data / base
module FElib / Data / Communication base
subroutine, public meshfieldcommbase_extract_bounddata(var, refelem, mesh, buf)
subroutine, public meshfieldcommbase_final(this)
Finalize a base object to manage data communication of fields.
subroutine, public meshfieldcommbase_wait_core(this, commdata_list)
Wait data communication and move tmp data of LocalMeshCommData object to a recv buffer.
subroutine, public meshfieldcommbase_set_bounddata(buf, refelem, mesh, var)
subroutine, public meshfieldcommbase_init(this, sfield_num, hvfield_num, htensorfield_num, bufsize_per_field, comm_face_num, nnode_lcmeshface, mesh)
Initialize a base object to manage data communication of fields.
subroutine, public meshfieldcommbase_exchange_core(this, commdata_list, do_wait)
Exchange halo data.
module FElib / Data / Communication 3D cubic domain
integer bufsize_per_field
Derived type to manage data communication between a face of local mesh.
Base derived type to manage data communication.