Skip to content

Commit d4425de

Browse files
committed
fixup! Use Adapt.jl to change storage and element type
1 parent 5670d72 commit d4425de

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/Trixi.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import SciMLBase: get_du, get_tmp_cache, u_modified!,
4444

4545
using DelimitedFiles: readdlm
4646
using Downloads: Downloads
47-
import Adapt
47+
using Adapt: Adapt
4848
using CodeTracking: CodeTracking
4949
using ConstructionBase: ConstructionBase
5050
using DiffEqBase: DiffEqBase, get_tstops, get_tstops_array

src/solvers/dgsem_p4est/containers.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ mutable struct P4estInterfaceContainer{NDIMS, uEltype <: Real, NDIMSP2,
202202
uArray <: DenseArray{uEltype, NDIMSP2},
203203
IdsMatrix <: DenseMatrix{Int},
204204
IndicesMatrix <:
205-
DenseMatrix{NTuple{NDIMS, IndexInfo}},
205+
DenseMatrix{NTuple{NDIMS, Symbol}},
206206
uVector <: DenseVector{uEltype},
207207
IdsVector <: DenseVector{Int},
208208
IndicesVector <:
209-
DenseVector{NTuple{NDIMS, IndexInfo}},
209+
DenseVector{NTuple{NDIMS, Symbol}},
210210
ArrayType, Bool} <:
211211
AbstractHeterogeneousContainer{ArrayType, Bool}
212212
u::uArray # [primary/secondary, variable, i, j, interface]
@@ -272,7 +272,7 @@ function init_interfaces(mesh::Union{P4estMesh, P4estMeshView, T8codeMesh}, equa
272272
_neighbor_ids = Vector{Int}(undef, 2 * n_interfaces)
273273
neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids), (2, n_interfaces))
274274

275-
_node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, 2 * n_interfaces)
275+
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_interfaces)
276276
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_interfaces))
277277

278278
interfaces = P4estInterfaceContainer{NDIMS, uEltype, NDIMS + 2,
@@ -330,7 +330,7 @@ mutable struct P4estBoundaryContainer{NDIMS, uEltype <: Real, NDIMSP1,
330330
uArray <: DenseArray{uEltype, NDIMSP1},
331331
IdsVector <: DenseVector{Int},
332332
IndicesVector <:
333-
DenseVector{NTuple{NDIMS, IndexInfo}},
333+
DenseVector{NTuple{NDIMS, Symbol}},
334334
uVector <: DenseVector{uEltype}, ArrayType,
335335
Bool} <:
336336
AbstractHeterogeneousContainer{ArrayType, Bool}
@@ -392,7 +392,7 @@ function init_boundaries(mesh::Union{P4estMesh, P4estMeshView, T8codeMesh}, equa
392392
n_boundaries))
393393

394394
neighbor_ids = Vector{Int}(undef, n_boundaries)
395-
node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, n_boundaries)
395+
node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, n_boundaries)
396396
names = Vector{Symbol}(undef, n_boundaries)
397397

398398
boundaries = P4estBoundaryContainer{NDIMS, uEltype, NDIMS + 1, typeof(u),
@@ -494,11 +494,11 @@ mutable struct P4estMortarContainer{NDIMS, uEltype <: Real, NDIMSP1, NDIMSP3,
494494
uArray <: DenseArray{uEltype, NDIMSP3},
495495
IdsMatrix <: DenseMatrix{Int},
496496
IndicesMatrix <:
497-
DenseMatrix{NTuple{NDIMS, IndexInfo}},
497+
DenseMatrix{NTuple{NDIMS, Symbol}},
498498
uVector <: DenseVector{uEltype},
499499
IdsVector <: DenseVector{Int},
500500
IndicesVector <:
501-
DenseVector{NTuple{NDIMS, IndexInfo}},
501+
DenseVector{NTuple{NDIMS, Symbol}},
502502
ArrayType, Bool} <:
503503
AbstractHeterogeneousContainer{ArrayType, Bool}
504504
u::uArray # [small/large side, variable, position, i, j, mortar]
@@ -562,8 +562,8 @@ function init_mortars(mesh::Union{P4estMesh, P4estMeshView, T8codeMesh}, equatio
562562
neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids),
563563
(2^(NDIMS - 1) + 1, n_mortars))
564564

565-
_node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, 2 * n_mortars)
566-
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_mortars))
565+
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_mortars)
566+
node_indices = unsafe_wrap(Array, pointer(node_indices), (2, n_mortars))
567567

568568
mortars = P4estMortarContainer{NDIMS, uEltype, NDIMS + 1, NDIMS + 3, typeof(u),
569569
typeof(neighbor_ids), typeof(node_indices),

src/solvers/dgsem_p4est/containers_parallel.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mutable struct P4estMPIInterfaceContainer{NDIMS, uEltype <: Real, NDIMSP2,
99
uArray <: DenseArray{uEltype, NDIMSP2},
1010
VecInt <: DenseVector{Int},
1111
IndicesVector <:
12-
DenseVector{NTuple{NDIMS, IndexInfo}},
12+
DenseVector{NTuple{NDIMS, Symbol}},
1313
uVector <: DenseVector{uEltype},
1414
ArrayType, Bool} <:
1515
AbstractHeterogeneousContainer{ArrayType, Bool}
@@ -66,7 +66,7 @@ function init_mpi_interfaces(mesh::Union{ParallelP4estMesh, ParallelT8codeMesh},
6666

6767
local_neighbor_ids = Vector{Int}(undef, n_mpi_interfaces)
6868

69-
node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, n_mpi_interfaces)
69+
node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, n_mpi_interfaces)
7070

7171
local_sides = Vector{Int}(undef, n_mpi_interfaces)
7272

@@ -129,11 +129,11 @@ mutable struct P4estMPIMortarContainer{NDIMS, uEltype <: Real, RealT <: Real, ND
129129
u::uArray # [small/large side, variable, position, i, j, mortar]
130130
local_neighbor_ids::Vector{Vector{Int}} # [mortar][ids]
131131
local_neighbor_positions::Vector{Vector{Int}} # [mortar][positions]
132-
node_indices::Matrix{NTuple{NDIMS, IndexInfo}} # [small/large, mortar]
132+
node_indices::Matrix{NTuple{NDIMS, Symbol}} # [small/large, mortar]
133133
normal_directions::Array{RealT, NDIMSP2} # [dimension, i, j, position, mortar]
134134
# internal `resize!`able storage
135135
_u::uVector
136-
_node_indices::Vector{NTuple{NDIMS, IndexInfo}}
136+
_node_indices::Vector{NTuple{NDIMS, Symbol}}
137137
_normal_directions::Vector{RealT}
138138
end
139139

@@ -190,7 +190,7 @@ function init_mpi_mortars(mesh::Union{ParallelP4estMesh, ParallelT8codeMesh}, eq
190190
local_neighbor_ids = fill(Vector{Int}(), n_mpi_mortars)
191191
local_neighbor_positions = fill(Vector{Int}(), n_mpi_mortars)
192192

193-
_node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, 2 * n_mpi_mortars)
193+
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_mpi_mortars)
194194
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_mpi_mortars))
195195

196196
_normal_directions = Vector{RealT}(undef,

0 commit comments

Comments
 (0)