From: Wolfgang Bangerth Date: Thu, 20 Aug 2015 17:46:16 +0000 (-0500) Subject: Avoid memory allocation. X-Git-Tag: v8.4.0-rc2~571^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1400%2Fhead;p=dealii.git 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. --- 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