FE-Project
Loading...
Searching...
No Matches
scale_mesh_base Module Reference

module FElib / Mesh / Base More...

Data Types

type  meshbase
 Base type to manage a computational mesh. More...
interface  meshbase_get_localmesh
type  meshdiminfo
 Derived type to manage an information of a mesh dimension. More...

Functions/Subroutines

subroutine, public meshbase_init (this, ndimtype, refelem, nlocalmeshperprc, nsidetile, nprocs)
 Initialize an object to manage a computational mesh.
subroutine, public meshbase_final (this)
 Finalize an object to manage a computational mesh.
subroutine, public meshbase_setgeometricinfo (mesh, ndim)

Detailed Description

module FElib / Mesh / Base

Description
Base module to manage meshes for element-based methods
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ meshbase_init()

subroutine, public scale_mesh_base::meshbase_init ( class(meshbase), intent(inout) this,
integer, intent(in) ndimtype,
class(elementbase), intent(in), target refelem,
integer, intent(in) nlocalmeshperprc,
integer, intent(in) nsidetile,
integer, intent(in), optional nprocs )

Initialize an object to manage a computational mesh.

Parameters
[in]ndimtypeNumber of DIMTYPE
[in]refelemAn object with a reference element
[in]nlocalmeshperprcNumber of local meshes in each MPI process
[in]nsidetileNumber of side tiles
[in]nprocsMPI processes (if not provided, it will be set to the value from PRC_nprocs)

Definition at line 94 of file scale_mesh_base.F90.

97
98 use scale_prc, only: &
99 prc_nprocs
100 implicit none
101
102 class(MeshBase), intent(inout) :: this
103 integer, intent(in) :: ndimtype !< Number of DIMTYPE
104 class(ElementBase), intent(in), target :: refElem !< An object with a reference element
105 integer, intent(in) :: NLocalMeshPerPrc !< Number of local meshes in each MPI process
106 integer, intent(in) :: NsideTile !< Number of side tiles
107 integer, intent(in), optional :: nprocs !< MPI processes (if not provided, it will be set to the value from PRC_nprocs)
108
109 integer :: n
110 !-----------------------------------------------------------------------------
111
112 if ( present(nprocs) ) then
113 this%PRC_NUM = nprocs
114 else
115 this%PRC_NUM = prc_nprocs
116 end if
117
118 this%LOCAL_MESH_NUM = nlocalmeshperprc
119 this%LOCAL_MESH_NUM_global = this%PRC_NUM * this%LOCAL_MESH_NUM
120
121 this%refElem => refelem
122
123 allocate( this%tileID_globalMap(nsidetile, this%LOCAL_MESH_NUM_global) )
124 allocate( this%tileFaceID_globalMap(nsidetile, this%LOCAL_MESH_NUM_global) )
125 allocate( this%tilePanelID_globalMap(nsidetile, this%LOCAL_MESH_NUM_global) )
126 allocate( this%tileID_global2localMap(this%LOCAL_MESH_NUM_global) )
127 allocate( this%PRCRank_globalMap(this%LOCAL_MESH_NUM_global) )
128 allocate( this%dimInfo(ndimtype) )
129 !$acc enter data create(this%tileID_globalMap, this%tileFaceID_globalMap, this%tilePanelID_globalMap, &
130 !$acc this%tileID_global2localMap, this%PRCRank_globalMap, this%dimInfo )
131
132 this%isGenerated = .false.
133
134 return

Referenced by scale_mesh_base1d::meshbase1d_init(), scale_mesh_base2d::meshbase2d_init(), scale_mesh_base3d::meshbase3d_init(), and scale_mesh_base::meshbase_get_localmesh::meshbase_get_localmesh().

◆ meshbase_final()

subroutine, public scale_mesh_base::meshbase_final ( class(meshbase), intent(inout) this)

Finalize an object to manage a computational mesh.

Definition at line 139 of file scale_mesh_base.F90.

140 implicit none
141 class(MeshBase), intent(inout) :: this
142 !-----------------------------------------------------------------------------
143
144 if ( allocated(this%tileID_globalMap) ) then
145 !$acc exit data delete(this%tileID_globalMap, this%tileFaceID_globalMap, this%tilePanelID_globalMap, &
146 !$acc this%tileID_global2localMap, this%PRCRank_globalMap, this%dimInfo)
147 deallocate( this%tileID_globalMap )
148 deallocate( this%tileFaceID_globalMap )
149 deallocate( this%tilePanelID_globalMap )
150 deallocate( this%tileID_global2localMap )
151 deallocate( this%PRCRank_globalMap )
152 deallocate( this%dimInfo )
153 end if
154 return

Referenced by scale_mesh_base1d::meshbase1d_final(), scale_mesh_base2d::meshbase2d_final(), scale_mesh_base3d::meshbase3d_final(), and scale_mesh_base::meshbase_get_localmesh::meshbase_get_localmesh().

◆ meshbase_setgeometricinfo()

subroutine, public scale_mesh_base::meshbase_setgeometricinfo ( class(localmeshbase), intent(inout) mesh,
integer, intent(in) ndim )

Definition at line 158 of file scale_mesh_base.F90.

161 implicit none
162
163 class(LocalMeshBase), intent(inout) :: mesh
164 integer, intent(in) :: ndim
165
166 class(ElementBase), pointer :: refElem
167 !-----------------------------------------------------------------------------
168
169 refelem => mesh%refElem
170
171 allocate( mesh%pos_en(refelem%Np,mesh%Ne,ndim) )
172 !allocate( mesh%fx(refElem%Nfaces*refElem%Nfp,mesh%Ne) )
173 !allocate( mesh%fy(refElem%Nfaces*refElem%Nfp,mesh%Ne) )
174 allocate( mesh%normal_fn(refelem%NfpTot,mesh%Ne,ndim) )
175 allocate( mesh%sJ(refelem%NfpTot,mesh%Ne) )
176 allocate( mesh%J(refelem%Np,mesh%Ne) )
177 allocate( mesh%Fscale(refelem%NfpTot,mesh%Ne) )
178 allocate( mesh%Escale(refelem%Np,mesh%Ne,ndim,ndim) )
179 allocate( mesh%Gsqrt(refelem%Np,mesh%NeA) )
180 !$acc enter data create(mesh%pos_en, mesh%normal_fn, mesh%sJ, mesh%J, &
181 !$acc mesh%Fscale, mesh%Escale, mesh%Gsqrt)
182
183 return
module FElib / Element / Base
module FElib / Mesh / Local 3D
Derived type representing a 3D reference element.
Derived type to manage a local 3D computational domain.

Referenced by scale_mesh_base1d::meshbase1d_setgeometricinfo(), scale_mesh_base2d::meshbase2d_setgeometricinfo(), scale_mesh_base3d::meshbase3d_setgeometricinfo(), and scale_mesh_base::meshbase_get_localmesh::meshbase_get_localmesh().