From: David Wells Date: Mon, 11 Jan 2016 14:41:02 +0000 (-0500) Subject: Pass std::function instances by reference. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15%2Fhead;p=code-gallery.git Pass std::function instances by reference. --- diff --git a/cdr/common/include/deal.II-cdr/system_matrix.h b/cdr/common/include/deal.II-cdr/system_matrix.h index 348f419..13717a3 100644 --- a/cdr/common/include/deal.II-cdr/system_matrix.h +++ b/cdr/common/include/deal.II-cdr/system_matrix.h @@ -22,7 +22,7 @@ namespace CDR void create_system_matrix (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, + const std::function(const Point)> &convection_function, const CDR::Parameters ¶meters, const double time_step, MatrixType &system_matrix); @@ -31,7 +31,7 @@ namespace CDR void create_system_matrix (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, + const std::function(const Point)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, diff --git a/cdr/common/include/deal.II-cdr/system_matrix.templates.h b/cdr/common/include/deal.II-cdr/system_matrix.templates.h index 7cafd46..4d8ceb8 100644 --- a/cdr/common/include/deal.II-cdr/system_matrix.templates.h +++ b/cdr/common/include/deal.II-cdr/system_matrix.templates.h @@ -26,7 +26,7 @@ namespace CDR void internal_create_system_matrix (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, + const std::function(const Point)> &convection_function, const CDR::Parameters ¶meters, const double time_step, UpdateFunction update_system_matrix) @@ -80,7 +80,7 @@ namespace CDR void create_system_matrix (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, + const std::function(const Point)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, @@ -100,7 +100,7 @@ namespace CDR void create_system_matrix (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, + const std::function(const Point)> &convection_function, const CDR::Parameters ¶meters, const double time_step, MatrixType &system_matrix) diff --git a/cdr/common/include/deal.II-cdr/system_rhs.h b/cdr/common/include/deal.II-cdr/system_rhs.h index 966542d..5942cda 100644 --- a/cdr/common/include/deal.II-cdr/system_rhs.h +++ b/cdr/common/include/deal.II-cdr/system_rhs.h @@ -22,8 +22,8 @@ namespace CDR void create_system_rhs (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, - const std::function)> forcing_function, + const std::function(const Point)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const VectorType &previous_solution, const ConstraintMatrix &constraints, diff --git a/cdr/common/include/deal.II-cdr/system_rhs.templates.h b/cdr/common/include/deal.II-cdr/system_rhs.templates.h index 9e49a5e..ae75602 100644 --- a/cdr/common/include/deal.II-cdr/system_rhs.templates.h +++ b/cdr/common/include/deal.II-cdr/system_rhs.templates.h @@ -26,8 +26,8 @@ namespace CDR void create_system_rhs (const DoFHandler &dof_handler, const QGauss &quad, - const std::function(const Point)> convection_function, - const std::function)> forcing_function, + const std::function(const Point)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const VectorType &previous_solution, const ConstraintMatrix &constraints, diff --git a/cdr/common/source/system_matrix.cc b/cdr/common/source/system_matrix.cc index ae14c4e..c080701 100644 --- a/cdr/common/source/system_matrix.cc +++ b/cdr/common/source/system_matrix.cc @@ -17,7 +17,7 @@ namespace CDR void create_system_matrix<2, SparseMatrix> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, + const std::function(const Point<2>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, SparseMatrix &system_matrix); @@ -26,7 +26,7 @@ namespace CDR void create_system_matrix<3, SparseMatrix> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, + const std::function(const Point<3>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, SparseMatrix &system_matrix); @@ -35,7 +35,7 @@ namespace CDR void create_system_matrix<2, SparseMatrix> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, + const std::function(const Point<2>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, @@ -45,7 +45,7 @@ namespace CDR void create_system_matrix<3, SparseMatrix> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, + const std::function(const Point<3>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, @@ -55,7 +55,7 @@ namespace CDR void create_system_matrix<2, TrilinosWrappers::SparseMatrix> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, + const std::function(const Point<2>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, TrilinosWrappers::SparseMatrix &system_matrix); @@ -64,7 +64,7 @@ namespace CDR void create_system_matrix<3, TrilinosWrappers::SparseMatrix> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, + const std::function(const Point<3>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, TrilinosWrappers::SparseMatrix &system_matrix); @@ -73,7 +73,7 @@ namespace CDR void create_system_matrix<2, TrilinosWrappers::SparseMatrix> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, + const std::function(const Point<2>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, @@ -83,7 +83,7 @@ namespace CDR void create_system_matrix<3, TrilinosWrappers::SparseMatrix> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, + const std::function(const Point<3>)> &convection_function, const CDR::Parameters ¶meters, const double time_step, const ConstraintMatrix &constraints, diff --git a/cdr/common/source/system_rhs.cc b/cdr/common/source/system_rhs.cc index 609e824..8436306 100644 --- a/cdr/common/source/system_rhs.cc +++ b/cdr/common/source/system_rhs.cc @@ -15,8 +15,8 @@ namespace CDR void create_system_rhs<2, Vector> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, - const std::function)> forcing_function, + const std::function(const Point<2>)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const Vector &previous_solution, const ConstraintMatrix &constraints, @@ -27,8 +27,8 @@ namespace CDR void create_system_rhs<3, Vector> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, - const std::function)> forcing_function, + const std::function(const Point<3>)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const Vector &previous_solution, const ConstraintMatrix &constraints, @@ -39,8 +39,8 @@ namespace CDR void create_system_rhs<2, TrilinosWrappers::MPI::Vector> (const DoFHandler<2> &dof_handler, const QGauss<2> &quad, - const std::function(const Point<2>)> convection_function, - const std::function)> forcing_function, + const std::function(const Point<2>)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const TrilinosWrappers::MPI::Vector &previous_solution, const ConstraintMatrix &constraints, @@ -51,8 +51,8 @@ namespace CDR void create_system_rhs<3, TrilinosWrappers::MPI::Vector> (const DoFHandler<3> &dof_handler, const QGauss<3> &quad, - const std::function(const Point<3>)> convection_function, - const std::function)> forcing_function, + const std::function(const Point<3>)> &convection_function, + const std::function)> &forcing_function, const CDR::Parameters ¶meters, const TrilinosWrappers::MPI::Vector &previous_solution, const ConstraintMatrix &constraints,