From: Daniel Arndt Date: Sun, 13 Aug 2017 18:26:41 +0000 (+0200) Subject: Document the default argument for the coefficient X-Git-Tag: v9.0.0-rc1~1268^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c3ba27115ba31c025f51a6d8abe61c64c8ff446;p=dealii.git Document the default argument for the coefficient --- diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index a2377cbd4a..d66f20b167 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -220,6 +220,9 @@ namespace MatrixCreator * Assemble the mass matrix. If no coefficient is given (i.e., if the * pointer to a function object is zero as it is by default), the * coefficient is taken as being constant and equal to one. + * In case you want to specify @p constraints and use the default argument + * for the coefficient you have to specify the (unused) coefficient argument as + * (const Function *const)nullptr. * * If the library is configured to use multithreading, this function works * in parallel. @@ -255,6 +258,9 @@ namespace MatrixCreator * Assemble the mass matrix and a right hand side vector. If no coefficient * is given (i.e., if the pointer to a function object is zero as it is by * default), the coefficient is taken as being constant and equal to one. + * In case you want to specify @p constraints and use the default argument + * for the coefficient you have to specify the (unused) coefficient argument as + * (const Function *const)nullptr. * * If the library is configured to use multithreading, this function works * in parallel. @@ -287,7 +293,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function *const a = 0, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -308,7 +314,7 @@ namespace MatrixCreator void create_mass_matrix (const hp::DoFHandler &dof, const hp::QCollection &q, SparseMatrix &matrix, - const Function *const a = 0, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); /** @@ -333,7 +339,7 @@ namespace MatrixCreator SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, - const Function *const a = 0, + const Function *const a = nullptr, const ConstraintMatrix &constraints = ConstraintMatrix()); @@ -348,6 +354,9 @@ namespace MatrixCreator * * @arg @p weight: an optional weight for the computation of the mass * matrix. If no weight is given, it is set to one. + * In case you want to specify @p component_mapping and use the default argument + * for the coefficient you have to specify the (unused) coefficient argument as + * (const Function *const)nullptr. * * @arg @p component_mapping: if the components in @p boundary_functions and * @p dof do not coincide, this vector allows them to be remapped. If the @@ -382,7 +391,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function *const a = 0, + const Function *const a = nullptr, std::vector component_mapping = std::vector()); /** @@ -396,7 +405,7 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function *const a = 0, + const Function *const a = nullptr, std::vector component_mapping = std::vector()); /** @@ -409,13 +418,16 @@ namespace MatrixCreator const std::map*> &boundary_functions, Vector &rhs_vector, std::vector &dof_to_boundary_mapping, - const Function *const a = 0, + const Function *const a = nullptr, std::vector component_mapping = std::vector()); /** * Assemble the Laplace matrix. If no coefficient is given (i.e., if the * pointer to a function object is zero as it is by default), the * coefficient is taken as being constant and equal to one. + * In case you want to specify @p constraints and use the default argument + * for the coefficient you have to specify the (unused) coefficient argument as + * (const Function *const)nullptr. * * If the library is configured to use multithreading, this function works * in parallel. @@ -450,6 +462,9 @@ namespace MatrixCreator /** * Assemble the Laplace matrix and a right hand side vector. If no * coefficient is given, it is assumed to be constant one. + * In case you want to specify @p constraints and use the default argument + * for the coefficient you have to specify the (unused) coefficient argument as + * (const Function *const)nullptr. * * If the library is configured to use multithreading, this function works * in parallel. diff --git a/tests/numerics/create_mass_matrix_constraints_02b.cc b/tests/numerics/create_mass_matrix_constraints_02b.cc index aa80f02175..fb709fa977 100644 --- a/tests/numerics/create_mass_matrix_constraints_02b.cc +++ b/tests/numerics/create_mass_matrix_constraints_02b.cc @@ -102,9 +102,8 @@ check () quadrature, matrix_ref); constraints.condense(matrix_ref); - const Function *const dummy = nullptr; MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix, - dummy, constraints); + (const Function *const)nullptr, constraints); // compute reference: need to cancel constrained entries as these will in // general get different values