46 integer :: halosize_h1d
49 procedure,
public :: init => meshfieldcommcubedom3d_init
50 procedure,
public :: put => meshfieldcommcubedom3d_put
51 procedure,
public :: get => meshfieldcommcubedom3d_get
52 procedure,
public :: exchange => meshfieldcommcubedom3d_exchange
53 procedure,
public :: final => meshfieldcommcubedom3d_final
65 private :: push_localsendbuf
75 subroutine meshfieldcommcubedom3d_init( this, &
76 sfield_num, hvfield_num, htensorfield_num, mesh3d, &
77 haloSize_h1D, haloSize_v )
83 integer,
intent(in) :: sfield_num
84 integer,
intent(in) :: hvfield_num
85 integer,
intent(in) :: htensorfield_num
87 integer,
intent(in),
optional :: halosize_h1d
88 integer,
intent(in),
optional :: halosize_v
93 integer :: nnode_lcmeshface(
comm_face_num,mesh3d%local_mesh_num)
97 lcmesh => mesh3d%lcmesh_list(1)
98 elem => lcmesh%refElem3D
102 if (
present(halosize_h1d) )
then
103 this%haloSize_h1D = halosize_h1d
105 this%haloSize_h1D = 1
107 if (
present(halosize_v) )
then
108 this%haloSize_v = halosize_v
114 allocate( this%VMapB_size(this%mesh3d%LOCAL_MESH_NUM) )
116 this%bufsize_per_field = 2 * (lcmesh%NeX + lcmesh%NeY) * lcmesh%NeZ*elem%Nfp_h*this%haloSize_h1D &
117 + 2 * lcmesh%NeX*lcmesh%NeY * elem%Nfp_v*this%haloSize_v
120 do n=1, this%mesh3d%LOCAL_MESH_NUM
121 lcmesh => this%mesh3d%lcmesh_list(n)
122 nnode_lcmeshface(:,n) = &
123 (/ lcmesh%NeX, lcmesh%NeY, lcmesh%NeX, lcmesh%NeY, 0, 0 /) * lcmesh%NeZ * lcmesh%refElem3D%Nfp_h*this%haloSize_h1D &
124 + (/ 0, 0, 0, 0, 1, 1 /) * lcmesh%NeX*lcmesh%NeY * lcmesh%refElem3D%Nfp_v*this%haloSize_v
130 if ( this%haloSize_h1D > 1 .or. this%haloSize_v > 1)
then
131 this%use_vmap_wide_flag = .true.
132 allocate( this%VMapB2(this%bufsize_per_field) )
134 lcmesh => this%mesh3d%lcmesh_list(1)
136 lcmesh%VMapB, this%haloSize_h1D, this%haloSize_v, &
137 lcmesh%NeX, lcmesh%NeY, lcmesh%NeZ, &
138 elem%Nfp_h, elem%Nfp_v, elem%Nnode_h1D, elem%Nnode_v )
141 this%use_vmap_wide_flag = .false.
144 do n=1, this%mesh3d%LOCAL_MESH_NUM
145 lcmesh => this%mesh3d%lcmesh_list(n)
146 if ( this%use_vmap_wide_flag )
then
147 this%VMapB_size(n) =
size(this%VMapB2)
149 this%VMapB_size(n) =
size(lcmesh%VMapB)
155 end subroutine meshfieldcommcubedom3d_init
158 subroutine meshfieldcommcubedom3d_final( this )
164 end subroutine meshfieldcommcubedom3d_final
167 subroutine meshfieldcommcubedom3d_put(this, field_list, varid_s)
171 integer,
intent(in) :: varid_s
180 if ( this%use_vmap_wide_flag )
then
185 field_list, 3, varid_s, this%mesh3d%lcmesh_list,
size(this%mesh3d%lcmesh_list(1)%VMapB), &
192 end subroutine meshfieldcommcubedom3d_put
195 subroutine meshfieldcommcubedom3d_get(this, field_list, varid_s)
202 integer,
intent(in) :: varid_s
210 if ( this%call_wait_flag_sub_get )
then
213 field_list, 3, varid_s, this%mesh3d%lcmesh_list )
217 do i=1,
size(field_list)
218 do n=1, this%mesh3d%LOCAL_MESH_NUM
219 lcmesh => this%mesh3d%lcmesh_list(n)
220 if ( this%use_vmap_wide_flag )
then
222 this%VMapB2, this%VMapB_size(1), &
223 field_list(i)%field3d%local(n)%val )
226 field_list(i)%field3d%local(n)%val )
236 end subroutine meshfieldcommcubedom3d_get
242 subroutine meshfieldcommcubedom3d_exchange( this, do_wait )
250 logical,
intent(in),
optional :: do_wait
260 do n=1, this%mesh%LOCAL_MESH_NUM
261 lcmesh => this%mesh3d%lcmesh_list(n)
262 do f=1, this%nfaces_comm
263 commdata => this%commdata_list(f,n)
264 call push_localsendbuf( commdata%send_buf, &
265 this%send_buf(:,:,n), commdata%s_faceID, this%is_f(f,n), &
266 commdata%Nnode_LCMeshFace, this%bufsize_per_field, &
267 this%field_num_tot, lcmesh, this%haloSize_h1D )
281 end subroutine meshfieldcommcubedom3d_exchange
286 subroutine push_localsendbuf( lc_send_buf, &
287 send_buf, s_faceID, is, Nnode_LCMeshFace, bufsize_per_field, var_num, &
288 lcmesh, haloSize_h1D )
289 use scale_prc,
only: prc_abort
291 integer,
intent(in) :: nnode_lcmeshface
292 integer,
intent(in) :: bufsize_per_field
293 integer,
intent(in) :: var_num
294 real(rp),
intent(out) :: lc_send_buf(nnode_lcmeshface,var_num)
295 real(rp),
intent(in) :: send_buf(bufsize_per_field,var_num)
296 integer,
intent(in) :: s_faceid, is
298 integer,
intent(in) :: halosize_h1d
305 if ( s_faceid > 0 )
then
309 do i=1, nnode_lcmeshface
310 lc_send_buf(i,vid) = send_buf(is+i-1,vid)
314 log_info(
"MeshFieldCommCubeDom3D",
'(a,i0)')
"Encountered s_faceID <= 0 in push_localsendbuf. Check! s_faceID=", s_faceid
318 end subroutine push_localsendbuf
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)
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 3D cubic domain
integer, parameter comm_face_num
Number of faces with data communication.
module FElib / Mesh / utility for 3D mesh
subroutine, public meshutil3d_genpatchboundarymap_wide(vmapb2, vmapb, halosize_h, halosize_v, nex, ney, nez, nfp_h, nfp_v, nnode_h1d, nnode_v)
Derived type representing a 3D reference element.
Derived type representing an arbitrary finite element.
Derived type to manage a local 3D computational domain.
Derived type to manage a cubic 3D computational domain.
Derived type representing a field with 3D 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 3D cubic domain.