Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Don't bother with an extra function call for querying SCALAR values

until/unless we actually see SCALAR values that need to be set.
  • Loading branch information...
1 parent f78c308 commit 729fe5b7b1372eb937bdb3bf10c91cd074f954f8 @roystgnr roystgnr committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/systems/system_projection.C
8 src/systems/system_projection.C
@@ -487,12 +487,18 @@ void System::project_vector (NumericVector<Number>& new_vector,
// We get different scalars as different
// components from a new-style f functor.
DenseVector<Number> fout(this->n_components());
- (*f) (Point(), this->time, fout);
+ bool filled_fout = false;
const DofMap& dof_map = this->get_dof_map();
for (unsigned int var=0; var<this->n_vars(); var++)
if(this->variable(var).type().family == SCALAR)
+ if (!filled_fout)
+ {
+ (*f) (Point(), this->time, fout);
+ filled_fout = true;
+ }
std::vector<unsigned int> SCALAR_indices;
dof_map.SCALAR_dof_indices (SCALAR_indices, var);
const unsigned int n_SCALAR_dofs = SCALAR_indices.size();

0 comments on commit 729fe5b

Please sign in to comment.
Something went wrong with that request. Please try again.