@@ -144,17 +144,16 @@ end
144144
145145# Manual adapt_structure since we have aliasing memory
146146function Adapt. adapt_structure (to,
147- elements:: P4estElementContainer{NDIMS, RealT, uEltype} ) where {
148- NDIMS,
149- RealT,
150- uEltype
151- }
147+ elements:: P4estElementContainer{NDIMS} ) where {NDIMS}
152148 # Adapt underlying storage
153- _node_coordinates = Adapt. adapt_structure (to, elements. _node_coordinates)
154- _jacobian_matrix = Adapt. adapt_structure (to, elements. _jacobian_matrix)
155- _contravariant_vectors = Adapt. adapt_structure (to, elements. _contravariant_vectors)
156- _inverse_jacobian = Adapt. adapt_structure (to, elements. _inverse_jacobian)
157- _surface_flux_values = Adapt. adapt_structure (to, elements. _surface_flux_values)
149+ _node_coordinates = adapt (to, elements. _node_coordinates)
150+ _jacobian_matrix = adapt (to, elements. _jacobian_matrix)
151+ _contravariant_vectors = adapt (to, elements. _contravariant_vectors)
152+ _inverse_jacobian = adapt (to, elements. _inverse_jacobian)
153+ _surface_flux_values = adapt (to, elements. _surface_flux_values)
154+
155+ RealT = eltype (_inverse_jacobian)
156+ uEltype = eltype (_surface_flux_values)
158157
159158 # Wrap arrays again
160159 node_coordinates = unsafe_wrap_or_alloc (to, _node_coordinates,
@@ -179,8 +178,7 @@ function Adapt.adapt_structure(to,
179178 typeof (jacobian_matrix), # ArrayNDIMSP3
180179 typeof (_node_coordinates), # VectorRealT
181180 typeof (_surface_flux_values), # VectoruEltype
182- to,
183- true )
181+ to)
184182 return P4estElementContainer {new_type_params...} (node_coordinates,
185183 jacobian_matrix,
186184 contravariant_vectors,
294292# Manual adapt_structure since we have aliasing memory
295293function Adapt. adapt_structure (to, interfaces:: P4estInterfaceContainer )
296294 # Adapt underlying storage
297- _u = Adapt . adapt_structure (to, interfaces. _u)
298- _neighbor_ids = Adapt . adapt_structure (to, interfaces. _neighbor_ids)
299- _node_indices = Adapt . adapt_structure (to, interfaces. _node_indices)
295+ _u = adapt (to, interfaces. _u)
296+ _neighbor_ids = adapt (to, interfaces. _neighbor_ids)
297+ _node_indices = adapt (to, interfaces. _node_indices)
300298 # Wrap arrays again
301299 u = unsafe_wrap_or_alloc (to, _u, size (interfaces. u))
302300 neighbor_ids = unsafe_wrap_or_alloc (to, _neighbor_ids,
@@ -306,12 +304,11 @@ function Adapt.adapt_structure(to, interfaces::P4estInterfaceContainer)
306304
307305 NDIMS = ndims (interfaces)
308306 new_type_params = (NDIMS,
309- eltype (interfaces ),
307+ eltype (_u ),
310308 NDIMS + 2 ,
311309 typeof (u), typeof (neighbor_ids), typeof (node_indices),
312310 typeof (_u), typeof (_neighbor_ids), typeof (_node_indices),
313- to,
314- true )
311+ to)
315312 return P4estInterfaceContainer {new_type_params...} (u, neighbor_ids, node_indices,
316313 _u, _neighbor_ids, _node_indices)
317314end
@@ -436,16 +433,16 @@ end
436433
437434# Manual adapt_structure since we have aliasing memory
438435function Adapt. adapt_structure (to, boundaries:: P4estBoundaryContainer )
439- _u = Adapt . adapt_structure (to, boundaries. _u)
436+ _u = adapt (to, boundaries. _u)
440437 u = unsafe_wrap_or_alloc (to, _u, size (boundaries. u))
441- neighbor_ids = Adapt . adapt_structure (to, boundaries. neighbor_ids)
442- node_indices = Adapt . adapt_structure (to, boundaries. node_indices)
438+ neighbor_ids = adapt (to, boundaries. neighbor_ids)
439+ node_indices = adapt (to, boundaries. node_indices)
443440 name = boundaries. name
444441
445442 NDIMS = ndims (boundaries)
446- return P4estBoundaryContainer{NDIMS, eltype (boundaries ), NDIMS + 1 , typeof (u),
443+ return P4estBoundaryContainer{NDIMS, eltype (_u ), NDIMS + 1 , typeof (u),
447444 typeof (neighbor_ids), typeof (node_indices),
448- typeof (_u), to, true }(u, neighbor_ids, node_indices,
445+ typeof (_u), to}(u, neighbor_ids, node_indices,
449446 name, _u)
450447end
451448
574571# Manual adapt_structure since we have aliasing memory
575572function Adapt. adapt_structure (to, mortars:: P4estMortarContainer )
576573 # Adapt underlying storage
577- _u = Adapt . adapt_structure (to, mortars. _u)
578- _neighbor_ids = Adapt . adapt_structure (to, mortars. _neighbor_ids)
579- _node_indices = Adapt . adapt_structure (to, mortars. _node_indices)
574+ _u = adapt (to, mortars. _u)
575+ _neighbor_ids = adapt (to, mortars. _neighbor_ids)
576+ _node_indices = adapt (to, mortars. _node_indices)
580577
581578 # Wrap arrays again
582579 u = unsafe_wrap_or_alloc (to, _u, size (mortars. u))
@@ -585,13 +582,12 @@ function Adapt.adapt_structure(to, mortars::P4estMortarContainer)
585582
586583 NDIMS = ndims (mortars)
587584 new_type_params = (NDIMS,
588- eltype (mortars ),
585+ eltype (_u ),
589586 NDIMS + 1 ,
590587 NDIMS + 3 ,
591588 typeof (u), typeof (neighbor_ids), typeof (node_indices),
592589 typeof (_u), typeof (_neighbor_ids), typeof (_node_indices),
593- to,
594- true )
590+ to)
595591 return P4estMortarContainer {new_type_params...} (u, neighbor_ids, node_indices,
596592 _u, _neighbor_ids, _node_indices)
597593end
0 commit comments