Initialize an object to manage multigrid field set in 2D.
100 implicit none
101 class(MGFieldSet2D), intent(inout), target :: this
102 class(MeshBase2D), intent(in) :: mesh2D
103 integer, intent(in) :: aux_scalar_num
104 integer, intent(in) :: aux_vec_num
105 integer, intent(in) :: level_id
106
107 integer :: iv
108
109 type(MeshFieldCommRectDom2D), pointer :: var_comm2D
110 type(MeshFieldCommRectDom2D), pointer :: aux_comm2D
111
112 type(MeshFieldCommCubedSphereDom2D), pointer :: var_comm2D_cs
113 type(MeshFieldCommCubedSphereDom2D), pointer :: aux_comm2D_cs
114
115
116 this%level_id = level_id
117
118 call this%dq%Init( "dq", "1", mesh2d )
119 call this%f%Init( "f", "1", mesh2d )
120 call this%res%Init( "res", "1", mesh2d )
121
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 )
127 end do
128 end if
129
130 select type(mesh2d)
132 allocate(var_comm2d)
133 call var_comm2d%Init( 1, 0, 0, mesh2d )
134 this%var_comm_ptr => var_comm2d
135 type is (meshcubedspheredom2d)
136 allocate(var_comm2d_cs)
137 call var_comm2d_cs%Init( 1, 0, 0, mesh2d )
138 this%var_comm_ptr => var_comm2d_cs
139 end select
140
141 if ( this%aux_var_num_tot > 0 ) then
142 select type(mesh2d)
144 allocate( aux_comm2d )
145 call aux_comm2d%Init( aux_scalar_num, aux_vec_num, 0, mesh2d )
146 this%aux_comm_ptr => aux_comm2d
147 type is (meshcubedspheredom2d)
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
151 end select
152 end if
153
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')
157 return
module FElib / Mesh / Rectangle 2D domain
Derived type to manage a rectangular 2D computational domain.