FE-Project
Loading...
Searching...
No Matches
scale_mesh_linedom1d.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module FElib / Mesh / 1D domain
3!!
4!! @par Description
5!! Manage mesh data of 1D domain for element-based methods
6!!
7!! @author Yuta Kawai, Team SCALE
8!<
9!-------------------------------------------------------------------------------
10#include "scaleFElib.h"
12
13 !-----------------------------------------------------------------------------
14 !
15 !++ used modules
16 !
17 use scale_precision
18
19 use scale_mesh_base1d, only: &
22
26
27 !-----------------------------------------------------------------------------
28 implicit none
29 private
30
31 !-----------------------------------------------------------------------------
32 !
33 !++ Public type & procedure
34 !
35 type, extends(meshbase1d), public :: meshlinedom1d
36 contains
37 procedure :: init => meshlinedom1d_init
38 procedure :: final => meshlinedom1d_final
39 procedure :: generate => meshlinedom1d_generate
40 end type meshlinedom1d
41
44
45 !-----------------------------------------------------------------------------
46 !
47 !++ Public parameters & variables
48 !
49
50 !-----------------------------------------------------------------------------
51 !
52 !++ Private procedure
53 !
54
55 !-----------------------------------------------------------------------------
56 !
57 !++ Private parameters & variables
58 !
59
60contains
61 !> Initialize an object to manage a 1D domain
62 subroutine meshlinedom1d_init(this, & ! (inout)
63 neg, & ! (in)
64 dom_xmin, dom_xmax, & ! (in)
65 refelem, nlocalmeshperprc, & ! (in)
66 nproc, myrank, fx ) ! (in)
67
68 implicit none
69
70 class(meshlinedom1d), intent(inout) :: this
71 integer, intent(in) :: neg !< Total number of elements in the 1D domain
72 real(rp), intent(in) :: dom_xmin !< Minimum coordinate of the 1D domain
73 real(rp), intent(in) :: dom_xmax !< Maximum coordinate of the 1D domain
74 type(lineelement), intent(in), target :: refelem !< Reference element for the 1D mesh
75 integer, intent(in) :: nlocalmeshperprc !< Number of local meshes managed by each process
76 integer, intent(in), optional :: nproc !< Total number of processes (if not provided, it will be determined internally)
77 integer, intent(in), optional :: myrank !< Rank of the current process (if not provided, it will be determined internally)
78 real(rp), intent(in), optional :: fx(neg+1) !< Coordinates of the element boundaries (if not provided, they will be generated internally)
79 !-----------------------------------------------------------------------------
80
81 call meshbase1d_init(this, &
82 neg, &
83 dom_xmin, dom_xmax, &
84 refelem, nlocalmeshperprc, &
85 nproc, myrank, fx )
86
87 this%dom_vol = (this%xmax_gl - this%xmin_gl)
88
89 end subroutine meshlinedom1d_init
90
91 !> Finalize an object to manage a 1D domain
92 subroutine meshlinedom1d_final( this ) ! (inout)
93 implicit none
94 class(meshlinedom1d), intent(inout) :: this
95 !-----------------------------------------------------------------------------
96
97 call meshbase1d_final(this)
98
99 end subroutine meshlinedom1d_final
100
101 !> Generate meshes for the 1D domain
102!OCL SERIAL
103 subroutine meshlinedom1d_generate( this ) ! (inout)
104 implicit none
105 class(meshlinedom1d), intent(inout), target :: this
106
107 integer :: n
108 integer :: p
109 type(localmesh1d), pointer :: mesh
110
111 integer :: tileid_table(this%local_mesh_num, this%prc_num)
112 integer :: panelid_table(this%local_mesh_num*this%prc_num)
113 integer :: pi_table(this%local_mesh_num*this%prc_num)
114
115 !integer :: TILE_NUM_PER_PANEL
116 integer :: tileid
117
118 !-----------------------------------------------------------------------------
119
120 ! TILE_NUM_PER_PANEL = this%LOCAL_MESH_NUM_global / 1
121
122
123 !--- Construct the connectivity of patches (only master node)
124
125 call meshbase1d_assigndomid( this, & ! (in)
126 tileid_table, panelid_table, & ! (out)
127 pi_table ) ! (out)
128
129 !--- Setup local meshes managed by my process
130
131 do n=1, this%LOCAL_MESH_NUM
132 mesh => this%lcmesh_list(n)
133 tileid = tileid_table(n, mesh%PRC_myrank+1)
134 call meshbase1d_setuplocaldom( mesh, & ! (inout)
135 tileid, panelid_table(tileid), & ! (in)
136 pi_table(tileid), this%Nprc, & ! (in)
137 this%xmin_gl, this%xmax_gl, & ! (in)
138 this%NeG / this%Nprc, this%FX(:) ) ! (in)
139
140 !---
141 ! write(*,*) "** my_rank=", mesh%PRC_myrank
142 ! write(*,*) " tileID:", mesh%tileID
143 ! write(*,*) " pnlID:", mesh%panelID, "-- i (within a panel)=", pi_table(tileID)
144 ! write(*,*) " local mesh:", n, "( total", this%LOCAL_MESH_NUM, ")"
145 ! write(*,*) " panel_connect:", this%tilePanelID_globalMap(:,mesh%tileID)
146 ! write(*,*) " tile_connect:", this%tileID_globalMap(:,mesh%tileID)
147 ! write(*,*) " face_connect:", this%tileFaceID_globalMap(:,mesh%tileID)
148 ! write(*,*) " domain size"
149 ! write(*,*) " NeX:", mesh%Ne
150 ! write(*,*) " [X]:", mesh%xmin, mesh%xmax
151 end do
152
153 this%isGenerated = .true.
154
155 return
156 end subroutine meshlinedom1d_generate
157
158 !-------------------------------------------------
159end module scale_mesh_linedom1d
module FElib / Element / Base
module FElib / Element / line
module FElib / Mesh / Local 1D
module FElib / Mesh / Base 1D
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.
subroutine, public meshbase1d_assigndomid(this, tileid_table, panelid_table, pi_table)
subroutine, public meshbase1d_setgeometricinfo(lcmesh)
subroutine, public meshbase1d_setuplocaldom(lcmesh, tileid, panelid, i, nprc, dom_xmin, dom_xmax, ne, fx)
module FElib / Mesh / 1D domain
subroutine, public meshlinedom1d_generate(this)
Generate meshes for the 1D domain.
subroutine, public meshlinedom1d_final(this)
Finalize an object to manage a 1D domain.
subroutine, public meshlinedom1d_init(this, neg, dom_xmin, dom_xmax, refelem, nlocalmeshperprc, nproc, myrank, fx)
Initialize an object to manage a 1D domain.
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 computational mesh (base type for 1D domain)