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

module FElib / Mesh / Cubic 3D domain More...

Data Types

type  meshcubedom3d
 Derived type to manage a cubic 3D computational domain. More...

Functions/Subroutines

subroutine meshcubedom3d_init (this, negx, negy, negz, dom_xmin, dom_xmax, dom_ymin, dom_ymax, dom_zmin, dom_zmax, isperiodicx, isperiodicy, isperiodicz, refelem, nlocalmeshperprc, nprcx, nprcy, nproc, myrank, fz)
 Initialize an object to manage a cubic 3D domain.
subroutine, public meshcubedom3d_coord_conv (x, y, z, xx, xy, xz, yx, yy, yz, zx, zy, zz, vx, vy, vz, elem)

Detailed Description

module FElib / Mesh / Cubic 3D domain

Description
Manage mesh data of cubic 3D domain for element-based methods
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ meshcubedom3d_init()

subroutine scale_mesh_cubedom3d::meshcubedom3d_init ( class(meshcubedom3d), intent(inout) this,
integer, intent(in) negx,
integer, intent(in) negy,
integer, intent(in) negz,
real(rp), intent(in) dom_xmin,
real(rp), intent(in) dom_xmax,
real(rp), intent(in) dom_ymin,
real(rp), intent(in) dom_ymax,
real(rp), intent(in) dom_zmin,
real(rp), intent(in) dom_zmax,
logical, intent(in) isperiodicx,
logical, intent(in) isperiodicy,
logical, intent(in) isperiodicz,
type(hexahedralelement), intent(in), target refelem,
integer, intent(in) nlocalmeshperprc,
integer, intent(in) nprcx,
integer, intent(in) nprcy,
integer, intent(in), optional nproc,
integer, intent(in), optional myrank,
real(rp), dimension(negz+1), intent(in), optional fz )

Initialize an object to manage a cubic 3D domain.

Parameters
[in]negxNumber of elements in X direction for the global mesh
[in]negyNumber of elements in Y direction for the global mesh
[in]negzNumber of elements in Z direction for the global mesh
[in]dom_xminMinimum X coordinate of the global domain
[in]dom_xmaxMaximum X coordinate of the global domain
[in]dom_yminMinimum Y coordinate of the global domain
[in]dom_ymaxMaximum Y coordinate of the global domain
[in]dom_zminMinimum Z coordinate of the global domain
[in]dom_zmaxMaximum Z coordinate of the global domain
[in]isperiodicxFlag whether the domain is periodic in X direction
[in]isperiodicyFlag whether the domain is periodic in Y direction
[in]isperiodiczFlag whether the domain is periodic in Z direction
[in]refelemReference element for the 3D mesh
[in]nlocalmeshperprcNumber of local meshes managed by each process
[in]nprcxNumber of processes in X direction for domain decomposition
[in]nprcyNumber of processes in Y direction for domain decomposition
[in]nprocTotal number of processes (if not provided, it will be determined from the parallel environment)
[in]myrankRank of the current process (if not provided, it will be determined from the parallel environment)
[in]fzOptional array of Z coordinates for the mesh

Definition at line 100 of file scale_mesh_cubedom3d.F90.

107
108 implicit none
109
110 class(MeshCubeDom3D), intent(inout) :: this
111 integer, intent(in) :: NeGX !< Number of elements in X direction for the global mesh
112 integer, intent(in) :: NeGY !< Number of elements in Y direction for the global mesh
113 integer, intent(in) :: NeGZ !< Number of elements in Z direction for the global mesh
114 real(RP), intent(in) :: dom_xmin !< Minimum X coordinate of the global domain
115 real(RP), intent(in) :: dom_xmax !< Maximum X coordinate of the global domain
116 real(RP), intent(in) :: dom_ymin !< Minimum Y coordinate of the global domain
117 real(RP), intent(in) :: dom_ymax !< Maximum Y coordinate of the global domain
118 real(RP), intent(in) :: dom_zmin !< Minimum Z coordinate of the global domain
119 real(RP), intent(in) :: dom_zmax !< Maximum Z coordinate of the global domain
120 logical, intent(in) :: isPeriodicX !< Flag whether the domain is periodic in X direction
121 logical, intent(in) :: isPeriodicY !< Flag whether the domain is periodic in Y direction
122 logical, intent(in) :: isPeriodicZ !< Flag whether the domain is periodic in Z direction
123 type(HexahedralElement), intent(in), target :: refElem !< Reference element for the 3D mesh
124 integer, intent(in) :: NLocalMeshPerPrc !< Number of local meshes managed by each process
125 integer, intent(in) :: NprcX !< Number of processes in X direction for domain decomposition
126 integer, intent(in) :: NprcY !< Number of processes in Y direction for domain decomposition
127 integer, intent(in), optional :: nproc !< Total number of processes (if not provided, it will be determined from the parallel environment)
128 integer, intent(in), optional :: myrank !< Rank of the current process (if not provided, it will be determined from the parallel environment)
129 real(RP), intent(in), optional :: FZ(NeGZ+1) !< Optional array of Z coordinates for the mesh
130
131 integer :: k
132 real(RP) :: dz
133 !-----------------------------------------------------------------------------
134
135 this%NeGX = negx
136 this%NeGY = negy
137 this%NeGZ = negz
138
139 this%xmin_gl = dom_xmin
140 this%xmax_gl = dom_xmax
141 this%ymin_gl = dom_ymin
142 this%ymax_gl = dom_ymax
143 this%zmin_gl = dom_zmin
144 this%zmax_gl = dom_zmax
145 this%dom_vol = (this%xmax_gl - this%xmin_gl) * (this%ymax_gl - this%ymin_gl) * (this%zmax_gl - this%zmin_gl)
146
147 this%isPeriodicX = isperiodicx
148 this%isPeriodicY = isperiodicy
149 this%isPeriodicZ = isperiodicz
150
151 this%NprcX = nprcx
152 this%NprcY = nprcy
153 this%NprcZ = 1
154
155 !- Fz
156 allocate( this%FZ(this%NeGZ+1) )
157 if ( present(fz) ) then
158 this%FZ(:) = fz(:)
159 else
160 this%FZ(1 ) = dom_zmin
161 this%FZ(this%NeGZ+1) = dom_zmax
162 dz = (dom_zmax - dom_zmin) / dble(this%NeGZ)
163 do k=2, this%NeGZ
164 this%FZ(k) = this%FZ(k-1) + dz
165 end do
166 end if
167
168 !--
169 call meshbase3d_init( this, refelem, nlocalmeshperprc, 6, &
170 nproc, myrank )
171
172 !--- 2D mesh
173
174 call this%refElem2D%Init( this%refElem3D%PolyOrder_h, refelem%IsLumpedMatrix() )
175
176 call this%mesh2D%Init( this%NeGX, this%NeGY, dom_xmin, dom_xmax, dom_ymin, dom_ymax, &
177 isperiodicx, isperiodicy, this%refElem2D, nlocalmeshperprc, &
178 nprcx, nprcy, nproc, myrank )
179
180 return

References scale_localmesh_base::bctype_interior, scale_mesh_base3d::meshbase3d_final(), scale_mesh_base3d::meshbase3d_init(), scale_mesh_base3d::meshbase3d_setgeometricinfo(), meshcubedom3d_coord_conv(), scale_mesh_rectdom2d::meshrectdom2d_setuplocaldom(), scale_meshutil_3d::meshutil3d_buildglobalmap(), scale_meshutil_3d::meshutil3d_buildinteriormap(), scale_meshutil_3d::meshutil3d_genconnectivity(), scale_meshutil_3d::meshutil3d_gencubedomain(), and scale_meshutil_3d::meshutil3d_genpatchboundarymap().

◆ meshcubedom3d_coord_conv()

subroutine, public scale_mesh_cubedom3d::meshcubedom3d_coord_conv ( real(rp), dimension(elem%np), intent(out) x,
real(rp), dimension(elem%np), intent(out) y,
real(rp), dimension(elem%np), intent(out) z,
real(rp), dimension(elem%np), intent(out) xx,
real(rp), dimension(elem%np), intent(out) xy,
real(rp), dimension(elem%np), intent(out) xz,
real(rp), dimension(elem%np), intent(out) yx,
real(rp), dimension(elem%np), intent(out) yy,
real(rp), dimension(elem%np), intent(out) yz,
real(rp), dimension(elem%np), intent(out) zx,
real(rp), dimension(elem%np), intent(out) zy,
real(rp), dimension(elem%np), intent(out) zz,
real(rp), dimension(elem%nv), intent(in) vx,
real(rp), dimension(elem%nv), intent(in) vy,
real(rp), dimension(elem%nv), intent(in) vz,
type(elementbase3d), intent(in) elem )

Definition at line 547 of file scale_mesh_cubedom3d.F90.

549
550 implicit none
551
552 type(ElementBase3D), intent(in) :: elem
553 real(RP), intent(out) :: x(elem%Np), y(elem%Np), z(elem%Np)
554 real(RP), intent(out) :: xX(elem%Np), xY(elem%Np), xZ(elem%Np)
555 real(RP), intent(out) :: yX(elem%Np), yY(elem%Np), yZ(elem%Np)
556 real(RP), intent(out) :: zX(elem%Np), zY(elem%Np), zZ(elem%Np)
557 real(RP), intent(in) :: vx(elem%Nv), vy(elem%Nv), vz(elem%Nv)
558
559 !-------------------------------------------------
560
561 x(:) = vx(1) + 0.5_rp*(elem%x1(:) + 1.0_rp)*(vx(2) - vx(1))
562 y(:) = vy(1) + 0.5_rp*(elem%x2(:) + 1.0_rp)*(vy(3) - vy(1))
563 z(:) = vz(1) + 0.5_rp*(elem%x3(:) + 1.0_rp)*(vz(5) - vz(1))
564
565 xx(:) = 0.5_rp*(vx(2) - vx(1)) !matmul(refElem%Dx1,mesh%x1(:,n))
566 xy(:) = 0.0_rp !matmul(refElem%Dx2,mesh%x1(:,n))
567 xz(:) = 0.0_rp !matmul(refElem%Dx3,mesh%x1(:,n))
568 yx(:) = 0.0_rp !matmul(refElem%Dx1,mesh%x2(:,n))
569 yy(:) = 0.5_rp*(vy(3) - vy(1)) !matmul(refElem%Dx2,mesh%x2(:,n))
570 yz(:) = 0.0_rp !matmul(refElem%Dx3,mesh%x2(:,n))
571 zx(:) = 0.0_rp !matmul(refElem%Dx1,mesh%x3(:,n))
572 zy(:) = 0.0_rp !matmul(refElem%Dx2,mesh%x3(:,n))
573 zz(:) = 0.5_rp*(vz(5) - vz(1)) !matmul(refElem%Dx3,mesh%x3(:,n))
574
575 return

Referenced by meshcubedom3d_init(), and scale_mesh_cubedom3d::meshcubedom3d::set_geometric_with_vcoord().