40 integer,
public :: neg
41 integer,
public :: nprc
42 real(rp),
public :: xmin_gl, xmax_gl
43 real(rp),
public,
allocatable :: fx(:)
46 procedure :: getlocalmesh => meshbase1d_get_localmesh
52 class(
meshbase1d),
intent(inout),
target :: this
82 refElem, NLocalMeshPerPrc, &
88 integer,
intent(in) :: neg
89 real(rp),
intent(in) :: dom_xmin
90 real(rp),
intent(in) :: dom_xmax
92 integer,
intent(in) :: nlocalmeshperprc
93 integer,
intent(in),
optional :: nprocs
94 integer,
intent(in),
optional :: myrank
95 real(rp),
intent(in),
optional :: fx(neg+1)
104 this%xmin_gl = dom_xmin
105 this%xmax_gl = dom_xmax
108 allocate( this%FX(neg+1) )
109 if (
present(fx) )
then
112 this%FX(1 ) = dom_xmin
113 this%FX(neg+1) = dom_xmax
114 dx = (dom_xmax - dom_xmin) / dble(neg)
116 this%FX(k) = this%FX(k-1) + dx
120 this%refElem1D => refelem
123 nlocalmeshperprc, 2, &
126 this%Nprc = this%PRC_NUM
128 allocate( this%lcmesh_list(this%LOCAL_MESH_NUM) )
129 do n=1, this%LOCAL_MESH_NUM
147 if (
allocated ( this%lcmesh_list ) )
then
148 do n=1, this%LOCAL_MESH_NUM
152 deallocate( this%lcmesh_list )
161 subroutine meshbase1d_get_localmesh( this, id, ptr_lcmesh )
166 integer,
intent(in) :: id
170 ptr_lcmesh => this%lcmesh_list(id)
172 end subroutine meshbase1d_get_localmesh
185 integer :: node_ids(lcmesh%refelem%nv)
186 real(rp) :: vx(lcmesh%refelem%nv)
187 real(rp) :: xr(lcmesh%refelem%np)
188 real(dp) :: escale(1,1,lcmesh%refelem%np)
189 integer :: fmask(lcmesh%refelem%nfptot)
190 integer :: fid(lcmesh%refelem1d%nfp,lcmesh%refelem1d%nfaces)
195 refelem => lcmesh%refElem1D
197 fmask(:) = reshape(refelem%Fmask, shape(fmask))
198 do f=1, refelem%Nfaces
200 fid(i,f) = i + (f-1)*refelem%Nfp
205 node_ids(:) = lcmesh%EToV(ke,:)
206 vx(:) = lcmesh%pos_ev(node_ids(:),1)
207 lcmesh%pos_en(:,ke,1) = vx(1) + 0.5_rp*(refelem%x1(:) + 1.0_rp)*(vx(2) - vx(1))
209 xr(:) = 0.5_rp*(vx(2) - vx(1))
212 lcmesh%Escale(:,ke,1,1) = 1.0_rp/lcmesh%J(:,ke)
221 lcmesh%normal_fn(fid(:,1),ke,1) = - 1.0_rp
222 lcmesh%normal_fn(fid(:,2),ke,1) = + 1.0_rp
223 lcmesh%sJ(:,ke) = 1.0_rp
224 lcmesh%Fscale(:,ke) = lcmesh%sJ(:,ke)/lcmesh%J(fmask(:),ke)
225 lcmesh%Gsqrt(:,ke) = 1.0_rp
233 tileID_table, panelID_table, &
241 integer,
intent(out) :: tileid_table(this%local_mesh_num, this%prc_num)
242 integer,
intent(out) :: panelid_table(this%local_mesh_num*this%prc_num)
243 integer,
intent(out) :: pi_table(this%local_mesh_num*this%prc_num)
251 panelid_table, pi_table, &
252 this%tileID_globalMap, this%tileFaceID_globalMap, this%tilePanelID_globalMap, &
253 this%LOCAL_MESH_NUM_global )
256 do n=1, this%LOCAL_MESH_NUM
257 tileid = n + (p-1)*this%LOCAL_MESH_NUM
259 tileid_table(n,p) = tileid
260 this%tileID_global2localMap(tileid) = n
261 this%PRCRank_globalMap(tileid) = p - 1
272 dom_xmin, dom_xmax, &
285 integer,
intent(in) :: tileid
286 integer,
intent(in) :: panelid
287 integer,
intent(in) :: i
288 integer,
intent(in) :: nprc
289 real(rp) :: dom_xmin, dom_xmax
290 integer,
intent(in) ::ne
291 real(rp),
intent(in) :: fx(ne*nprc+1)
295 real(rp) :: fx_lc(ne+1)
298 elem => lcmesh%refElem1D
299 lcmesh%tileID = tileid
300 lcmesh%panelID = panelid
307 lcmesh%NeE = lcmesh%Ne
308 lcmesh%NeA = lcmesh%Ne + 2
311 fx_lc(:) = fx((i-1)*ne+1:i*ne)
312 lcmesh%xmin = fx_lc(1)
313 lcmesh%xmax = fx_lc(ne+1)
315 allocate(lcmesh%pos_ev(lcmesh%Nv,1))
316 allocate( lcmesh%EToV(lcmesh%Ne,2) )
317 allocate( lcmesh%EToE(lcmesh%Ne,elem%Nfaces) )
318 allocate( lcmesh%EToF(lcmesh%Ne,elem%Nfaces) )
319 allocate( lcmesh%BCType(lcmesh%refElem%Nfaces,lcmesh%Ne) )
320 allocate( lcmesh%VMapM(elem%NfpTot, lcmesh%Ne) )
321 allocate( lcmesh%VMapP(elem%NfpTot, lcmesh%Ne) )
322 allocate( lcmesh%MapM(elem%NfpTot, lcmesh%Ne) )
323 allocate( lcmesh%MapP(elem%NfpTot, lcmesh%Ne) )
330 lcmesh%Ne, lcmesh%xmin, lcmesh%xmax, fx=fx_lc )
339 & lcmesh%EToV, lcmesh%Ne, elem%Nfaces )
343 & lcmesh%pos_en, lcmesh%pos_ev, lcmesh%EToE, lcmesh%EtoF, lcmesh%EtoV, &
344 & elem%Fmask, lcmesh%Ne, elem%Np, elem%Nfp, elem%Nfaces, lcmesh%Nv )
347 & lcmesh%pos_en, lcmesh%xmin, lcmesh%xmax, &
348 & elem%Fmask, lcmesh%Ne, elem%Np, elem%Nfp, elem%Nfaces, lcmesh%Nv)
353end module scale_mesh_base1d
module FElib / Element / Base
module FElib / Element / line
module FElib / Mesh / Local 1D
subroutine, public localmesh1d_final(this, is_generated)
subroutine, public localmesh1d_init(this, lcdomid, refelem, myrank)
module FElib / Mesh / Local, Base
integer, parameter, public bctype_interior
module FElib / Mesh / Base 1D
integer, public meshbase1d_dimtype_num
subroutine, public meshbase1d_init(this, neg, dom_xmin, dom_xmax, refelem, nlocalmeshperprc, nprocs, myrank, fx)
subroutine, public meshbase1d_final(this)
integer, public meshbase1d_dimtypeid_x
subroutine, public meshbase1d_assigndomid(this, tileid_table, panelid_table, pi_table)
subroutine, public meshbase1d_setgeometricinfo(lcmesh)
integer, public meshbase1d_dimtypeid_xt
subroutine, public meshbase1d_setuplocaldom(lcmesh, tileid, panelid, i, nprc, dom_xmin, dom_xmax, ne, fx)
module FElib / Mesh / Base
subroutine, public meshbase_final(this)
subroutine, public meshbase_setgeometricinfo(mesh, ndim)
subroutine, public meshbase_init(this, ndimtype, refelem, nlocalmeshperprc, nsidetile, nprocs)
module FElib / Mesh / utility for 1D mesh
subroutine, public meshutil1d_buildinteriormap(vmapm, vmapp, mapm, mapp, pos_en, pos_ev, etoe, etof, etov, fmask, ne, np, nfp, nfaces, nv)
subroutine, public meshutil1d_genconnectivity(etoe, etof, etov, ne, nfaces)
subroutine, public meshutil1d_genpatchboundarymap(vmapb, mapb, vmapp, pos_en, xmin, xmax, fmask, ne, np, nfp, nfaces, nv)
subroutine, public meshutil1d_buildglobalmap(panelid_table, pi_table, tileid_map, tilefaceid_map, tilepanelid_map, ntile)
subroutine, public meshutil1d_genlinedomain(pos_v, etov, ke_x, xmin, xmax, fx)