41 integer,
public :: neg
42 integer,
public :: nprc
44 real(rp),
public :: xmin_gl
45 real(rp),
public :: xmax_gl
47 real(rp),
public,
allocatable :: fx(:)
50 procedure :: getlocalmesh => meshbase1d_get_localmesh
56 class(
meshbase1d),
intent(inout),
target :: this
87 refElem, NLocalMeshPerPrc, &
93 integer,
intent(in) :: neg
94 real(rp),
intent(in) :: dom_xmin
95 real(rp),
intent(in) :: dom_xmax
97 integer,
intent(in) :: nlocalmeshperprc
98 integer,
intent(in),
optional :: nprocs
99 integer,
intent(in),
optional :: myrank
100 real(rp),
intent(in),
optional :: fx(neg+1)
109 this%xmin_gl = dom_xmin
110 this%xmax_gl = dom_xmax
113 allocate( this%FX(neg+1) )
114 if (
present(fx) )
then
117 this%FX(1 ) = dom_xmin
118 this%FX(neg+1) = dom_xmax
119 dx = (dom_xmax - dom_xmin) / dble(neg)
121 this%FX(k) = this%FX(k-1) + dx
126 this%refElem1D => refelem
129 nlocalmeshperprc, 2, &
132 this%Nprc = this%PRC_NUM
134 allocate( this%lcmesh_list(this%LOCAL_MESH_NUM) )
135 do n=1, this%LOCAL_MESH_NUM
154 if (
allocated ( this%lcmesh_list ) )
then
155 do n=1, this%LOCAL_MESH_NUM
159 deallocate( this%lcmesh_list )
168 subroutine meshbase1d_get_localmesh( this, id, ptr_lcmesh )
173 integer,
intent(in) :: id
177 ptr_lcmesh => this%lcmesh_list(id)
179 end subroutine meshbase1d_get_localmesh
192 integer :: node_ids(lcmesh%refelem%nv)
193 real(rp) :: vx(lcmesh%refelem%nv)
194 real(rp) :: xr(lcmesh%refelem%np)
195 real(dp) :: escale(1,1,lcmesh%refelem%np)
196 integer :: fmask(lcmesh%refelem%nfptot)
197 integer :: fid(lcmesh%refelem1d%nfp,lcmesh%refelem1d%nfaces)
202 refelem => lcmesh%refElem1D
204 fmask(:) = reshape(refelem%Fmask, shape(fmask))
205 do f=1, refelem%Nfaces
207 fid(i,f) = i + (f-1)*refelem%Nfp
212 node_ids(:) = lcmesh%EToV(ke,:)
213 vx(:) = lcmesh%pos_ev(node_ids(:),1)
214 lcmesh%pos_en(:,ke,1) = vx(1) + 0.5_rp*(refelem%x1(:) + 1.0_rp)*(vx(2) - vx(1))
216 xr(:) = 0.5_rp*(vx(2) - vx(1))
219 lcmesh%Escale(:,ke,1,1) = 1.0_rp/lcmesh%J(:,ke)
228 lcmesh%normal_fn(fid(:,1),ke,1) = - 1.0_rp
229 lcmesh%normal_fn(fid(:,2),ke,1) = + 1.0_rp
230 lcmesh%sJ(:,ke) = 1.0_rp
231 lcmesh%Fscale(:,ke) = lcmesh%sJ(:,ke)/lcmesh%J(fmask(:),ke)
232 lcmesh%Gsqrt(:,ke) = 1.0_rp
241 tileID_table, panelID_table, &
249 integer,
intent(out) :: tileid_table(this%local_mesh_num, this%prc_num)
250 integer,
intent(out) :: panelid_table(this%local_mesh_num*this%prc_num)
251 integer,
intent(out) :: pi_table(this%local_mesh_num*this%prc_num)
259 panelid_table, pi_table, &
260 this%tileID_globalMap, this%tileFaceID_globalMap, this%tilePanelID_globalMap, &
261 this%LOCAL_MESH_NUM_global )
264 do n=1, this%LOCAL_MESH_NUM
265 tileid = n + (p-1)*this%LOCAL_MESH_NUM
267 tileid_table(n,p) = tileid
268 this%tileID_global2localMap(tileid) = n
269 this%PRCRank_globalMap(tileid) = p - 1
282 dom_xmin, dom_xmax, &
295 integer,
intent(in) :: tileid
296 integer,
intent(in) :: panelid
297 integer,
intent(in) :: i
298 integer,
intent(in) :: nprc
299 real(rp) :: dom_xmin, dom_xmax
300 integer,
intent(in) ::ne
301 real(rp),
intent(in) :: fx(ne*nprc+1)
305 real(rp) :: fx_lc(ne+1)
308 elem => lcmesh%refElem1D
309 lcmesh%tileID = tileid
310 lcmesh%panelID = panelid
318 lcmesh%NeE = lcmesh%Ne
319 lcmesh%NeA = lcmesh%Ne + 2
323 fx_lc(:) = fx((i-1)*ne+1:i*ne+1)
324 lcmesh%xmin = fx_lc(1)
325 lcmesh%xmax = fx_lc(ne+1)
328 allocate( lcmesh%pos_ev(lcmesh%Nv,1) )
329 allocate( lcmesh%EToV(lcmesh%Ne,2) )
330 allocate( lcmesh%EToE(lcmesh%Ne,elem%Nfaces) )
331 allocate( lcmesh%EToF(lcmesh%Ne,elem%Nfaces) )
332 allocate( lcmesh%BCType(lcmesh%refElem%Nfaces,lcmesh%Ne) )
333 allocate( lcmesh%VMapM(elem%NfpTot, lcmesh%Ne) )
334 allocate( lcmesh%VMapP(elem%NfpTot, lcmesh%Ne) )
335 allocate( lcmesh%MapM(elem%NfpTot, lcmesh%Ne) )
336 allocate( lcmesh%MapP(elem%NfpTot, lcmesh%Ne) )
346 lcmesh%Ne, lcmesh%xmin, lcmesh%xmax, fx=fx_lc )
355 & lcmesh%EToV, lcmesh%Ne, elem%Nfaces )
360 & lcmesh%pos_en, lcmesh%pos_ev, lcmesh%EToE, lcmesh%EtoF, lcmesh%EtoV, &
361 & elem%Fmask, lcmesh%Ne, elem%Np, elem%Nfp, elem%Nfaces, lcmesh%Nv )
364 & lcmesh%pos_en, lcmesh%xmin, lcmesh%xmax, &
365 & elem%Fmask, lcmesh%Ne, elem%Np, elem%Nfp, elem%Nfaces, lcmesh%Nv )
module FElib / Element / Base
module FElib / Element / line
module FElib / Mesh / Local 1D
subroutine, public localmesh1d_final(this, is_generated)
Finalize an object to manage a local mesh for 1D domain.
subroutine, public localmesh1d_init(this, lcdomid, refelem, myrank)
Initialize an object to manage a local mesh for 1D domain.
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)
Initialize an object to manage a 1D computational mesh.
subroutine, public meshbase1d_final(this)
Finalize an object to manage a 1D computational mesh.
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)
Finalize an object to manage a computational mesh.
subroutine, public meshbase_setgeometricinfo(mesh, ndim)
subroutine, public meshbase_init(this, ndimtype, refelem, nlocalmeshperprc, nsidetile, nprocs)
Initialize an object to manage a computational mesh.
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)
Derived type representing a 1D reference element.
Derived type representing a line element.
Derived type representing a local mesh for 1D domain.
Derived type to manage a local computational domain (base type)
Derived type to manage a computational mesh (base type for 1D domain)
Base type to manage a computational mesh.