From 817048dbc72619f0a70f4a16c267329ebd366f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20K=C3=B6hler?= Date: Fri, 17 Mar 2023 15:45:26 +0100 Subject: [PATCH] eliminate remaining unneccessary allocs in transfer_solution --- src/utils.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 875665c0..0511f53e 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -357,7 +357,7 @@ function _transfer_solution(ip_geo,ip_field,val_buffer,val,field_name,field_dim, data = fill(0.0, num_vertices(plotter),_processreturn) _local_coords = Ferrite.getcoordinates(grid,1) _local_celldofs = Ferrite.celldofs(dh,1) - _celldofs_field = reshape(_local_celldofs[local_dof_range], (field_dim, n_basefuncs)) + _celldofs_field = reshape(@view(_local_celldofs[local_dof_range]), (field_dim, n_basefuncs)) _local_ref_coords = Tensors.Vec{dim}(ref_coords[1,:]) for (isvisible,(cell_idx,cell_geo)) in zip(plotter.visible,enumerate(Ferrite.getcells(dh.grid))) @@ -380,7 +380,7 @@ function _transfer_solution(ip_geo,ip_field,val_buffer,val,field_name,field_dim, _local_ref_coords = Tensors.Vec{dim}(@view(ref_coords[current_vertex_index,:])) Ferrite.reinit!(pv, _local_coords, _local_ref_coords) for d in 1:field_dim - val_buffer[d] = Ferrite.function_value(pv, 1, @view(u[_celldofs_field[d,:]])) + val_buffer[d] = Ferrite.function_value(pv, 1, @views(u[_celldofs_field[d,:]])) end val = process(val_buffer) for d in 1:_processreturn