@@ -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
@@ -142,11 +142,7 @@ function init_elements(mesh::Union{P4estMesh{NDIMS, NDIMS, RealT},
142142 return elements
143143end
144144
145- # Required methods due to <: AbstractHeterogeneousContainer
146- function KernelAbstractions. get_backend (elements:: P4estElementContainer )
147- return KernelAbstractions. get_backend (elements. node_coordinates)
148- end
149- # Adapt.@adapt_structure(P4estElementContainer)
145+ # Manual adapt_structure since we have aliasing memory
150146function Adapt. adapt_structure (to,
151147 elements:: P4estElementContainer{NDIMS, RealT, uEltype} ) where {
152148 NDIMS,
@@ -207,7 +203,7 @@ mutable struct P4estInterfaceContainer{NDIMS, uEltype <: Real, NDIMSP2,
207203 IndicesVector < :
208204 DenseVector{NTuple{NDIMS, Symbol}},
209205 ArrayType, Bool} < :
210- AbstractHeterogeneousContainer{ArrayType, Bool}
206+ AbstractContainer
211207 u:: uArray # [primary/secondary, variable, i, j, interface]
212208 neighbor_ids:: IdsMatrix # [primary/secondary, interface]
213209 node_indices:: IndicesMatrix # [primary/secondary, interface]
@@ -295,11 +291,7 @@ function init_interfaces!(interfaces, mesh::P4estMesh)
295291 return interfaces
296292end
297293
298- # Required methods due to <: AbstractHeterogeneousContainer
299- function KernelAbstractions. get_backend (interfaces:: P4estInterfaceContainer )
300- return KernelAbstractions. get_backend (interfaces. u)
301- end
302- # Adapt.@adapt_structure(P4estInterfaceContainer)
294+ # Manual adapt_structure since we have aliasing memory
303295function Adapt. adapt_structure (to, interfaces:: P4estInterfaceContainer )
304296 # Adapt underlying storage
305297 _u = Adapt. adapt_structure (to, interfaces. _u)
@@ -331,7 +323,7 @@ mutable struct P4estBoundaryContainer{NDIMS, uEltype <: Real, NDIMSP1,
331323 DenseVector{NTuple{NDIMS, Symbol}},
332324 uVector <: DenseVector{uEltype} , ArrayType,
333325 Bool} < :
334- AbstractHeterogeneousContainer{ArrayType, Bool}
326+ AbstractContainer
335327 u:: uArray # [variables, i, j, boundary]
336328 neighbor_ids:: IdsVector # [boundary]
337329 node_indices:: IndicesVector # [boundary]
@@ -443,11 +435,7 @@ function init_boundaries_iter_face_inner(info_pw, boundaries, boundary_id, mesh)
443435 return nothing
444436end
445437
446- # Required methods due to <: AbstractHeterogeneousContainer
447- function KernelAbstractions. get_backend (boundaries:: P4estBoundaryContainer )
448- return KernelAbstractions. get_backend (boundaries. u)
449- end
450- # Adapt.@adapt_structure(P4estBoundaryContainer)
438+ # Manual adapt_structure since we have aliasing memory
451439function Adapt. adapt_structure (to, boundaries:: P4estBoundaryContainer )
452440 _u = Adapt. adapt_structure (to, boundaries. _u)
453441 u = unsafe_wrap_or_alloc (to, _u, size (boundaries. u))
@@ -497,7 +485,7 @@ mutable struct P4estMortarContainer{NDIMS, uEltype <: Real, NDIMSP1, NDIMSP3,
497485 IndicesVector < :
498486 DenseVector{NTuple{NDIMS, Symbol}},
499487 ArrayType, Bool} < :
500- AbstractHeterogeneousContainer{ArrayType, Bool}
488+ AbstractContainer
501489 u:: uArray # [small/large side, variable, position, i, j, mortar]
502490 neighbor_ids:: IdsMatrix # [position, mortar]
503491 node_indices:: IndicesMatrix # [small/large, mortar]
@@ -584,11 +572,7 @@ function init_mortars!(mortars, mesh::P4estMesh)
584572 return mortars
585573end
586574
587- # Required methods due to <: AbstractHeterogeneousContainer
588- function KernelAbstractions. get_backend (mortars:: P4estMortarContainer )
589- return KernelAbstractions. get_backend (mortars. u)
590- end
591- # Adapt.@adapt_structure P4estMortarContainer
575+ # Manual adapt_structure since we have aliasing memory
592576function Adapt. adapt_structure (to, mortars:: P4estMortarContainer )
593577 # Adapt underlying storage
594578 _u = Adapt. adapt_structure (to, mortars. _u)
0 commit comments