Skip to content

Commit 72cb0f2

Browse files
committed
fixup! Use Adapt.jl to change storage and element type
1 parent cedd86c commit 72cb0f2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/Trixi.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import SciMLBase: get_du, get_tmp_cache, u_modified!,
4343

4444
using DelimitedFiles: readdlm
4545
using Downloads: Downloads
46-
import Adapt
46+
using Adapt: Adapt
4747
using CodeTracking: CodeTracking
4848
using ConstructionBase: ConstructionBase
4949
using DiffEqCallbacks: PeriodicCallback, PeriodicCallbackAffect

src/solvers/dgsem_p4est/containers.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ mutable struct P4estInterfaceContainer{NDIMS, uEltype <: Real, NDIMSP2,
201201
uArray <: DenseArray{uEltype, NDIMSP2},
202202
IdsMatrix <: DenseMatrix{Int},
203203
IndicesMatrix <:
204-
DenseMatrix{NTuple{NDIMS, IndexInfo}},
204+
DenseMatrix{NTuple{NDIMS, Symbol}},
205205
uVector <: DenseVector{uEltype},
206206
IdsVector <: DenseVector{Int},
207207
IndicesVector <:
208-
DenseVector{NTuple{NDIMS, IndexInfo}},
208+
DenseVector{NTuple{NDIMS, Symbol}},
209209
ArrayType, Bool} <:
210210
AbstractHeterogeneousContainer{ArrayType, Bool}
211211
u::uArray # [primary/secondary, variable, i, j, interface]
@@ -270,7 +270,7 @@ function init_interfaces(mesh::Union{P4estMesh, T8codeMesh}, equations, basis, e
270270
_neighbor_ids = Vector{Int}(undef, 2 * n_interfaces)
271271
neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids), (2, n_interfaces))
272272

273-
_node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, 2 * n_interfaces)
273+
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_interfaces)
274274
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_interfaces))
275275

276276
interfaces = P4estInterfaceContainer{NDIMS, uEltype, NDIMS + 2,
@@ -328,7 +328,7 @@ mutable struct P4estBoundaryContainer{NDIMS, uEltype <: Real, NDIMSP1,
328328
uArray <: DenseArray{uEltype, NDIMSP1},
329329
IdsVector <: DenseVector{Int},
330330
IndicesVector <:
331-
DenseVector{NTuple{NDIMS, IndexInfo}},
331+
DenseVector{NTuple{NDIMS, Symbol}},
332332
uVector <: DenseVector{uEltype}, ArrayType,
333333
Bool} <:
334334
AbstractHeterogeneousContainer{ArrayType, Bool}
@@ -389,7 +389,7 @@ function init_boundaries(mesh::Union{P4estMesh, T8codeMesh}, equations, basis, e
389389
n_boundaries))
390390

391391
neighbor_ids = Vector{Int}(undef, n_boundaries)
392-
node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, n_boundaries)
392+
node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, n_boundaries)
393393
names = Vector{Symbol}(undef, n_boundaries)
394394

395395
boundaries = P4estBoundaryContainer{NDIMS, uEltype, NDIMS + 1, typeof(u),
@@ -491,11 +491,11 @@ mutable struct P4estMortarContainer{NDIMS, uEltype <: Real, NDIMSP1, NDIMSP3,
491491
uArray <: DenseArray{uEltype, NDIMSP3},
492492
IdsMatrix <: DenseMatrix{Int},
493493
IndicesMatrix <:
494-
DenseMatrix{NTuple{NDIMS, IndexInfo}},
494+
DenseMatrix{NTuple{NDIMS, Symbol}},
495495
uVector <: DenseVector{uEltype},
496496
IdsVector <: DenseVector{Int},
497497
IndicesVector <:
498-
DenseVector{NTuple{NDIMS, IndexInfo}},
498+
DenseVector{NTuple{NDIMS, Symbol}},
499499
ArrayType, Bool} <:
500500
AbstractHeterogeneousContainer{ArrayType, Bool}
501501
u::uArray # [small/large side, variable, position, i, j, mortar]
@@ -558,8 +558,8 @@ function init_mortars(mesh::Union{P4estMesh, T8codeMesh}, equations, basis, elem
558558
neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids),
559559
(2^(NDIMS - 1) + 1, n_mortars))
560560

561-
_node_indices = Vector{NTuple{NDIMS, IndexInfo}}(undef, 2 * n_mortars)
562-
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_mortars))
561+
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_mortars)
562+
node_indices = unsafe_wrap(Array, pointer(node_indices), (2, n_mortars))
563563

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

src/solvers/dgsem_p4est/containers_parallel.jl

+5-5
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)