From: Daniel Arndt Date: Sun, 13 Aug 2017 18:12:46 +0000 (+0200) Subject: Revert "Allow the create_* functions to be called with nullptr coefficients" X-Git-Tag: v9.0.0-rc1~1268^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61d9c24205c1a2ad604df4e2e9bdd9064b15330d;p=dealii.git Revert "Allow the create_* functions to be called with nullptr coefficients" This reverts commit 7bd1893bd9084308c2fb9e51aef8cfa2641617e7. --- diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index 4c1fd44d2c..b3c56d19ae 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -671,7 +671,7 @@ namespace MatrixCreator const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -712,7 +712,7 @@ namespace MatrixCreator void create_mass_matrix (const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_mass_matrix(StaticMappingQ1::mapping, dof, @@ -728,7 +728,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -770,7 +770,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_mass_matrix(StaticMappingQ1::mapping, @@ -785,7 +785,7 @@ namespace MatrixCreator const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -822,7 +822,7 @@ namespace MatrixCreator void create_mass_matrix (const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_mass_matrix(hp::StaticMappingQ1::mapping_collection, @@ -838,7 +838,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -877,7 +877,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_mass_matrix(hp::StaticMappingQ1::mapping_collection, dof, q, @@ -1198,7 +1198,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, std::vector component_mapping) { // what would that be in 1d? the @@ -1597,7 +1597,7 @@ namespace MatrixCreator const std::map*> &rhs, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const a, + const Function *const a, std::vector component_mapping) { create_boundary_mass_matrix(StaticMappingQ1::mapping, dof, q, @@ -1615,7 +1615,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const coefficient, + const Function *const coefficient, std::vector component_mapping) { // what would that be in 1d? the @@ -1684,7 +1684,7 @@ namespace MatrixCreator const std::map*> &rhs, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const a, + const Function *const a, std::vector component_mapping) { create_boundary_mass_matrix(hp::StaticMappingQ1::mapping_collection, dof, q, @@ -1698,7 +1698,7 @@ namespace MatrixCreator const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -1740,7 +1740,7 @@ namespace MatrixCreator void create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_laplace_matrix(StaticMappingQ1::mapping, @@ -1756,7 +1756,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -1800,7 +1800,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_laplace_matrix(StaticMappingQ1::mapping, dof, q, @@ -1814,7 +1814,7 @@ namespace MatrixCreator const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -1853,7 +1853,7 @@ namespace MatrixCreator void create_laplace_matrix (const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_laplace_matrix(hp::StaticMappingQ1::mapping_collection, dof, q, @@ -1869,7 +1869,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { Assert (matrix.m() == dof.n_dofs(), @@ -1910,7 +1910,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const coefficient, + const Function *const coefficient, const ConstraintMatrix &constraints) { create_laplace_matrix(hp::StaticMappingQ1::mapping_collection, dof, q, diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index 070502d158..a2377cbd4a 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -237,7 +237,7 @@ namespace MatrixCreator const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -248,7 +248,7 @@ namespace MatrixCreator void create_mass_matrix (const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -274,7 +274,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -287,7 +287,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -298,7 +298,7 @@ namespace MatrixCreator const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -308,7 +308,7 @@ namespace MatrixCreator void create_mass_matrix (const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -321,7 +321,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -333,7 +333,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, const ConstraintMatrix &constraints = ConstraintMatrix()); @@ -367,7 +367,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const weight = nullptr, + const Function *const weight = 0, std::vector component_mapping = std::vector()); @@ -382,7 +382,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, std::vector component_mapping = std::vector()); /** @@ -396,7 +396,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, std::vector component_mapping = std::vector()); /** @@ -409,7 +409,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function::value, typename identity::type> *const a = nullptr, + const Function *const a = 0, std::vector component_mapping = std::vector()); /** @@ -433,7 +433,7 @@ namespace MatrixCreator const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -444,7 +444,7 @@ namespace MatrixCreator void create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -469,7 +469,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -482,7 +482,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -494,7 +494,7 @@ namespace MatrixCreator const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -505,7 +505,7 @@ namespace MatrixCreator void create_laplace_matrix (const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -519,7 +519,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -532,7 +532,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function::value> *const a = nullptr, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** diff --git a/tests/numerics/create_laplace_matrix_constraints_01.cc b/tests/numerics/create_laplace_matrix_constraints_01.cc index 8e229b6144..8af0c09db6 100644 --- a/tests/numerics/create_laplace_matrix_constraints_01.cc +++ b/tests/numerics/create_laplace_matrix_constraints_01.cc @@ -102,8 +102,9 @@ check () rhs_function, rhs_ref); constraints.condense(matrix_ref, rhs_ref); + const Function *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 diff --git a/tests/numerics/create_laplace_matrix_constraints_02.cc b/tests/numerics/create_laplace_matrix_constraints_02.cc index a10f649b90..a885377b03 100644 --- a/tests/numerics/create_laplace_matrix_constraints_02.cc +++ b/tests/numerics/create_laplace_matrix_constraints_02.cc @@ -106,8 +106,9 @@ check () rhs_function, rhs_ref); constraints.condense(matrix_ref, rhs_ref); + const Function *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 diff --git a/tests/numerics/create_laplace_matrix_constraints_02b.cc b/tests/numerics/create_laplace_matrix_constraints_02b.cc index 114a34464f..92489fa388 100644 --- a/tests/numerics/create_laplace_matrix_constraints_02b.cc +++ b/tests/numerics/create_laplace_matrix_constraints_02b.cc @@ -102,8 +102,9 @@ check () quadrature, matrix_ref); constraints.condense(matrix_ref); + const Function *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 diff --git a/tests/numerics/create_mass_matrix_constraints_01.cc b/tests/numerics/create_mass_matrix_constraints_01.cc index 81786f8833..7aa4b0ba48 100644 --- a/tests/numerics/create_mass_matrix_constraints_01.cc +++ b/tests/numerics/create_mass_matrix_constraints_01.cc @@ -102,8 +102,9 @@ check () rhs_function, rhs_ref); constraints.condense(matrix_ref, rhs_ref); + const Function *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 diff --git a/tests/numerics/create_mass_matrix_constraints_02.cc b/tests/numerics/create_mass_matrix_constraints_02.cc index 357b28c2ce..70b8f0c8d5 100644 --- a/tests/numerics/create_mass_matrix_constraints_02.cc +++ b/tests/numerics/create_mass_matrix_constraints_02.cc @@ -106,8 +106,9 @@ check () rhs_function, rhs_ref); constraints.condense(matrix_ref, rhs_ref); + const Function *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 diff --git a/tests/numerics/create_mass_matrix_constraints_02b.cc b/tests/numerics/create_mass_matrix_constraints_02b.cc index e4b5c15495..aa80f02175 100644 --- a/tests/numerics/create_mass_matrix_constraints_02b.cc +++ b/tests/numerics/create_mass_matrix_constraints_02b.cc @@ -102,8 +102,9 @@ check () quadrature, matrix_ref); constraints.condense(matrix_ref); + const Function *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