FE-Project
Loading...
Searching...
No Matches
scale_localmesh_2d.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module FElib / Mesh / Local 2D
3!!
4!! @par Description
5!! Module to manage 2D local mesh for element-based methods
6!!
7!! @author Yuta Kawai, Team SCALE
8!<
9#include "scaleFElib.h"
11
12 !-----------------------------------------------------------------------------
13 !
14 !++ used modules
15 !
16 use scale_precision
17 use scale_localmesh_base, only: &
20
21 !-----------------------------------------------------------------------------
22 implicit none
23 private
24
25 !-----------------------------------------------------------------------------
26 !
27 !++ Public type & procedure
28 !
29 !> Derived type representing a local mesh for 2D domain
30 type, extends(localmeshbase), public :: localmesh2d
31 type(elementbase2d), pointer :: refelem2d !< Pointer to the reference element for 2D
32
33 real(rp) :: xmin !< Minimum x-coordinate of the local mesh
34 real(rp) :: xmax !< Maximum x-coordinate of the local mesh
35 real(rp) :: ymin !< Minimum y-coordinate of the local mesh
36 real(rp) :: ymax !< Maximum y-coordinate of the local mesh
37
38 integer :: nex !< Number of elements in the x-direction
39 integer :: ney !< Number of elements in the y-direction
40
41 real(rp), allocatable :: lon(:,:) !< Array to save longitude coordinates of the local mesh nodes
42 real(rp), allocatable :: lat(:,:) !< Array to save latitude coordinates of the local mesh nodes
43 end type localmesh2d
44
46
47 !-----------------------------------------------------------------------------
48 !
49 !++ Public parameters & variables
50 !
51
52 !-----------------------------------------------------------------------------
53 !
54 !++ Private procedure
55 !
56
57 !-----------------------------------------------------------------------------
58 !
59 !++ Private parameters & variables
60 !
61
62contains
63
64 !> Initialize an object to manage a local mesh for 2D domain
65!OCL SERIAL
66 subroutine localmesh2d_init( this, &
67 lcdomID, refElem, myrank )
68
69 implicit none
70
71 class(localmesh2d), intent(inout) :: this
72 integer, intent(in) :: lcdomid
73 class(elementbase2d), intent(in), target :: refelem
74 integer, intent(in), optional :: myrank
75 !-------------------------------------------------
76
77 this%refElem2D => refelem
78 call localmeshbase_init(this, lcdomid, refelem, 2, myrank)
79 !$acc enter data copyin(this)
80 return
81 end subroutine localmesh2d_init
82
83 !> Finalize an object to manage a local mesh for 2D domain
84!OCL SERIAL
85 subroutine localmesh2d_final( this, is_generated )
86 implicit none
87 type(localmesh2d), intent(inout) :: this
88 logical, intent(in) :: is_generated
89 !-------------------------------------------------
90
91 if (is_generated) then
92 !$acc exit data delete(this%G_ij, this%GIJ)
93 deallocate( this%G_ij, this%GIJ )
94 !$acc exit data delete(this%lon, this%lat)
95 deallocate( this%lon, this%lat )
96 end if
97 call localmeshbase_final( this, is_generated )
98 !$acc exit data delete(this)
99 return
100 end subroutine localmesh2d_final
101
102end module scale_localmesh_2d
module FElib / Element / Base
module FElib / Mesh / Local 2D
subroutine, public localmesh2d_final(this, is_generated)
Finalize an object to manage a local mesh for 2D domain.
subroutine, public localmesh2d_init(this, lcdomid, refelem, myrank)
Initialize an object to manage a local mesh for 2D domain.
module FElib / Mesh / Local, Base
subroutine, public localmeshbase_final(this, is_generated)
Finalize an object to manage a local computational mesh.
subroutine, public localmeshbase_init(this, lcdomid, refelem, ndim, myrank)
Setup an object to manage a local computational mesh.
Derived type representing a 2D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local computational domain (base type)