48 integer :: halosize_1d
50 procedure,
public :: init => meshfieldcommrectdom2d_init
51 procedure,
public :: put => meshfieldcommrectdom2d_put
52 procedure,
public :: get => meshfieldcommrectdom2d_get
53 procedure,
public :: exchange => meshfieldcommrectdom2d_exchange
54 procedure,
public :: final => meshfieldcommrectdom2d_final
66 private :: push_localsendbuf
77 subroutine meshfieldcommrectdom2d_init( this, &
78 sfield_num, hvfield_num, htensorfield_num, mesh2d, &
85 integer,
intent(in) :: sfield_num
86 integer,
intent(in) :: hvfield_num
87 integer,
intent(in) :: htensorfield_num
89 integer,
intent(in),
optional :: halosize_1d
94 integer :: nnode_lcmeshface(
comm_face_num,mesh2d%local_mesh_num)
98 lcmesh => mesh2d%lcmesh_list(1)
99 elem => lcmesh%refElem2D
102 if (
present(halosize_1d) )
then
103 this%haloSize_1D = halosize_1d
109 allocate( this%VMapB_size(this%mesh2d%LOCAL_MESH_NUM) )
111 this%bufsize_per_field = 2 * (lcmesh%NeX + lcmesh%NeY) * elem%Nfp*this%haloSize_1D
113 do n=1, this%mesh2d%LOCAL_MESH_NUM
114 lcmesh => this%mesh2d%lcmesh_list(n)
115 nnode_lcmeshface(:,n) = (/ lcmesh%NeX, lcmesh%NeY, lcmesh%NeX, lcmesh%NeY /) * lcmesh%refElem2D%Nfp*this%haloSize_1D
121 if ( this%haloSize_1D > 1 )
then
122 this%use_vmap_wide_flag = .true.
123 allocate( this%VMapB2(this%bufsize_per_field) )
125 lcmesh => this%mesh2d%lcmesh_list(1)
127 lcmesh%VMapB, this%haloSize_1D, &
128 lcmesh%NeX, lcmesh%NeY, &
131 this%use_vmap_wide_flag = .false.
134 do n=1, this%mesh2d%LOCAL_MESH_NUM
135 lcmesh => this%mesh2d%lcmesh_list(n)
136 if ( this%use_vmap_wide_flag )
then
137 this%VMapB_size(n) =
size(this%VMapB2)
139 this%VMapB_size(n) =
size(lcmesh%VMapB)
144 end subroutine meshfieldcommrectdom2d_init
147 subroutine meshfieldcommrectdom2d_final( this )
154 end subroutine meshfieldcommrectdom2d_final
157 subroutine meshfieldcommrectdom2d_put(this, field_list, varid_s)
161 integer,
intent(in) :: varid_s
164 call prof_rapstart(
'comm_put', 1)
165 if ( this%use_vmap_wide_flag )
then
169 field_list, 2, varid_s, this%mesh2d%lcmesh_list,
size(this%mesh2d%lcmesh_list(1)%VMapB), &
172 call prof_rapend(
'comm_put', 1)
174 end subroutine meshfieldcommrectdom2d_put
177 subroutine meshfieldcommrectdom2d_get(this, field_list, varid_s)
184 integer,
intent(in) :: varid_s
190 call prof_rapstart(
'comm_get', 1)
193 if ( this%call_wait_flag_sub_get )
then
195 field_list, 2, varid_s, this%mesh2d%lcmesh_list )
197 do i=1,
size(field_list)
198 do n=1, this%mesh2d%LOCAL_MESH_NUM
199 lcmesh => this%mesh2d%lcmesh_list(n)
200 if ( this%use_vmap_wide_flag )
then
202 this%VMapB2, this%VMapB_size(1), &
203 field_list(i)%field2d%local(n)%val )
206 field_list(i)%field2d%local(n)%val )
212 call prof_rapend(
'comm_get', 1)
215 end subroutine meshfieldcommrectdom2d_get
220 subroutine meshfieldcommrectdom2d_exchange( this, do_wait )
228 logical,
intent(in),
optional :: do_wait
235 call prof_rapstart(
'comm_exchange_1', 1)
237 do n=1, this%mesh%LOCAL_MESH_NUM
238 lcmesh => this%mesh2d%lcmesh_list(n)
239 do f=1, this%nfaces_comm
240 commdata => this%commdata_list(f,n)
241 call push_localsendbuf( commdata%send_buf, &
242 this%send_buf(:,:,n), commdata%s_faceID, this%is_f(f,n), &
243 commdata%Nnode_LCMeshFace, this%bufsize_per_field, &
244 this%field_num_tot, lcmesh, this%HaloSize_1D )
249 call prof_rapend(
'comm_exchange_1', 1)
252 call prof_rapstart(
'comm_exchange_2', 1)
257 call prof_rapend(
'comm_exchange_2', 1)
260 end subroutine meshfieldcommrectdom2d_exchange
266 subroutine push_localsendbuf( lc_send_buf, &
267 send_buf, s_faceID, is, Nnode_LCMeshFace, bufsize_per_field, var_num, &
268 lcmesh, haloSize_1D )
269 use scale_prc,
only: prc_abort
272 integer,
intent(in) :: var_num
273 integer,
intent(in) :: nnode_lcmeshface
274 integer,
intent(in) :: bufsize_per_field
275 real(rp),
intent(inout) :: lc_send_buf(nnode_lcmeshface,var_num)
276 real(rp),
intent(in) :: send_buf(bufsize_per_field,var_num)
277 integer,
intent(in) :: s_faceid, is
279 integer,
intent(in) :: halosize_1d
286 if ( s_faceid > 0 )
then
290 do i=1, nnode_lcmeshface
291 lc_send_buf(i,v) = send_buf((is-1)*halosize_1d+i,v)
294 else if ( s_faceid < 0 )
then
295 log_info(
"MeshFieldCommRectDom2D",
'(a,i0)')
"Encountered s_faceID <= 0 in push_localsendbuf. Check! s_faceID=", s_faceid
299 end subroutine push_localsendbuf
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Rectangle 2D domain
module FElib / Data / base
module FElib / Data / Communication base
subroutine, public meshfieldcommbase_extract_bounddata(var, refelem, mesh, buf)
Extract halo data from data array with MeshField object and set it to the receiving buffer.
subroutine, public meshfieldcommbase_extract_bounddata_3(field_list, dim, varid_s, lcmesh_list, vmapb2, vmapb2_size, buf)
Extract halo data from data array with MeshField object and set it to the recieving buffer.
subroutine, public meshfieldcommbase_final(this)
Finalize a base object to manage data communication of fields.
subroutine, public meshfieldcommbase_wait_core(this, commdata_list, field_list, dim, varid_s, lcmesh_list)
Wait data communication and move tmp data of LocalMeshCommData object to a recv buffer.
subroutine, public meshfieldcommbase_set_bounddata(buf, refelem, mesh, var)
Extract halo data from the receiving buffer and set it to data array with MeshField object.
subroutine, public meshfieldcommbase_set_bounddata_3(buf, refelem, mesh, vmapb, vmapb_size, var)
Extract halo data from the recieving buffer and set it to data array with MeshField object.
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_extract_bounddata_2(field_list, dim, varid_s, lcmesh_list, vmapb_size, buf)
Extract halo data from data array with MeshField object and set it to the receiving buffer.
subroutine, public meshfieldcommbase_exchange_core(this, commdata_list, do_wait)
Exchange halo data.
module FElib / Data / Communication 2D rectangle domain
integer, parameter comm_face_num
Number of faces with data communication.
module FElib / Mesh / utility for 2D mesh
subroutine, public meshutil2d_genpatchboundarymap_wide(vmapb2, vmapb, halosize, nex, ney, nfp)
Derived type representing a 2D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a rectangular 2D computational domain.
Derived type representing a field with 2D mesh.
Derived type to manage data communication at a face between adjacent local meshes.
Base derived type to manage data communication.
Container to save a pointer of MeshField(1D, 2D, 3D) object.
Base derived type to manage data communication with 2D rectangle domain.