@@ -228,6 +228,50 @@ function Box3DGrid(
228
228
)
229
229
end
230
230
231
+ """
232
+ SliceXMesh(
233
+ ::Type{<:AbstractFloat}; # defaults to Float64
234
+ x_min::Real,
235
+ x_max::Real,
236
+ z_min::Real,
237
+ z_max::Real,
238
+ periodic_x::Bool,
239
+ n_quad_points::Integer,
240
+ x_elem::Integer,
241
+ device::ClimaComms.AbstractDevice = ClimaComms.device(),
242
+ context::ClimaComms.AbstractCommsContext = ClimaComms.context(device),
243
+ stretch::Meshes.StretchingRule = Meshes.Uniform(),
244
+ hypsography::HypsographyAdaption = Flat(),
245
+ global_geometry::Geometry.AbstractGlobalGeometry = Geometry.CartesianGlobalGeometry(),
246
+ quad::Quadratures.QuadratureStyle = Quadratures.GLL{n_quad_points}(),
247
+ )
248
+
249
+ A convenience constructor, which builds a
250
+ `ExtrudedFiniteDifferenceGrid` with a
251
+ `FiniteDifferenceGrid` vertical grid and a
252
+ `SpectralElementGrid1D` horizontal grid.
253
+ - ``
254
+ """
255
+ SliceXMesh (; kwargs... ) = SliceXMesh (Float64; kwargs... )
256
+ function SliceXMesh (
257
+ :: Type{FT} ;
258
+ x_min:: Real ,
259
+ x_max:: Real ,
260
+ periodic_x:: Bool ,
261
+ x_elem:: Integer ,
262
+ ) where {FT}
263
+
264
+ x1boundary = (:east , :west )
265
+ z_boundary_names = (:bottom , :top )
266
+ h_domain = Domains. IntervalDomain (
267
+ Geometry. XPoint {FT} (x_min),
268
+ Geometry. XPoint {FT} (x_max);
269
+ periodic = periodic_x,
270
+ boundary_names = (:east , :west ),
271
+ )
272
+ return Meshes. IntervalMesh (h_domain; nelems = x_elem)
273
+ end
274
+
231
275
"""
232
276
SliceXZGrid(
233
277
::Type{<:AbstractFloat}; # defaults to Float64
@@ -271,22 +315,15 @@ function SliceXZGrid(
271
315
global_geometry:: Geometry.AbstractGlobalGeometry = Geometry. CartesianGlobalGeometry (),
272
316
quad:: Quadratures.QuadratureStyle = Quadratures. GLL {n_quad_points} (),
273
317
horizontal_layout_type = DataLayouts. IFH,
318
+ h_mesh:: Meshes.IntervalMesh = SliceXMesh (FT; x_min,x_max,periodic_x,x_elem),
274
319
) where {FT}
275
320
@assert horizontal_layout_type <: DataLayouts.AbstractData
276
321
check_device_context (context, device)
277
322
278
- x1boundary = (:east , :west )
279
- z_boundary_names = (:bottom , :top )
280
- h_domain = Domains. IntervalDomain (
281
- Geometry. XPoint {FT} (x_min),
282
- Geometry. XPoint {FT} (x_max);
283
- periodic = periodic_x,
284
- boundary_names = x1boundary,
285
- )
286
- h_mesh = Meshes. IntervalMesh (h_domain; nelems = x_elem)
287
323
h_topology = Topologies. IntervalTopology (context, h_mesh)
288
324
h_grid =
289
325
Grids. SpectralElementGrid1D (h_topology, quad; horizontal_layout_type)
326
+ z_boundary_names = (:bottom , :top )
290
327
z_domain = Domains. IntervalDomain (
291
328
Geometry. ZPoint {FT} (z_min),
292
329
Geometry. ZPoint {FT} (z_max);
0 commit comments