]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Pass std::function instances by reference. 15/head
authorDavid Wells <wellsd2@rpi.edu>
Mon, 11 Jan 2016 14:41:02 +0000 (09:41 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Mon, 11 Jan 2016 14:41:02 +0000 (09:41 -0500)
cdr/common/include/deal.II-cdr/system_matrix.h
cdr/common/include/deal.II-cdr/system_matrix.templates.h
cdr/common/include/deal.II-cdr/system_rhs.h
cdr/common/include/deal.II-cdr/system_rhs.templates.h
cdr/common/source/system_matrix.cc
cdr/common/source/system_rhs.cc

index 348f419cff52f6304575377e0cd277ba2ac62924..13717a30ce79ed5809ec96040e76a920c046b752 100644 (file)
@@ -22,7 +22,7 @@ namespace CDR
   void create_system_matrix
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
    const CDR::Parameters                                 &parameters,
    const double                                           time_step,
    MatrixType                                            &system_matrix);
@@ -31,7 +31,7 @@ namespace CDR
   void create_system_matrix
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
    const CDR::Parameters                                 &parameters,
    const double                                           time_step,
    const ConstraintMatrix                                &constraints,
index 7cafd467781eb34d2bae78ebcc5a52eed1f4c5b1..4d8ceb8b66d2642548bf765f74bd5f8c36fb6e74 100644 (file)
@@ -26,7 +26,7 @@ namespace CDR
   void internal_create_system_matrix
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
    const CDR::Parameters                                 &parameters,
    const double                                           time_step,
    UpdateFunction                                         update_system_matrix)
@@ -80,7 +80,7 @@ namespace CDR
   void create_system_matrix
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
    const CDR::Parameters                                 &parameters,
    const double                                           time_step,
    const ConstraintMatrix                                &constraints,
@@ -100,7 +100,7 @@ namespace CDR
   void create_system_matrix
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
    const CDR::Parameters                                 &parameters,
    const double                                           time_step,
    MatrixType                                            &system_matrix)
index 966542da249365f2728595f6d8664018874bc068..5942cdad7d2b549d7a3ce4336443ea41e621cf6b 100644 (file)
@@ -22,8 +22,8 @@ namespace CDR
   void create_system_rhs
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
-   const std::function<double(double, const Point<dim>)>  forcing_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
+   const std::function<double(double, const Point<dim>)> &forcing_function,
    const CDR::Parameters                                 &parameters,
    const VectorType                                      &previous_solution,
    const ConstraintMatrix                                &constraints,
index 9e49a5e88aa9a80174d30834a48a8a6550b64dac..ae7560252f8b3a1b10e7b34f3d88858c89774acf 100644 (file)
@@ -26,8 +26,8 @@ namespace CDR
   void create_system_rhs
   (const DoFHandler<dim>                                 &dof_handler,
    const QGauss<dim>                                     &quad,
-   const std::function<Tensor<1, dim>(const Point<dim>)>  convection_function,
-   const std::function<double(double, const Point<dim>)>  forcing_function,
+   const std::function<Tensor<1, dim>(const Point<dim>)> &convection_function,
+   const std::function<double(double, const Point<dim>)> &forcing_function,
    const CDR::Parameters                                 &parameters,
    const VectorType                                      &previous_solution,
    const ConstraintMatrix                                &constraints,
index ae14c4e780008f527f1bf9bf5be171f78e348f26..c080701f0ba05b638b1d8c14ff8669cc36b3cedd 100644 (file)
@@ -17,7 +17,7 @@ namespace CDR
   void create_system_matrix<2, SparseMatrix<double>>
   (const DoFHandler<2>                               &dof_handler,
    const QGauss<2>                                   &quad,
-   const std::function<Tensor<1, 2>(const Point<2>)>  convection_function,
+   const std::function<Tensor<1, 2>(const Point<2>)> &convection_function,
    const CDR::Parameters                             &parameters,
    const double                                       time_step,
    SparseMatrix<double>                              &system_matrix);
@@ -26,7 +26,7 @@ namespace CDR
   void create_system_matrix<3, SparseMatrix<double>>
   (const DoFHandler<3>                               &dof_handler,
    const QGauss<3>                                   &quad,
-   const std::function<Tensor<1, 3>(const Point<3>)>  convection_function,
+   const std::function<Tensor<1, 3>(const Point<3>)> &convection_function,
    const CDR::Parameters                             &parameters,
    const double                                       time_step,
    SparseMatrix<double>                              &system_matrix);
@@ -35,7 +35,7 @@ namespace CDR
   void create_system_matrix<2, SparseMatrix<double>>
   (const DoFHandler<2>                               &dof_handler,
    const QGauss<2>                                   &quad,
-   const std::function<Tensor<1, 2>(const Point<2>)>  convection_function,
+   const std::function<Tensor<1, 2>(const Point<2>)> &convection_function,
    const CDR::Parameters                             &parameters,
    const double                                       time_step,
    const ConstraintMatrix                            &constraints,
@@ -45,7 +45,7 @@ namespace CDR
   void create_system_matrix<3, SparseMatrix<double>>
   (const DoFHandler<3>                               &dof_handler,
    const QGauss<3>                                   &quad,
-   const std::function<Tensor<1, 3>(const Point<3>)>  convection_function,
+   const std::function<Tensor<1, 3>(const Point<3>)> &convection_function,
    const CDR::Parameters                             &parameters,
    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<Tensor<1, 2>(const Point<2>)>  convection_function,
+   const std::function<Tensor<1, 2>(const Point<2>)> &convection_function,
    const CDR::Parameters                             &parameters,
    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<Tensor<1, 3>(const Point<3>)>  convection_function,
+   const std::function<Tensor<1, 3>(const Point<3>)> &convection_function,
    const CDR::Parameters                             &parameters,
    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<Tensor<1, 2>(const Point<2>)>  convection_function,
+   const std::function<Tensor<1, 2>(const Point<2>)> &convection_function,
    const CDR::Parameters                             &parameters,
    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<Tensor<1, 3>(const Point<3>)>  convection_function,
+   const std::function<Tensor<1, 3>(const Point<3>)> &convection_function,
    const CDR::Parameters                             &parameters,
    const double                                       time_step,
    const ConstraintMatrix                            &constraints,
index 609e82416b4e4a27cb1d6db00283237ca9021014..8436306296854cf86525a8bcfc063d9e3c98c43d 100644 (file)
@@ -15,8 +15,8 @@ namespace CDR
   void create_system_rhs<2, Vector<double>>
   (const DoFHandler<2>                                 &dof_handler,
    const QGauss<2>                                     &quad,
-   const std::function<Tensor<1, 2>(const Point<2>)>    convection_function,
-   const std::function<double(double, const Point<2>)>  forcing_function,
+   const std::function<Tensor<1, 2>(const Point<2>)>   &convection_function,
+   const std::function<double(double, const Point<2>)> &forcing_function,
    const CDR::Parameters                               &parameters,
    const Vector<double>                                &previous_solution,
    const ConstraintMatrix                              &constraints,
@@ -27,8 +27,8 @@ namespace CDR
   void create_system_rhs<3, Vector<double>>
   (const DoFHandler<3>                                 &dof_handler,
    const QGauss<3>                                     &quad,
-   const std::function<Tensor<1, 3>(const Point<3>)>    convection_function,
-   const std::function<double(double, const Point<3>)>  forcing_function,
+   const std::function<Tensor<1, 3>(const Point<3>)>   &convection_function,
+   const std::function<double(double, const Point<3>)> &forcing_function,
    const CDR::Parameters                               &parameters,
    const Vector<double>                                &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<Tensor<1, 2>(const Point<2>)>    convection_function,
-   const std::function<double(double, const Point<2>)>  forcing_function,
+   const std::function<Tensor<1, 2>(const Point<2>)>   &convection_function,
+   const std::function<double(double, const Point<2>)> &forcing_function,
    const CDR::Parameters                               &parameters,
    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<Tensor<1, 3>(const Point<3>)>    convection_function,
-   const std::function<double(double, const Point<3>)>  forcing_function,
+   const std::function<Tensor<1, 3>(const Point<3>)>   &convection_function,
+   const std::function<double(double, const Point<3>)> &forcing_function,
    const CDR::Parameters                               &parameters,
    const TrilinosWrappers::MPI::Vector                 &previous_solution,
    const ConstraintMatrix                              &constraints,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.