11using DiffEqBase, ClimaTimeSteppers, LinearAlgebra, StaticArrays
22using ClimaCore
3+ import ClimaCore. Device as Device
34import ClimaCore. Domains as Domains
45import ClimaCore. Geometry as Geometry
56import ClimaCore. Meshes as Meshes
428429
4294302D diffusion test problem. See [`2D diffusion problem`](@ref) for more details.
430431"""
431- function climacore_2Dheat_test_cts (:: Type{FT} ) where {FT}
432+ function climacore_2Dheat_test_cts (:: Type{FT} ; print_arr_type = false ) where {FT}
432433 dss_tendency = true
433434
435+ device = Device. device ()
436+ context = ClimaComms. SingletonCommsContext (device)
437+
438+ if print_arr_type
439+ @info " Array type: $(Device. device_array_type (device)) "
440+ end
441+
434442 n_elem_x = 2
435443 n_elem_y = 2
436444 n_poly = 2
@@ -445,13 +453,17 @@ function climacore_2Dheat_test_cts(::Type{FT}) where {FT}
445453 Domains. IntervalDomain (Geometry. YPoint (FT (0 )), Geometry. YPoint (FT (1 )), periodic = true ),
446454 )
447455 mesh = Meshes. RectilinearMesh (domain, n_elem_x, n_elem_y)
448- topology = Topologies. Topology2D (mesh)
456+ topology = Topologies. Topology2D (context, mesh)
449457 quadrature = Spaces. Quadratures. GLL {n_poly + 1} ()
450458 space = Spaces. SpectralElementSpace2D (topology, quadrature)
451459 (; x, y) = Fields. coordinate_field (space)
452460
453461 λ = (2 * FT (π))^ 2 * (n_x^ 2 + n_y^ 2 )
454- φ_sin_sin = @. sin (2 * FT (π) * n_x * x) * sin (2 * FT (π) * n_y * y)
462+
463+ # Revert once https://github.com/CliMA/ClimaCore.jl/issues/1097
464+ # is fixed
465+ # φ_sin_sin = @. sin(2 * FT(π) * n_x * x) * sin(2 * FT(π) * n_y * y)
466+ φ_sin_sin = @. sin (2 * π * n_x * x) * sin (2 * π * n_y * y)
455467
456468 init_state = Fields. FieldVector (; u = φ_sin_sin)
457469
0 commit comments