@@ -13,7 +13,7 @@ mutable struct P4estElementContainer{NDIMS, RealT <: Real, uEltype <: Real, NDIM
1313 VectorRealT <: DenseVector{RealT} ,
1414 VectoruEltype <: DenseVector{uEltype} ,
1515 ArrayType, Bool} < :
16- AbstractHeterogeneousContainer{ArrayType, Bool}
16+ AbstractContainer
1717 # Physical coordinates at each node
1818 node_coordinates:: ArrayNDIMSP2 # [orientation, node_i, node_j, node_k, element]
1919 # Jacobian matrix of the transformation
@@ -143,11 +143,7 @@ function init_elements(mesh::Union{P4estMesh{NDIMS, NDIMS, RealT},
143143 return elements
144144end
145145
146- # Required methods due to <: AbstractHeterogeneousContainer
147- function KernelAbstractions. get_backend (elements:: P4estElementContainer )
148- return KernelAbstractions. get_backend (elements. node_coordinates)
149- end
150- # Adapt.@adapt_structure(P4estElementContainer)
146+ # Manual adapt_structure since we have aliasing memory
151147function Adapt. adapt_structure (to,
152148 elements:: P4estElementContainer{NDIMS, RealT, uEltype} ) where {
153149 NDIMS,
@@ -208,7 +204,7 @@ mutable struct P4estInterfaceContainer{NDIMS, uEltype <: Real, NDIMSP2,
208204 IndicesVector < :
209205 DenseVector{NTuple{NDIMS, Symbol}},
210206 ArrayType, Bool} < :
211- AbstractHeterogeneousContainer{ArrayType, Bool}
207+ AbstractContainer
212208 u:: uArray # [primary/secondary, variable, i, j, interface]
213209 neighbor_ids:: IdsMatrix # [primary/secondary, interface]
214210 node_indices:: IndicesMatrix # [primary/secondary, interface]
@@ -297,11 +293,7 @@ function init_interfaces!(interfaces, mesh::Union{P4estMesh, P4estMeshView})
297293 return interfaces
298294end
299295
300- # Required methods due to <: AbstractHeterogeneousContainer
301- function KernelAbstractions. get_backend (interfaces:: P4estInterfaceContainer )
302- return KernelAbstractions. get_backend (interfaces. u)
303- end
304- # Adapt.@adapt_structure(P4estInterfaceContainer)
296+ # Manual adapt_structure since we have aliasing memory
305297function Adapt. adapt_structure (to, interfaces:: P4estInterfaceContainer )
306298 # Adapt underlying storage
307299 _u = Adapt. adapt_structure (to, interfaces. _u)
@@ -333,7 +325,7 @@ mutable struct P4estBoundaryContainer{NDIMS, uEltype <: Real, NDIMSP1,
333325 DenseVector{NTuple{NDIMS, Symbol}},
334326 uVector <: DenseVector{uEltype} , ArrayType,
335327 Bool} < :
336- AbstractHeterogeneousContainer{ArrayType, Bool}
328+ AbstractContainer
337329 u:: uArray # [variables, i, j, boundary]
338330 neighbor_ids:: IdsVector # [boundary]
339331 node_indices:: IndicesVector # [boundary]
@@ -446,11 +438,7 @@ function init_boundaries_iter_face_inner(info_pw, boundaries, boundary_id, mesh)
446438 return nothing
447439end
448440
449- # Required methods due to <: AbstractHeterogeneousContainer
450- function KernelAbstractions. get_backend (boundaries:: P4estBoundaryContainer )
451- return KernelAbstractions. get_backend (boundaries. u)
452- end
453- # Adapt.@adapt_structure(P4estBoundaryContainer)
441+ # Manual adapt_structure since we have aliasing memory
454442function Adapt. adapt_structure (to, boundaries:: P4estBoundaryContainer )
455443 _u = Adapt. adapt_structure (to, boundaries. _u)
456444 u = unsafe_wrap_or_alloc (to, _u, size (boundaries. u))
@@ -500,7 +488,7 @@ mutable struct P4estMortarContainer{NDIMS, uEltype <: Real, NDIMSP1, NDIMSP3,
500488 IndicesVector < :
501489 DenseVector{NTuple{NDIMS, Symbol}},
502490 ArrayType, Bool} < :
503- AbstractHeterogeneousContainer{ArrayType, Bool}
491+ AbstractContainer
504492 u:: uArray # [small/large side, variable, position, i, j, mortar]
505493 neighbor_ids:: IdsMatrix # [position, mortar]
506494 node_indices:: IndicesMatrix # [small/large, mortar]
@@ -588,11 +576,7 @@ function init_mortars!(mortars, mesh::Union{P4estMesh, P4estMeshView})
588576 return mortars
589577end
590578
591- # Required methods due to <: AbstractHeterogeneousContainer
592- function KernelAbstractions. get_backend (mortars:: P4estMortarContainer )
593- return KernelAbstractions. get_backend (mortars. u)
594- end
595- # Adapt.@adapt_structure P4estMortarContainer
579+ # Manual adapt_structure since we have aliasing memory
596580function Adapt. adapt_structure (to, mortars:: P4estMortarContainer )
597581 # Adapt underlying storage
598582 _u = Adapt. adapt_structure (to, mortars. _u)
0 commit comments