From 19dbf083da4cc7a377e3e22421afbe207c0b2c85 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 20 Aug 2015 12:46:16 -0500 Subject: [PATCH] Avoid memory allocation. Rather take the penalty of looking a piece of data up at most 2^dim times. Surely that's cheaper than the memory allocation. --- source/dofs/dof_accessor_get.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/dofs/dof_accessor_get.cc b/source/dofs/dof_accessor_get.cc index 818c66bfe1..ac4bcec477 100644 --- a/source/dofs/dof_accessor_get.cc +++ b/source/dofs/dof_accessor_get.cc @@ -137,12 +137,7 @@ get_interpolated_dof_values (const InputVector &values, // there are even weird finite elements (for example the Raviart-Thomas // element) which have shape functions that are additive (interior ones) // and others that are overwriting (face degrees of freedom that need to - // be continuous across the face). to avoid checking this over and over - // again, we do this once now and cache the results - std::vector restriction_is_additive (dofs_per_cell); - for (unsigned int i=0; in_children(); ++child) { // get the values from the present child, if necessary by @@ -157,7 +152,7 @@ get_interpolated_dof_values (const InputVector &values, // and add up or set them in the output vector for (unsigned int i=0; i