Skip to content

Commit

Permalink
Update to work with InboundsArray that is not an AbstractArray subtype
Browse files Browse the repository at this point in the history
  • Loading branch information
johnomotani committed Jan 27, 2025
1 parent a9edda0 commit aa13082
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions moment_kinetics/src/coordinates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export define_coordinate, write_coordinate
export equally_spaced_grid
export set_element_boundaries

using InboundsArrays: get_noninbounds
using InboundsArrays: get_noninbounds, AbstractInboundsArray
using LinearAlgebra
using ..type_definitions
using ..array_allocation: allocate_float, allocate_shared_float, allocate_int, allocate_shared_int
Expand All @@ -26,12 +26,14 @@ using OrderedCollections: OrderedDict
"""
structure containing basic information related to coordinates
"""
struct coordinate{Tshared <: AbstractVector{mk_float}, Tsharedi <: AbstractVector{mk_int},
Tunshared <: AbstractVector{mk_float},
Tunsharedi <: AbstractVector{mk_int},
Tunsharedmat <: AbstractMatrix{mk_float},
Tunsharedmati <: AbstractMatrix{mk_int},
Tunshared3 <: AbstractArray{mk_float,3}, Tbparams}
struct coordinate{Tshared <: Union{AbstractVector{mk_float}, AbstractInboundsArray{mk_float, 1}},
Tsharedi <: Union{AbstractVector{mk_int}, AbstractInboundsArray{mk_int, 1}},
Tunshared <: Union{AbstractVector{mk_float}, AbstractInboundsArray{mk_float, 1}},
Tunsharedi <: Union{AbstractVector{mk_int}, AbstractInboundsArray{mk_int, 1}},
Tunsharedmat <: Union{AbstractMatrix{mk_float}, AbstractInboundsArray{mk_float, 2}},
Tunsharedmati <: Union{AbstractMatrix{mk_int}, AbstractInboundsArray{mk_int, 2}},
Tunshared3 <: Union{AbstractArray{mk_float,3}, AbstractInboundsArray{mk_float, 3}},
Tbparams}
# name is the name of the variable associated with this coordiante
name::String
# n_global is the total number of grid points associated with this coordinate
Expand Down

0 comments on commit aa13082

Please sign in to comment.