10#include "scaleFElib.h"
20 use scale_prc,
only: prc_abort
56 integer :: aux_var_num_tot
58 class(MeshFieldCommBase),
pointer :: var_comm_ptr
59 class(MeshFieldCommBase),
pointer :: aux_comm_ptr
74 procedure :: final => mgfieldset2d_final
89 procedure :: init => mgfieldset3d_init
90 procedure :: final => mgfieldset3d_final
103 integer,
intent(in) :: aux_scalar_num
104 integer,
intent(in) :: aux_vec_num
105 integer,
intent(in) :: level_id
116 this%level_id = level_id
118 call this%dq%Init(
"dq",
"1", mesh2d )
119 call this%f%Init(
"f",
"1", mesh2d )
120 call this%res%Init(
"res",
"1", mesh2d )
122 this%aux_var_num_tot = aux_scalar_num + 2*aux_vec_num
123 if ( this%aux_var_num_tot > 0 )
then
124 allocate( this%aux_var(this%aux_var_num_tot) )
125 do iv=1, this%aux_var_num_tot
126 call this%aux_var(iv)%Init(
"aux_var",
"1", mesh2d )
133 call var_comm2d%Init( 1, 0, 0, mesh2d )
134 this%var_comm_ptr => var_comm2d
136 allocate(var_comm2d_cs)
137 call var_comm2d_cs%Init( 1, 0, 0, mesh2d )
138 this%var_comm_ptr => var_comm2d_cs
141 if ( this%aux_var_num_tot > 0 )
then
144 allocate( aux_comm2d )
145 call aux_comm2d%Init( aux_scalar_num, aux_vec_num, 0, mesh2d )
146 this%aux_comm_ptr => aux_comm2d
148 allocate( aux_comm2d_cs )
149 call aux_comm2d_cs%Init( aux_scalar_num, aux_vec_num, 0, mesh2d )
150 this%aux_comm_ptr => aux_comm2d_cs
154 call this%Dx%Init( mesh2d%refElem2D%Dx1, storage_format=
'ELL')
155 call this%Dy%Init( mesh2d%refElem2D%Dx2, storage_format=
'ELL')
156 call this%Lift%Init( mesh2d%refElem2D%Lift, storage_format=
'ELL')
162 subroutine mgfieldset2d_final(this)
172 call this%res%Final()
174 select type(comm_ptr => this%var_comm_ptr)
176 call comm_ptr%Final()
178 call comm_ptr%Final()
180 deallocate(this%var_comm_ptr)
182 if ( this%aux_var_num_tot > 0 )
then
184 select type(comm_ptr => this%aux_comm_ptr)
186 call comm_ptr%Final()
188 call comm_ptr%Final()
190 deallocate(this%aux_comm_ptr)
192 do iv=1, this%aux_var_num_tot
193 call this%aux_var(iv)%Final()
201 end subroutine mgfieldset2d_final
206 subroutine mgfieldset3d_init(this, mesh3D, aux_scalar_num, aux_hvec_num, level_id)
211 integer,
intent(in) :: aux_scalar_num
212 integer,
intent(in) :: aux_hvec_num
213 integer,
intent(in) :: level_id
224 this%level_id = level_id
226 call this%dq%Init(
"dq",
"1", mesh3d )
227 call this%f%Init(
"f",
"1", mesh3d )
228 call this%res%Init(
"res",
"1", mesh3d )
230 this%aux_var_num_tot = aux_scalar_num + 2*aux_hvec_num
231 if ( this%aux_var_num_tot > 0 )
then
232 allocate( this%aux_var(this%aux_var_num_tot) )
233 do iv=1, this%aux_var_num_tot
234 call this%aux_var(iv)%Init(
"aux_var",
"1", mesh3d )
241 call var_comm3d%Init( 1, 0, 0, mesh3d )
242 this%var_comm_ptr => var_comm3d
244 allocate(var_comm3d_cs)
245 call var_comm3d_cs%Init( 1, 0, 0, mesh3d )
246 this%var_comm_ptr => var_comm3d_cs
250 if ( this%aux_var_num_tot > 0 )
then
253 allocate( aux_comm3d )
254 call aux_comm3d%Init( aux_scalar_num, aux_hvec_num, 0, mesh3d )
255 this%aux_comm_ptr => aux_comm3d
257 allocate( aux_comm3d_cs )
258 call aux_comm3d_cs%Init( aux_scalar_num, aux_hvec_num, 0, mesh3d )
259 this%aux_comm_ptr => aux_comm3d_cs
264 call this%Dx%Init( mesh3d%refElem3D%Dx1, storage_format=
'ELL')
265 call this%Dy%Init( mesh3d%refElem3D%Dx2, storage_format=
'ELL')
266 call this%Dz%Init( mesh3d%refElem3D%Dx3, storage_format=
'ELL')
267 call this%Lift%Init( mesh3d%refElem3D%Lift, storage_format=
'ELL')
269 end subroutine mgfieldset3d_init
273 subroutine mgfieldset3d_final(this)
283 call this%res%Final()
285 select type(comm_ptr => this%var_comm_ptr)
287 call comm_ptr%Final()
289 call comm_ptr%Final()
291 deallocate(this%var_comm_ptr)
293 if ( this%aux_var_num_tot > 0 )
then
295 select type(comm_ptr => this%aux_comm_ptr)
297 call comm_ptr%Final()
299 call comm_ptr%Final()
301 deallocate(this%aux_comm_ptr)
303 do iv=1, this%aux_var_num_tot
304 call this%aux_var(iv)%Final()
313 end subroutine mgfieldset3d_final
module FElib / Element / Base
module FElib / Element / Quadrilateral
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Cubic 3D domain
module FElib / Mesh / Cubed-sphere 2D domain
module FElib / Mesh / Cubed-sphere 3D domain
module FElib / Mesh / Rectangle 2D domain
module FElib / Data / base
module FElib / Data / Communication base
module FElib / Data / Communication 3D cubic domain
module FElib / Data / Communication in 2D cubed-sphere domain
module FElib / Data / Communication in 3D cubed-sphere domain
module FElib / Data / Communication 2D rectangle domain
module FElib / Multigrid / Field set base
subroutine mgfieldset2d_init(this, mesh2d, aux_scalar_num, aux_vec_num, level_id)
Initialize an object to manage multigrid field set in 2D.
Module common / sparsemat.
Derived type representing a 2D reference element.
Derived type representing a quadrilateral element.
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Derived type to manage a cubic 3D computational domain.
Derived type to manage a cubed-sphere 2D computational domain.
Derived type to manage a cubed-sphere 3D computational domain.
Derived type to manage a rectangular 2D computational domain.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Base derived type to manage data communication.
Base derived type to manage data communication with 3D cubic domain.
Base derived type to manage data communication with 2D cubed-sphere domain.
Base derived type to manage data communication with 3D cubed-sphere domain.
Base derived type to manage data communication with 2D rectangle domain.
Derived type for 2D multigrid field set.
Derived type for 3D multigrid field set.
Derived type to manage a sparse matrix.