]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Revert "Allow the create_* functions to be called with nullptr coefficients"
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 13 Aug 2017 18:12:46 +0000 (20:12 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 13 Aug 2017 18:15:32 +0000 (20:15 +0200)
This reverts commit 7bd1893bd9084308c2fb9e51aef8cfa2641617e7.

include/deal.II/numerics/matrix_creator.templates.h
include/deal.II/numerics/matrix_tools.h
tests/numerics/create_laplace_matrix_constraints_01.cc
tests/numerics/create_laplace_matrix_constraints_02.cc
tests/numerics/create_laplace_matrix_constraints_02b.cc
tests/numerics/create_mass_matrix_constraints_01.cc
tests/numerics/create_mass_matrix_constraints_02.cc
tests/numerics/create_mass_matrix_constraints_02b.cc

index 4c1fd44d2cd457ec05860b30ce8e6b24f2aa3b91..b3c56d19ae46478aaaf91012075843a51f95074f 100644 (file)
@@ -671,7 +671,7 @@ namespace MatrixCreator
                            const DoFHandler<dim,spacedim>    &dof,
                            const Quadrature<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -712,7 +712,7 @@ namespace MatrixCreator
   void create_mass_matrix (const DoFHandler<dim,spacedim>    &dof,
                            const Quadrature<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     create_mass_matrix(StaticMappingQ1<dim,spacedim>::mapping, dof,
@@ -728,7 +728,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number>      &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -770,7 +770,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number>      &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     create_mass_matrix(StaticMappingQ1<dim,spacedim>::mapping,
@@ -785,7 +785,7 @@ namespace MatrixCreator
                            const hp::DoFHandler<dim,spacedim>    &dof,
                            const hp::QCollection<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -822,7 +822,7 @@ namespace MatrixCreator
   void create_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
                            const hp::QCollection<dim> &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     create_mass_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection,
@@ -838,7 +838,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number>      &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -877,7 +877,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number> &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                           const Function<spacedim,number> *const coefficient,
                            const ConstraintMatrix   &constraints)
   {
     create_mass_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
@@ -1198,7 +1198,7 @@ namespace MatrixCreator
                                const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                Vector<number>            &rhs_vector,
                                std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                               const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                               const Function<spacedim,number> *const coefficient,
                                std::vector<unsigned int> component_mapping)
   {
     // what would that be in 1d? the
@@ -1597,7 +1597,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &rhs,
                                     Vector<number>            &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a,
+                                    const Function<spacedim,number> *const a,
                                     std::vector<unsigned int> component_mapping)
   {
     create_boundary_mass_matrix(StaticMappingQ1<dim,spacedim>::mapping, dof, q,
@@ -1615,7 +1615,7 @@ namespace MatrixCreator
                                const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                Vector<number>            &rhs_vector,
                                std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                               const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const coefficient,
+                               const Function<spacedim,number> *const coefficient,
                                std::vector<unsigned int> component_mapping)
   {
     // what would that be in 1d? the
@@ -1684,7 +1684,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &rhs,
                                     Vector<number>            &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a,
+                                    const Function<spacedim,number> *const a,
                                     std::vector<unsigned int> component_mapping)
   {
     create_boundary_mass_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
@@ -1698,7 +1698,7 @@ namespace MatrixCreator
                               const DoFHandler<dim,spacedim>    &dof,
                               const Quadrature<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -1740,7 +1740,7 @@ namespace MatrixCreator
   void create_laplace_matrix (const DoFHandler<dim,spacedim>    &dof,
                               const Quadrature<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix &constraints)
   {
     create_laplace_matrix(StaticMappingQ1<dim,spacedim>::mapping,
@@ -1756,7 +1756,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -1800,7 +1800,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix &constraints)
   {
     create_laplace_matrix(StaticMappingQ1<dim,spacedim>::mapping, dof, q,
@@ -1814,7 +1814,7 @@ namespace MatrixCreator
                               const hp::DoFHandler<dim,spacedim>    &dof,
                               const hp::QCollection<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -1853,7 +1853,7 @@ namespace MatrixCreator
   void create_laplace_matrix (const hp::DoFHandler<dim,spacedim>    &dof,
                               const hp::QCollection<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix &constraints)
   {
     create_laplace_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
@@ -1869,7 +1869,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix   &constraints)
   {
     Assert (matrix.m() == dof.n_dofs(),
@@ -1910,7 +1910,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const coefficient,
+                              const Function<spacedim> *const coefficient,
                               const ConstraintMatrix &constraints)
   {
     create_laplace_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
index 070502d158d33253df3624112dc5384e36c4d605..a2377cbd4a4941b60065dd8cb26530d62696f483 100644 (file)
@@ -237,7 +237,7 @@ namespace MatrixCreator
                            const DoFHandler<dim,spacedim>    &dof,
                            const Quadrature<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = nullptr,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -248,7 +248,7 @@ namespace MatrixCreator
   void create_mass_matrix (const DoFHandler<dim,spacedim>    &dof,
                            const Quadrature<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = nullptr,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -274,7 +274,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number> &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = nullptr,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -287,7 +287,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number> &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = 0,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -298,7 +298,7 @@ namespace MatrixCreator
                            const hp::DoFHandler<dim,spacedim>    &dof,
                            const hp::QCollection<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = nullptr,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -308,7 +308,7 @@ namespace MatrixCreator
   void create_mass_matrix (const hp::DoFHandler<dim,spacedim>    &dof,
                            const hp::QCollection<dim>    &q,
                            SparseMatrix<number>     &matrix,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = 0,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -321,7 +321,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number> &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = nullptr,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -333,7 +333,7 @@ namespace MatrixCreator
                            SparseMatrix<number>     &matrix,
                            const Function<spacedim,number> &rhs,
                            Vector<number>           &rhs_vector,
-                           const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                           const Function<spacedim,number> *const a = 0,
                            const ConstraintMatrix   &constraints = ConstraintMatrix());
 
 
@@ -367,7 +367,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                     Vector<number>           &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const weight = nullptr,
+                                    const Function<spacedim,number> *const weight = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
 
@@ -382,7 +382,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                     Vector<number>           &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                                    const Function<spacedim,number> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
   /**
@@ -396,7 +396,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                     Vector<number>           &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                                    const Function<spacedim,number> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
   /**
@@ -409,7 +409,7 @@ namespace MatrixCreator
                                     const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
                                     Vector<number>           &rhs_vector,
                                     std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-                                    const Function<std::integral_constant<int, spacedim>::value, typename identity<number>::type> *const a = nullptr,
+                                    const Function<spacedim,number> *const a = 0,
                                     std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
 
   /**
@@ -433,7 +433,7 @@ namespace MatrixCreator
                               const DoFHandler<dim,spacedim> &dof,
                               const Quadrature<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -444,7 +444,7 @@ namespace MatrixCreator
   void create_laplace_matrix (const DoFHandler<dim,spacedim> &dof,
                               const Quadrature<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -469,7 +469,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim> &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -482,7 +482,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim> &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -494,7 +494,7 @@ namespace MatrixCreator
                               const hp::DoFHandler<dim,spacedim> &dof,
                               const hp::QCollection<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -505,7 +505,7 @@ namespace MatrixCreator
   void create_laplace_matrix (const hp::DoFHandler<dim,spacedim> &dof,
                               const hp::QCollection<dim>    &q,
                               SparseMatrix<double>     &matrix,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -519,7 +519,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
@@ -532,7 +532,7 @@ namespace MatrixCreator
                               SparseMatrix<double>     &matrix,
                               const Function<spacedim>      &rhs,
                               Vector<double>           &rhs_vector,
-                              const Function<std::integral_constant<int, spacedim>::value> *const a = nullptr,
+                              const Function<spacedim> *const a = nullptr,
                               const ConstraintMatrix   &constraints = ConstraintMatrix());
 
   /**
index 8e229b61447281a64643f9d07f7bc101c4f9280d..8af0c09db64fac0014e58dab522ab57d530f2b81 100644 (file)
@@ -102,8 +102,9 @@ check ()
                          rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
-                                      rhs_function, rhs, nullptr, constraints);
+                                      rhs_function, rhs, dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values
index a10f649b90f0c5727bbbaacb5638fd7d7b1b1144..a885377b033e08b362f3349ae94a75b7f9ef2e8f 100644 (file)
@@ -106,8 +106,9 @@ check ()
                          rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
-                                      rhs_function, rhs, nullptr, constraints);
+                                      rhs_function, rhs, dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values
index 114a34464f1379b5072ad3a954214cfdeb77fdd7..92489fa3880f8a1dc8deae8d3ead2cf2f496a0bb 100644 (file)
@@ -102,8 +102,9 @@ check ()
                          quadrature, matrix_ref);
   constraints.condense(matrix_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
-                                      nullptr, constraints);
+                                      dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values
index 81786f8833bbc2c4910b9d3b2553f27053e529fe..7aa4b0ba48241e3e32f4e662c840923fd486f8a3 100644 (file)
@@ -102,8 +102,9 @@ check ()
                       rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
-                                   rhs_function, rhs, nullptr, constraints);
+                                   rhs_function, rhs, dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values
index 357b28c2ce452a41452c09c5ea13d31cc525124d..70b8f0c8d5aae7a2a3eea4de67133e450fe85055 100644 (file)
@@ -106,8 +106,9 @@ check ()
                       rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
-                                   rhs_function, rhs, nullptr, constraints);
+                                   rhs_function, rhs, dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values
index e4b5c15495740d6dbec89911ef956b805d6e0972..aa80f0217568da42eb789860b4a0d8b174ae91d7 100644 (file)
@@ -102,8 +102,9 @@ check ()
                       quadrature, matrix_ref);
   constraints.condense(matrix_ref);
 
+  const Function<dim> *const dummy = nullptr;
   MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
-                                   nullptr, constraints);
+                                   dummy, constraints);
 
   // compute reference: need to cancel constrained entries as these will in
   // general get different values

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.