@@ -145,17 +145,16 @@ end
145145
146146# Manual adapt_structure since we have aliasing memory
147147function Adapt. adapt_structure (to,
148- elements:: P4estElementContainer{NDIMS, RealT, uEltype} ) where {
149- NDIMS,
150- RealT,
151- uEltype
152- }
148+ elements:: P4estElementContainer{NDIMS} ) where {NDIMS}
153149 # Adapt underlying storage
154- _node_coordinates = Adapt. adapt_structure (to, elements. _node_coordinates)
155- _jacobian_matrix = Adapt. adapt_structure (to, elements. _jacobian_matrix)
156- _contravariant_vectors = Adapt. adapt_structure (to, elements. _contravariant_vectors)
157- _inverse_jacobian = Adapt. adapt_structure (to, elements. _inverse_jacobian)
158- _surface_flux_values = Adapt. adapt_structure (to, elements. _surface_flux_values)
150+ _node_coordinates = adapt (to, elements. _node_coordinates)
151+ _jacobian_matrix = adapt (to, elements. _jacobian_matrix)
152+ _contravariant_vectors = adapt (to, elements. _contravariant_vectors)
153+ _inverse_jacobian = adapt (to, elements. _inverse_jacobian)
154+ _surface_flux_values = adapt (to, elements. _surface_flux_values)
155+
156+ RealT = eltype (_inverse_jacobian)
157+ uEltype = eltype (_surface_flux_values)
159158
160159 # Wrap arrays again
161160 node_coordinates = unsafe_wrap_or_alloc (to, _node_coordinates,
@@ -180,8 +179,7 @@ function Adapt.adapt_structure(to,
180179 typeof (jacobian_matrix), # ArrayNDIMSP3
181180 typeof (_node_coordinates), # VectorRealT
182181 typeof (_surface_flux_values), # VectoruEltype
183- to,
184- true )
182+ to)
185183 return P4estElementContainer {new_type_params...} (node_coordinates,
186184 jacobian_matrix,
187185 contravariant_vectors,
296294# Manual adapt_structure since we have aliasing memory
297295function Adapt. adapt_structure (to, interfaces:: P4estInterfaceContainer )
298296 # Adapt underlying storage
299- _u = Adapt . adapt_structure (to, interfaces. _u)
300- _neighbor_ids = Adapt . adapt_structure (to, interfaces. _neighbor_ids)
301- _node_indices = Adapt . adapt_structure (to, interfaces. _node_indices)
297+ _u = adapt (to, interfaces. _u)
298+ _neighbor_ids = adapt (to, interfaces. _neighbor_ids)
299+ _node_indices = adapt (to, interfaces. _node_indices)
302300 # Wrap arrays again
303301 u = unsafe_wrap_or_alloc (to, _u, size (interfaces. u))
304302 neighbor_ids = unsafe_wrap_or_alloc (to, _neighbor_ids,
@@ -308,12 +306,11 @@ function Adapt.adapt_structure(to, interfaces::P4estInterfaceContainer)
308306
309307 NDIMS = ndims (interfaces)
310308 new_type_params = (NDIMS,
311- eltype (interfaces ),
309+ eltype (_u ),
312310 NDIMS + 2 ,
313311 typeof (u), typeof (neighbor_ids), typeof (node_indices),
314312 typeof (_u), typeof (_neighbor_ids), typeof (_node_indices),
315- to,
316- true )
313+ to)
317314 return P4estInterfaceContainer {new_type_params...} (u, neighbor_ids, node_indices,
318315 _u, _neighbor_ids, _node_indices)
319316end
@@ -439,16 +436,16 @@ end
439436
440437# Manual adapt_structure since we have aliasing memory
441438function Adapt. adapt_structure (to, boundaries:: P4estBoundaryContainer )
442- _u = Adapt . adapt_structure (to, boundaries. _u)
439+ _u = adapt (to, boundaries. _u)
443440 u = unsafe_wrap_or_alloc (to, _u, size (boundaries. u))
444- neighbor_ids = Adapt . adapt_structure (to, boundaries. neighbor_ids)
445- node_indices = Adapt . adapt_structure (to, boundaries. node_indices)
441+ neighbor_ids = adapt (to, boundaries. neighbor_ids)
442+ node_indices = adapt (to, boundaries. node_indices)
446443 name = boundaries. name
447444
448445 NDIMS = ndims (boundaries)
449- return P4estBoundaryContainer{NDIMS, eltype (boundaries ), NDIMS + 1 , typeof (u),
446+ return P4estBoundaryContainer{NDIMS, eltype (_u ), NDIMS + 1 , typeof (u),
450447 typeof (neighbor_ids), typeof (node_indices),
451- typeof (_u), to, true }(u, neighbor_ids, node_indices,
448+ typeof (_u), to}(u, neighbor_ids, node_indices,
452449 name, _u)
453450end
454451
578575# Manual adapt_structure since we have aliasing memory
579576function Adapt. adapt_structure (to, mortars:: P4estMortarContainer )
580577 # Adapt underlying storage
581- _u = Adapt . adapt_structure (to, mortars. _u)
582- _neighbor_ids = Adapt . adapt_structure (to, mortars. _neighbor_ids)
583- _node_indices = Adapt . adapt_structure (to, mortars. _node_indices)
578+ _u = adapt (to, mortars. _u)
579+ _neighbor_ids = adapt (to, mortars. _neighbor_ids)
580+ _node_indices = adapt (to, mortars. _node_indices)
584581
585582 # Wrap arrays again
586583 u = unsafe_wrap_or_alloc (to, _u, size (mortars. u))
@@ -589,13 +586,12 @@ function Adapt.adapt_structure(to, mortars::P4estMortarContainer)
589586
590587 NDIMS = ndims (mortars)
591588 new_type_params = (NDIMS,
592- eltype (mortars ),
589+ eltype (_u ),
593590 NDIMS + 1 ,
594591 NDIMS + 3 ,
595592 typeof (u), typeof (neighbor_ids), typeof (node_indices),
596593 typeof (_u), typeof (_neighbor_ids), typeof (_node_indices),
597- to,
598- true )
594+ to)
599595 return P4estMortarContainer {new_type_params...} (u, neighbor_ids, node_indices,
600596 _u, _neighbor_ids, _node_indices)
601597end
0 commit comments