Skip to content

Commit

Permalink
Update to new restore_subvector API
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad committed Sep 24, 2024
1 parent d66e853 commit 1ab79b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions framework/src/timeintegrators/CrankNicolson.C
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CrankNicolson::computeTimeDerivatives()
_solution_old.create_subvector(*_solution_old_sub, _local_indices, false);
*u_dot_sub = *_solution_sub;
computeTimeDerivativeHelper(*u_dot_sub, *_solution_old_sub);
u_dot.restore_subvector(std::move(*u_dot_sub), _local_indices);
u_dot.restore_subvector(std::move(u_dot_sub), _local_indices);
// Scatter info needed for ghosts
u_dot.close();
}
Expand Down Expand Up @@ -129,10 +129,10 @@ CrankNicolson::postResidual(NumericVector<Number> & residual)
*residual_sub += *re_time_sub;
*residual_sub += *re_non_time_sub;
*residual_sub += *residual_old_sub;
residual.restore_subvector(std::move(*residual_sub), _local_indices);
_Re_time.restore_subvector(std::move(*re_time_sub), _local_indices);
_Re_non_time.restore_subvector(std::move(*re_non_time_sub), _local_indices);
_residual_old.restore_subvector(std::move(*residual_old_sub), _local_indices);
residual.restore_subvector(std::move(residual_sub), _local_indices);
_Re_time.restore_subvector(std::move(re_time_sub), _local_indices);
_Re_non_time.restore_subvector(std::move(re_non_time_sub), _local_indices);
_residual_old.restore_subvector(std::move(residual_old_sub), _local_indices);
}
}

Expand Down
8 changes: 4 additions & 4 deletions framework/src/timeintegrators/ImplicitEuler.C
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ImplicitEuler::computeTimeDerivatives()
_solution_old.create_subvector(*_solution_old_sub, _local_indices, false);
*u_dot_sub = *_solution_sub;
computeTimeDerivativeHelper(*u_dot_sub, *_solution_old_sub);
u_dot.restore_subvector(std::move(*u_dot_sub), _local_indices);
u_dot.restore_subvector(std::move(u_dot_sub), _local_indices);
// Scatter info needed for ghosts
u_dot.close();
}
Expand Down Expand Up @@ -78,8 +78,8 @@ ImplicitEuler::postResidual(NumericVector<Number> & residual)
auto re_non_time_sub = _Re_non_time.get_subvector(_local_indices);
*residual_sub += *re_time_sub;
*residual_sub += *re_non_time_sub;
residual.restore_subvector(std::move(*residual_sub), _local_indices);
_Re_time.restore_subvector(std::move(*re_time_sub), _local_indices);
_Re_non_time.restore_subvector(std::move(*re_non_time_sub), _local_indices);
residual.restore_subvector(std::move(residual_sub), _local_indices);
_Re_time.restore_subvector(std::move(re_time_sub), _local_indices);
_Re_non_time.restore_subvector(std::move(re_non_time_sub), _local_indices);
}
}
4 changes: 2 additions & 2 deletions framework/src/timeintegrators/TimeIntegrator.C
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ TimeIntegrator::copyVector(NumericVector<Number> & from, NumericVector<Number> &
auto to_sub = to.get_subvector(_local_indices);
auto from_sub = from.get_subvector(_local_indices);
*to_sub = *from_sub;
to.restore_subvector(std::move(*to_sub), _local_indices);
from.restore_subvector(std::move(*from_sub), _local_indices);
to.restore_subvector(std::move(to_sub), _local_indices);
from.restore_subvector(std::move(from_sub), _local_indices);
}
}

Expand Down

0 comments on commit 1ab79b5

Please sign in to comment.