46 integer :: halosize_1d
48 procedure,
public :: init => meshfieldcomm1d_init
49 procedure,
public :: put => meshfieldcomm1d_put
50 procedure,
public :: get => meshfieldcomm1d_get
51 procedure,
public :: exchange => meshfieldcomm1d_exchange
52 procedure,
public :: final => meshfieldcomm1d_final
64 private :: push_localsendbuf
74 subroutine meshfieldcomm1d_init( this, &
75 sfield_num, hvfield_num, mesh1d, &
82 integer,
intent(in) :: sfield_num
83 integer,
intent(in) :: hvfield_num
84 class(
meshbase1d),
intent(in),
target :: mesh1d
85 integer,
intent(in),
optional :: halosize_1d
90 integer :: nnode_lcmeshface(
comm_face_num,mesh1d%local_mesh_num)
94 lcmesh => mesh1d%lcmesh_list(1)
95 elem => lcmesh%refElem1D
98 if (
present(halosize_1d) )
then
99 this%haloSize_1D = halosize_1d
105 allocate( this%VMapB_size(this%mesh1d%LOCAL_MESH_NUM) )
107 this%bufsize_per_field = mesh1d%refElem1D%Nfp * 2 * this%haloSize_1D
109 do n=1, this%mesh1d%LOCAL_MESH_NUM
110 nnode_lcmeshface(:,n) = (/ 1, 1 /) * this%haloSize_1D
113 call meshfieldcommbase_init( this, sfield_num, hvfield_num, 0, this%bufsize_per_field, 2, nnode_lcmeshface, mesh1d)
115 if ( this%haloSize_1D > 1 )
then
116 this%use_vmap_wide_flag = .true.
117 allocate( this%VMapB2(this%bufsize_per_field) )
119 lcmesh => this%mesh1d%lcmesh_list(1)
121 lcmesh%VMapB, this%haloSize_1D, &
125 this%use_vmap_wide_flag = .false.
128 do n=1, this%mesh1d%LOCAL_MESH_NUM
129 lcmesh => this%mesh1d%lcmesh_list(n)
130 if ( this%use_vmap_wide_flag )
then
131 this%VMapB_size(n) =
size(this%VMapB2)
133 this%VMapB_size(n) =
size(lcmesh%VMapB)
137 end subroutine meshfieldcomm1d_init
140 subroutine meshfieldcomm1d_final( this )
147 end subroutine meshfieldcomm1d_final
150 subroutine meshfieldcomm1d_put(this, field_list, varid_s)
154 integer,
intent(in) :: varid_s
161 if ( this%use_vmap_wide_flag )
then
165 field_list, 1, varid_s, this%mesh1d%lcmesh_list,
size(this%mesh1d%lcmesh_list(1)%VMapB), &
170 end subroutine meshfieldcomm1d_put
173 subroutine meshfieldcomm1d_get(this, field_list, varid_s)
180 integer,
intent(in) :: varid_s
187 if ( this%call_wait_flag_sub_get )
then
190 do i=1,
size(field_list)
191 do n=1, this%mesh1D%LOCAL_MESH_NUM
192 lcmesh => this%mesh1D%lcmesh_list(n)
193 if ( this%use_vmap_wide_flag )
then
195 this%VMapB2, this%VMapB_size(1), &
196 field_list(i)%field1d%local(n)%val )
199 field_list(i)%field1d%local(n)%val )
207 end subroutine meshfieldcomm1d_get
213 subroutine meshfieldcomm1d_exchange( this, do_wait )
222 logical,
intent(in),
optional :: do_wait
229 do n=1, this%mesh%LOCAL_MESH_NUM
230 do f=1, this%nfaces_comm
231 commdata => this%commdata_list(f,n)
232 call push_localsendbuf( commdata%send_buf, &
233 this%send_buf(:,:,n), commdata%s_faceID, f, &
234 commdata%Nnode_LCMeshFace, this%bufsize_per_field, &
235 this%field_num_tot, this%mesh1D%lcmesh_list(n), this%haloSize_1D )
243 end subroutine meshfieldcomm1d_exchange
247 subroutine push_localsendbuf( lc_send_buf, &
248 send_buf, s_faceID, is, Nnode_LCMeshFace, bufsize_per_field, var_num, &
249 lcmesh, haloSize_1D )
250 use scale_prc,
only: prc_abort
253 integer,
intent(in) :: var_num
254 integer,
intent(in) :: nnode_lcmeshface
255 integer,
intent(in) :: bufsize_per_field
256 real(rp),
intent(inout) :: lc_send_buf(nnode_lcmeshface,var_num)
257 real(rp),
intent(in) :: send_buf(bufsize_per_field,var_num)
258 integer,
intent(in) :: s_faceid, is
260 integer,
intent(in) :: halosize_1d
267 if ( s_faceid > 0 )
then
271 do i=1, nnode_lcmeshface
272 lc_send_buf(i,v) = send_buf((is-1)*halosize_1d+i,v)
275 else if ( s_faceid < 0 )
then
276 log_info(
"MeshFieldComm1D",
'(a,i0)')
"Encountered s_faceID <= 0 in push_localsendbuf. Check! s_faceID=", s_faceid
280 end subroutine push_localsendbuf
module FElib / Element / Base
module FElib / Mesh / Local 1D
module FElib / Mesh / Base 1D
module FElib / Data / base
module FElib / Data / Communication 1D
integer, parameter comm_face_num
Number of faces with data communication.
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 / Mesh / utility for 1D mesh
subroutine, public meshutil1d_genpatchboundarymap_wide(vmapb2, vmapb, halosize, nex, np)
Derived type representing a 1D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 1D domain.
Derived type to manage a computational mesh (base type for 1D domain)
Derived type representing a field with 1D mesh.
Base derived type to manage data communication with 1D domain.
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.