From: Wolfgang Bangerth Date: Mon, 6 Mar 2023 18:49:46 +0000 (-0700) Subject: Annotate the VectorTools functions with vector concepts. X-Git-Tag: v9.5.0-rc1~491^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ebf301ea2c4e6b757ac1835c913abc7b18505a9;p=dealii.git Annotate the VectorTools functions with vector concepts. --- diff --git a/include/deal.II/numerics/vector_tools_evaluate.h b/include/deal.II/numerics/vector_tools_evaluate.h index 0d29e988ba..6037bc2f3f 100644 --- a/include/deal.II/numerics/vector_tools_evaluate.h +++ b/include/deal.II/numerics/vector_tools_evaluate.h @@ -137,19 +137,23 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) std::vector< typename FEPointEvaluation::value_type> - point_values( - const Mapping & mapping, - const MeshType & mesh, - const VectorType & vector, - const std::vector> & evaluation_points, - Utilities::MPI::RemotePointEvaluation &cache, - const EvaluationFlags::EvaluationFlags flags = EvaluationFlags::avg, - const unsigned int first_selected_component = 0); + typename VectorType::value_type>:: + value_type> point_values(const Mapping & mapping, + const MeshType &mesh, + const VectorType & vector, + const std::vector> + &evaluation_points, + Utilities::MPI::RemotePointEvaluation + & cache, + const EvaluationFlags::EvaluationFlags flags = + EvaluationFlags::avg, + const unsigned int first_selected_component = 0); /** * Given a (distributed) solution vector @p vector, evaluate the values at @@ -169,17 +173,19 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) std::vector< typename FEPointEvaluation::value_type> - point_values( - const Utilities::MPI::RemotePointEvaluation &cache, - const MeshType & mesh, - const VectorType & vector, - const EvaluationFlags::EvaluationFlags flags = EvaluationFlags::avg, - const unsigned int first_selected_component = 0); + typename VectorType::value_type>:: + value_type> point_values(const Utilities::MPI:: + RemotePointEvaluation &cache, + const MeshType & mesh, + const VectorType & vector, + const EvaluationFlags::EvaluationFlags flags = + EvaluationFlags::avg, + const unsigned int first_selected_component = 0); /** * Given a (distributed) solution vector @p vector, evaluate the gradients at @@ -197,19 +203,24 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) std::vector< typename FEPointEvaluation::gradient_type> - point_gradients( - const Mapping & mapping, - const MeshType & mesh, - const VectorType & vector, - const std::vector> & evaluation_points, - Utilities::MPI::RemotePointEvaluation &cache, - const EvaluationFlags::EvaluationFlags flags = EvaluationFlags::avg, - const unsigned int first_selected_component = 0); + typename VectorType::value_type>:: + gradient_type> point_gradients(const Mapping & mapping, + const MeshType &mesh, + const VectorType & vector, + const std::vector> + &evaluation_points, + Utilities::MPI::RemotePointEvaluation< + dim, + spacedim> &cache, + const EvaluationFlags::EvaluationFlags + flags = EvaluationFlags::avg, + const unsigned int + first_selected_component = 0); /** * Given a (distributed) solution vector @p vector, evaluate the gradients at @@ -228,17 +239,21 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) std::vector< typename FEPointEvaluation::gradient_type> - point_gradients( - const Utilities::MPI::RemotePointEvaluation &cache, - const MeshType & mesh, - const VectorType & vector, - const EvaluationFlags::EvaluationFlags flags = EvaluationFlags::avg, - const unsigned int first_selected_component = 0); + typename VectorType::value_type>:: + gradient_type> point_gradients(const Utilities::MPI:: + RemotePointEvaluation + & cache, + const MeshType &mesh, + const VectorType & vector, + const EvaluationFlags::EvaluationFlags + flags = EvaluationFlags::avg, + const unsigned int + first_selected_component = 0); @@ -252,18 +267,22 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) inline std::vector< typename FEPointEvaluation::value_type> - point_values(const Mapping & mapping, - const MeshType & mesh, - const VectorType & vector, - const std::vector> &evaluation_points, - Utilities::MPI::RemotePointEvaluation &cache, - const EvaluationFlags::EvaluationFlags flags, - const unsigned int first_selected_component) + typename VectorType::value_type>:: + value_type> point_values(const Mapping & mapping, + const MeshType &mesh, + const VectorType & vector, + const std::vector> + &evaluation_points, + Utilities::MPI::RemotePointEvaluation + & cache, + const EvaluationFlags::EvaluationFlags flags, + const unsigned int first_selected_component) { cache.reinit(evaluation_points, mesh.get_triangulation(), mapping); @@ -279,18 +298,24 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) inline std::vector< typename FEPointEvaluation::gradient_type> - point_gradients(const Mapping & mapping, - const MeshType & mesh, - const VectorType & vector, - const std::vector> &evaluation_points, - Utilities::MPI::RemotePointEvaluation &cache, - const EvaluationFlags::EvaluationFlags flags, - const unsigned int first_selected_component) + typename VectorType::value_type>:: + gradient_type> point_gradients(const Mapping & mapping, + const MeshType &mesh, + const VectorType & vector, + const std::vector> + &evaluation_points, + Utilities::MPI::RemotePointEvaluation< + dim, + spacedim> &cache, + const EvaluationFlags::EvaluationFlags + flags, + const unsigned int + first_selected_component) { cache.reinit(evaluation_points, mesh.get_triangulation(), mapping); @@ -595,8 +620,8 @@ namespace VectorTools typename MeshType, typename VectorType, typename value_type> - inline std::vector - evaluate_at_points( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + inline std::vector evaluate_at_points( const Utilities::MPI::RemotePointEvaluation &cache, const MeshType & mesh, const VectorType & vector, @@ -701,17 +726,18 @@ namespace VectorTools int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) inline std::vector< typename FEPointEvaluation::value_type> - point_values( - const Utilities::MPI::RemotePointEvaluation &cache, - const MeshType & mesh, - const VectorType & vector, - const EvaluationFlags::EvaluationFlags flags, - const unsigned int first_selected_component) + typename VectorType::value_type>:: + value_type> point_values(const Utilities::MPI:: + RemotePointEvaluation &cache, + const MeshType & mesh, + const VectorType & vector, + const EvaluationFlags::EvaluationFlags flags, + const unsigned int first_selected_component) { return internal::evaluate_at_points< n_components, @@ -735,23 +761,29 @@ namespace VectorTools }); } + + template class MeshType, int dim, int spacedim, typename VectorType> + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) inline std::vector< typename FEPointEvaluation::gradient_type> - point_gradients( - const Utilities::MPI::RemotePointEvaluation &cache, - const MeshType & mesh, - const VectorType & vector, - const EvaluationFlags::EvaluationFlags flags, - const unsigned int first_selected_component) + typename VectorType::value_type>:: + gradient_type> point_gradients(const Utilities::MPI:: + RemotePointEvaluation + & cache, + const MeshType &mesh, + const VectorType & vector, + const EvaluationFlags::EvaluationFlags + flags, + const unsigned int + first_selected_component) { return internal::evaluate_at_points< n_components, diff --git a/include/deal.II/numerics/vector_tools_integrate_difference.h b/include/deal.II/numerics/vector_tools_integrate_difference.h index dc029fe234..ef1780ec2f 100644 --- a/include/deal.II/numerics/vector_tools_integrate_difference.h +++ b/include/deal.II/numerics/vector_tools_integrate_difference.h @@ -26,15 +26,18 @@ DEAL_II_NAMESPACE_OPEN template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class Function; template class Mapping; template class Quadrature; + template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class Triangulation; + namespace hp { template @@ -139,8 +142,9 @@ namespace VectorTools * Vector. */ template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const Mapping & mapping, const DoFHandler & dof, const InVector & fe_function, @@ -156,8 +160,9 @@ namespace VectorTools * mapping=MappingQ@(1). */ template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const DoFHandler & dof, const InVector & fe_function, const Function &exact_solution, @@ -171,8 +176,9 @@ namespace VectorTools * Same as above for hp. */ template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const hp::MappingCollection & mapping, const DoFHandler & dof, const InVector & fe_function, @@ -188,8 +194,9 @@ namespace VectorTools * mapping=MappingQ@(1). */ template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const DoFHandler & dof, const InVector & fe_function, const Function &exact_solution, @@ -225,11 +232,11 @@ namespace VectorTools * @note Instantiated for type Vector and Vector. */ template - double - compute_global_error(const Triangulation &tria, - const InVector & cellwise_error, - const NormType & norm, - const double exponent = 2.); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + double compute_global_error(const Triangulation &tria, + const InVector &cellwise_error, + const NormType &norm, + const double exponent = 2.); /** @} */ } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_integrate_difference.templates.h b/include/deal.II/numerics/vector_tools_integrate_difference.templates.h index d6cda89dae..1a5d334317 100644 --- a/include/deal.II/numerics/vector_tools_integrate_difference.templates.h +++ b/include/deal.II/numerics/vector_tools_integrate_difference.templates.h @@ -432,8 +432,10 @@ namespace VectorTools template - static void - do_integrate_difference( + DEAL_II_CXX20_REQUIRES( + concepts::is_dealii_vector_type + &&concepts::is_writable_dealii_vector_type) + static void do_integrate_difference( const dealii::hp::MappingCollection & mapping, const DoFHandler & dof, const InVector & fe_function, @@ -549,9 +551,12 @@ namespace VectorTools } // namespace internal + + template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const Mapping & mapping, const DoFHandler & dof, const InVector & fe_function, @@ -576,8 +581,9 @@ namespace VectorTools template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const DoFHandler & dof, const InVector & fe_function, const Function &exact_solution, @@ -601,8 +607,9 @@ namespace VectorTools template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const dealii::hp::MappingCollection & mapping, const dealii::DoFHandler & dof, const InVector & fe_function, @@ -625,8 +632,9 @@ namespace VectorTools } template - void - integrate_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void integrate_difference( const dealii::DoFHandler & dof, const InVector & fe_function, const Function &exact_solution, @@ -649,11 +657,11 @@ namespace VectorTools } template - double - compute_global_error(const Triangulation &tria, - const InVector & cellwise_error, - const NormType & norm, - const double exponent) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + double compute_global_error(const Triangulation &tria, + const InVector &cellwise_error, + const NormType &norm, + const double exponent) { Assert(cellwise_error.size() == tria.n_active_cells(), ExcMessage("input vector cell_error has invalid size!")); diff --git a/include/deal.II/numerics/vector_tools_interpolate.h b/include/deal.II/numerics/vector_tools_interpolate.h index 007b1923d0..4a32068cd6 100644 --- a/include/deal.II/numerics/vector_tools_interpolate.h +++ b/include/deal.II/numerics/vector_tools_interpolate.h @@ -26,9 +26,11 @@ DEAL_II_NAMESPACE_OPEN template class AffineConstraints; + template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class FullMatrix; template @@ -65,8 +67,8 @@ namespace VectorTools * See the general documentation of this namespace for further information. */ template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const Mapping & mapping, const DoFHandler & dof, const Function &function, @@ -77,8 +79,8 @@ namespace VectorTools * Same as above but in an hp-context. */ template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const hp::MappingCollection & mapping, const DoFHandler & dof, const Function &function, @@ -91,8 +93,8 @@ namespace VectorTools * mapping=MappingQ@(1). */ template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const DoFHandler & dof, const Function &function, VectorType & vec, @@ -117,12 +119,13 @@ namespace VectorTools * instantiated by hand. */ template - void - interpolate(const DoFHandler &dof_1, - const DoFHandler &dof_2, - const FullMatrix & transfer, - const InVector & data_1, - OutVector & data_2); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void interpolate(const DoFHandler &dof_1, + const DoFHandler &dof_2, + const FullMatrix & transfer, + const InVector & data_1, + OutVector & data_2); /** * This function is a kind of generalization or modification of the very @@ -171,8 +174,8 @@ namespace VectorTools * dofs of the previous one. */ template - void - interpolate_based_on_material_id( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_based_on_material_id( const Mapping & mapping, const DoFHandler &dof_handler, const std::map - void - interpolate_to_different_mesh(const DoFHandler &dof1, - const VectorType & u1, - const DoFHandler &dof2, - VectorType & u2); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh(const DoFHandler &dof1, + const VectorType & u1, + const DoFHandler &dof2, + VectorType & u2); /** * Compute the interpolation of a @p dof1-function @p u1 to a @p dof2-function @@ -226,8 +229,8 @@ namespace VectorTools * does not necessarily respect continuity requirements at hanging nodes. */ template - void - interpolate_to_different_mesh( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh( const DoFHandler & dof1, const VectorType & u1, const DoFHandler & dof2, @@ -242,8 +245,8 @@ namespace VectorTools * pointing from a source DoFHandler to a destination DoFHandler. */ template - void - interpolate_to_different_mesh( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh( const InterGridMap> & intergridmap, const VectorType & u1, const AffineConstraints &constraints, @@ -281,10 +284,10 @@ namespace VectorTools * components are primitive. */ template - void - get_position_vector(const DoFHandler &dh, - VectorType & vector, - const ComponentMask & mask = ComponentMask()); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void get_position_vector(const DoFHandler &dh, + VectorType & vector, + const ComponentMask &mask = ComponentMask()); /** * Like the above function but also taking @p mapping as argument. @@ -295,11 +298,11 @@ namespace VectorTools * preserve vertex locations (like Eulerian mappings). */ template - void - get_position_vector(const Mapping & mapping, - const DoFHandler &dh, - VectorType & vector, - const ComponentMask & mask = ComponentMask()); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void get_position_vector(const Mapping & mapping, + const DoFHandler &dh, + VectorType & vector, + const ComponentMask &mask = ComponentMask()); /** @} */ } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_interpolate.templates.h b/include/deal.II/numerics/vector_tools_interpolate.templates.h index c78a5ea19d..d7a1bed37b 100644 --- a/include/deal.II/numerics/vector_tools_interpolate.templates.h +++ b/include/deal.II/numerics/vector_tools_interpolate.templates.h @@ -215,12 +215,13 @@ namespace VectorTools // // A given cell is skipped if function(cell) == nullptr template - void - interpolate(const hp::MappingCollection &mapping_collection, - const DoFHandler & dof_handler, - T & function, - VectorType & vec, - const ComponentMask & component_mask) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( + const hp::MappingCollection &mapping_collection, + const DoFHandler & dof_handler, + T & function, + VectorType & vec, + const ComponentMask & component_mask) { Assert(component_mask.represents_n_components( dof_handler.get_fe_collection().n_components()), @@ -474,8 +475,8 @@ namespace VectorTools template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const hp::MappingCollection & mapping, const DoFHandler & dof_handler, const Function &function, @@ -501,8 +502,8 @@ namespace VectorTools template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const Mapping & mapping, const DoFHandler & dof_handler, const Function &function, @@ -519,8 +520,8 @@ namespace VectorTools template - void - interpolate( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate( const DoFHandler & dof, const Function &function, VectorType & vec, @@ -538,12 +539,13 @@ namespace VectorTools template - void - interpolate(const DoFHandler &dof_1, - const DoFHandler &dof_2, - const FullMatrix & transfer, - const InVector & data_1, - OutVector & data_2) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type && + concepts::is_writable_dealii_vector_type) + void interpolate(const DoFHandler &dof_1, + const DoFHandler &dof_2, + const FullMatrix & transfer, + const InVector & data_1, + OutVector & data_2) { using number = typename OutVector::value_type; Vector cell_data_1(dof_1.get_fe().n_dofs_per_cell()); @@ -617,10 +619,10 @@ namespace VectorTools template - void - get_position_vector(const DoFHandler &dh, - VectorType & vector, - const ComponentMask & mask) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void get_position_vector(const DoFHandler &dh, + VectorType & vector, + const ComponentMask & mask) { const FiniteElement &fe = dh.get_fe(); get_position_vector( @@ -634,11 +636,11 @@ namespace VectorTools template - void - get_position_vector(const Mapping & map_q, - const DoFHandler &dh, - VectorType & vector, - const ComponentMask & mask) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void get_position_vector(const Mapping & map_q, + const DoFHandler &dh, + VectorType & vector, + const ComponentMask & mask) { AssertDimension(vector.size(), dh.n_dofs()); const FiniteElement &fe = dh.get_fe(); @@ -808,8 +810,8 @@ namespace VectorTools } template - void - interpolate_based_on_material_id( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_based_on_material_id( const Mapping & mapping, const DoFHandler &dof_handler, const std::map - void - interpolate_to_different_mesh(const DoFHandler &dof1, - const VectorType & u1, - const DoFHandler &dof2, - VectorType & u2) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh(const DoFHandler &dof1, + const VectorType & u1, + const DoFHandler &dof2, + VectorType & u2) { Assert(GridTools::have_same_coarse_mesh(dof1, dof2), ExcMessage("The two DoF handlers must represent triangulations that " @@ -881,8 +885,8 @@ namespace VectorTools template - void - interpolate_to_different_mesh( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh( const DoFHandler & dof1, const VectorType & u1, const DoFHandler & dof2, @@ -899,9 +903,11 @@ namespace VectorTools interpolate_to_different_mesh(intergridmap, u1, constraints, u2); } + + template - void - interpolate_to_different_mesh( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void interpolate_to_different_mesh( const InterGridMap> & intergridmap, const VectorType & u1, const AffineConstraints &constraints, diff --git a/include/deal.II/numerics/vector_tools_mean_value.h b/include/deal.II/numerics/vector_tools_mean_value.h index 7ddd905b26..9dca097d13 100644 --- a/include/deal.II/numerics/vector_tools_mean_value.h +++ b/include/deal.II/numerics/vector_tools_mean_value.h @@ -98,8 +98,9 @@ namespace VectorTools * provided the boolean mask is empty, i.e. selecting the whole vector. */ template - void - subtract_mean_value(VectorType &v, const std::vector &p_select = {}); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void subtract_mean_value(VectorType & v, + const std::vector &p_select = {}); /** * Add the constant @p constant_adjustment to the specified @@ -128,11 +129,11 @@ namespace VectorTools * adjust a single component of a distributed vector. */ template - void - add_constant(VectorType & solution, - const DoFHandler & dof_handler, - const unsigned int component, - const typename VectorType::value_type constant_adjustment); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void add_constant(VectorType & solution, + const DoFHandler & dof_handler, + const unsigned int component, + const typename VectorType::value_type constant_adjustment); /** * Compute the mean value of one component of the solution. @@ -158,8 +159,8 @@ namespace VectorTools * mean value and subtract it right inside the evaluation routine. */ template - typename VectorType::value_type - compute_mean_value( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + typename VectorType::value_type compute_mean_value( const hp::MappingCollection &mapping_collection, const DoFHandler & dof, const hp::QCollection & q_collection, @@ -172,23 +173,25 @@ namespace VectorTools * and a single Mapping object. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - compute_mean_value(const Mapping & mapping, - const DoFHandler &dof, - const Quadrature & quadrature, - const VectorType & v, - const unsigned int component); + compute_mean_value(const Mapping & mapping, + const DoFHandler &dof, + const Quadrature & quadrature, + const VectorType & v, + const unsigned int component); /** * Call the other compute_mean_value() function, see above, with * mapping=MappingQ@(1). */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - compute_mean_value(const DoFHandler &dof, - const Quadrature & quadrature, - const VectorType & v, - const unsigned int component); + compute_mean_value(const DoFHandler &dof, + const Quadrature & quadrature, + const VectorType & v, + const unsigned int component); /** @} */ } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_mean_value.templates.h b/include/deal.II/numerics/vector_tools_mean_value.templates.h index e2a182d25b..94de319928 100644 --- a/include/deal.II/numerics/vector_tools_mean_value.templates.h +++ b/include/deal.II/numerics/vector_tools_mean_value.templates.h @@ -101,8 +101,8 @@ namespace VectorTools template - void - subtract_mean_value(VectorType &v, const std::vector &p_select) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void subtract_mean_value(VectorType &v, const std::vector &p_select) { internal::subtract_mean_value(v, p_select); } @@ -131,11 +131,11 @@ namespace VectorTools template - void - add_constant(VectorType & solution, - const DoFHandler & dof_handler, - const unsigned int component, - const typename VectorType::value_type constant_adjustment) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void add_constant(VectorType & solution, + const DoFHandler & dof_handler, + const unsigned int component, + const typename VectorType::value_type constant_adjustment) { Assert(dof_handler.has_hp_capabilities() == false, ExcNotImplemented()); @@ -289,8 +289,8 @@ namespace VectorTools template - typename VectorType::value_type - compute_mean_value( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + typename VectorType::value_type compute_mean_value( const hp::MappingCollection &mapping_collection, const DoFHandler & dof, const hp::QCollection & q_collection, @@ -370,12 +370,13 @@ namespace VectorTools template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - compute_mean_value(const Mapping & mapping, - const DoFHandler &dof, - const Quadrature & quadrature, - const VectorType & v, - const unsigned int component) + compute_mean_value(const Mapping & mapping, + const DoFHandler &dof, + const Quadrature & quadrature, + const VectorType & v, + const unsigned int component) { return compute_mean_value(hp::MappingCollection(mapping), dof, @@ -386,11 +387,12 @@ namespace VectorTools template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - compute_mean_value(const DoFHandler &dof, - const Quadrature & quadrature, - const VectorType & v, - const unsigned int component) + compute_mean_value(const DoFHandler &dof, + const Quadrature & quadrature, + const VectorType & v, + const unsigned int component) { return compute_mean_value(get_default_linear_mapping( dof.get_triangulation()), diff --git a/include/deal.II/numerics/vector_tools_point_gradient.h b/include/deal.II/numerics/vector_tools_point_gradient.h index d4a51e05e9..372b415201 100644 --- a/include/deal.II/numerics/vector_tools_point_gradient.h +++ b/include/deal.II/numerics/vector_tools_point_gradient.h @@ -27,6 +27,7 @@ DEAL_II_NAMESPACE_OPEN template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class Function; template @@ -86,8 +87,8 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const DoFHandler &dof, const VectorType & fe_function, const Point & point, @@ -110,8 +111,8 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const DoFHandler &dof, const VectorType & fe_function, const Point & point, @@ -150,10 +151,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Same as above for hp. @@ -172,10 +174,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Evaluate a possibly vector-valued finite element function defined by the @@ -210,8 +213,8 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const Mapping & mapping, const DoFHandler &dof, const VectorType & fe_function, @@ -235,8 +238,8 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const hp::MappingCollection &mapping, const DoFHandler & dof, const VectorType & fe_function, @@ -276,11 +279,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const Mapping & mapping, - const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const Mapping & mapping, + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Same as above for hp. @@ -299,11 +303,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point); /** @} */ } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_point_gradient.templates.h b/include/deal.II/numerics/vector_tools_point_gradient.templates.h index b3fe37b385..df1e7101c3 100644 --- a/include/deal.II/numerics/vector_tools_point_gradient.templates.h +++ b/include/deal.II/numerics/vector_tools_point_gradient.templates.h @@ -40,8 +40,8 @@ DEAL_II_NAMESPACE_OPEN namespace VectorTools { template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const DoFHandler &dof, const VectorType & fe_function, const Point & point, @@ -64,10 +64,11 @@ namespace VectorTools template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point) { if (dof.has_hp_capabilities() == false) return point_gradient(get_default_linear_mapping(dof.get_triangulation()), @@ -84,8 +85,8 @@ namespace VectorTools template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const Mapping & mapping, const DoFHandler &dof, const VectorType & fe_function, @@ -129,8 +130,8 @@ namespace VectorTools template - void - point_gradient( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_gradient( const hp::MappingCollection &mapping, const DoFHandler & dof, const VectorType & fe_function, @@ -176,11 +177,12 @@ namespace VectorTools template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const Mapping & mapping, - const DoFHandler &dof, - const VectorType & fe_function, - const Point & point) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const Mapping & mapping, + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point) { Assert(dof.get_fe(0).n_components() == 1, ExcMessage( @@ -195,11 +197,12 @@ namespace VectorTools template - Tensor<1, spacedim, typename VectorType::value_type> - point_gradient(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + Tensor<1, spacedim, typename VectorType::value_type> point_gradient( + const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point) { Assert(dof.get_fe(0).n_components() == 1, ExcMessage( diff --git a/include/deal.II/numerics/vector_tools_point_value.h b/include/deal.II/numerics/vector_tools_point_value.h index 972cd4696e..e1c5dfc975 100644 --- a/include/deal.II/numerics/vector_tools_point_value.h +++ b/include/deal.II/numerics/vector_tools_point_value.h @@ -24,6 +24,7 @@ DEAL_II_NAMESPACE_OPEN template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class Function; template @@ -236,8 +237,8 @@ namespace VectorTools * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ template - void - point_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_difference( const DoFHandler & dof, const VectorType & fe_function, const Function &exact_solution, @@ -257,8 +258,8 @@ namespace VectorTools * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ template - void - point_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_difference( const Mapping & mapping, const DoFHandler & dof, const VectorType & fe_function, @@ -303,11 +304,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_value(const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector &value); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector &value); /** * Same as above for hp. @@ -327,11 +328,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_value(const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector &value); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector &value); /** * Evaluate a scalar finite element function defined by the given DoFHandler @@ -373,10 +374,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + point_value(const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Same as above for hp. @@ -396,10 +398,11 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + point_value(const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Evaluate a possibly vector-valued finite element function defined by the @@ -436,12 +439,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_value(const Mapping & mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector &value); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const Mapping & mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector &value); /** * Same as above for hp. @@ -461,12 +464,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template - void - point_value(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector & value); + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector & value); /** * Evaluate a scalar finite element function defined by the given DoFHandler @@ -502,11 +505,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const Mapping & mapping, - const DoFHandler &dof, - const VectorType & fe_function, - const Point & point); + point_value(const Mapping & mapping, + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point); /** * Same as above for hp. @@ -526,11 +530,12 @@ namespace VectorTools * when trying to evaluate point values of discontinuous functions. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point); + point_value(const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point); /** @} */ } // namespace VectorTools diff --git a/include/deal.II/numerics/vector_tools_point_value.templates.h b/include/deal.II/numerics/vector_tools_point_value.templates.h index a5925f948e..0c0b7cd47e 100644 --- a/include/deal.II/numerics/vector_tools_point_value.templates.h +++ b/include/deal.II/numerics/vector_tools_point_value.templates.h @@ -42,11 +42,11 @@ DEAL_II_NAMESPACE_OPEN namespace VectorTools { template - void - point_value(const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector &value) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector &value) { if (dof.has_hp_capabilities() == false) point_value(get_default_linear_mapping(dof.get_triangulation()), @@ -64,10 +64,11 @@ namespace VectorTools template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const DoFHandler &dof, - const VectorType & fe_function, - const Point & point) + point_value(const DoFHandler &dof, + const VectorType & fe_function, + const Point & point) { if (dof.has_hp_capabilities() == false) return point_value(get_default_linear_mapping(dof.get_triangulation()), @@ -83,12 +84,12 @@ namespace VectorTools template - void - point_value(const Mapping & mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector &value) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const Mapping & mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector &value) { using Number = typename VectorType::value_type; const FiniteElement &fe = dof.get_fe(); @@ -126,12 +127,12 @@ namespace VectorTools template - void - point_value(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point, - Vector & value) + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_value(const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point, + Vector & value) { using Number = typename VectorType::value_type; const hp::FECollection &fe = dof.get_fe_collection(); @@ -173,11 +174,12 @@ namespace VectorTools template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const Mapping & mapping, - const DoFHandler &dof, - const VectorType & fe_function, - const Point & point) + point_value(const Mapping & mapping, + const DoFHandler &dof, + const VectorType & fe_function, + const Point & point) { Assert(dof.get_fe(0).n_components() == 1, ExcMessage( @@ -191,11 +193,12 @@ namespace VectorTools template + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) typename VectorType::value_type - point_value(const hp::MappingCollection &mapping, - const DoFHandler & dof, - const VectorType & fe_function, - const Point & point) + point_value(const hp::MappingCollection &mapping, + const DoFHandler & dof, + const VectorType & fe_function, + const Point & point) { Assert(dof.get_fe(0).n_components() == 1, ExcMessage( @@ -209,8 +212,8 @@ namespace VectorTools template - void - point_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_difference( const DoFHandler & dof, const VectorType & fe_function, const Function &exact_function, @@ -227,8 +230,8 @@ namespace VectorTools template - void - point_difference( + DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type) + void point_difference( const Mapping & mapping, const DoFHandler & dof, const VectorType & fe_function, diff --git a/include/deal.II/numerics/vector_tools_project.h b/include/deal.II/numerics/vector_tools_project.h index ee8b993c2e..00ec86fb2f 100644 --- a/include/deal.II/numerics/vector_tools_project.h +++ b/include/deal.II/numerics/vector_tools_project.h @@ -26,9 +26,11 @@ DEAL_II_NAMESPACE_OPEN template class AffineConstraints; + template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class Function; template @@ -139,67 +141,69 @@ namespace VectorTools * boundary before projecting the interior of the function. */ template - void - project(const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary = false, - const Quadrature &q_boundary = (dim > 1 ? - QGauss(2) : - Quadrature(0)), - const bool project_to_boundary_first = false); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const Mapping & mapping, + const DoFHandler & dof, + const AffineConstraints & constraints, + const Quadrature & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary = false, + const Quadrature &q_boundary = (dim > 1 ? QGauss(2) : + Quadrature(0)), + const bool project_to_boundary_first = false); /** * Call the project() function above, with * mapping=MappingQ@(1). */ template - void - project(const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary = false, - const Quadrature &q_boundary = (dim > 1 ? - QGauss(2) : - Quadrature(0)), - const bool project_to_boundary_first = false); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const DoFHandler & dof, + const AffineConstraints & constraints, + const Quadrature & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary = false, + const Quadrature &q_boundary = (dim > 1 ? QGauss(2) : + Quadrature(0)), + const bool project_to_boundary_first = false); /** * Same as above, but with hp-capabilities. */ template - void - project(const hp::MappingCollection & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const hp::QCollection & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary = false, - const hp::QCollection &q_boundary = hp::QCollection( - dim > 1 ? QGauss(2) : Quadrature(0)), - const bool project_to_boundary_first = false); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const hp::MappingCollection & mapping, + const DoFHandler & dof, + const AffineConstraints & constraints, + const hp::QCollection & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary = false, + const hp::QCollection &q_boundary = hp::QCollection( + dim > 1 ? QGauss(2) : Quadrature(0)), + const bool project_to_boundary_first = false); /** * Call the project() function above, with a collection of $Q_1$ mapping * objects, i.e., with hp::StaticMappingQ1::mapping_collection. */ template - void - project(const DoFHandler & dof, - const AffineConstraints &constraints, - const hp::QCollection & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary = false, - const hp::QCollection &q_boundary = hp::QCollection( - dim > 1 ? QGauss(2) : Quadrature(0)), - const bool project_to_boundary_first = false); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const DoFHandler & dof, + const AffineConstraints & constraints, + const hp::QCollection & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary = false, + const hp::QCollection &q_boundary = hp::QCollection( + dim > 1 ? QGauss(2) : Quadrature(0)), + const bool project_to_boundary_first = false); /** * The same as above for projection of scalar-valued quadrature data. @@ -226,15 +230,16 @@ namespace VectorTools * quadrature point data. */ template - void - project(const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const std::function::active_cell_iterator &, - const unsigned int)> & func, - VectorType & vec_result); + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const Mapping & mapping, + const DoFHandler & dof, + const AffineConstraints &constraints, + const Quadrature & quadrature, + const std::function::active_cell_iterator &, + const unsigned int)> & func, + VectorType & vec_result); /** * The same as above for projection of scalar-valued MatrixFree quadrature @@ -265,8 +270,8 @@ namespace VectorTools * FEEvaluation object. */ template - void - project( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( std::shared_ptr< const MatrixFree. */ template - void - project( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( std::shared_ptr< const MatrixFree - void - project_matrix_free_copy_vector( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project_matrix_free_copy_vector( const Mapping & mapping, const DoFHandler & dof, const AffineConstraints & constraints, @@ -478,8 +478,8 @@ namespace VectorTools class M_or_MC, template class Q_or_QC> - void - do_project( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void do_project( const M_or_MC & mapping, const DoFHandler & dof, const AffineConstraints & constraints, @@ -579,8 +579,8 @@ namespace VectorTools template - void - project_parallel( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project_parallel( const Mapping & mapping, const DoFHandler & dof, const AffineConstraints &constraints, @@ -682,8 +682,8 @@ namespace VectorTools template - void - project_parallel( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project_parallel( std::shared_ptr> matrix_free, const AffineConstraints &constraints, @@ -767,20 +767,21 @@ namespace VectorTools * based on the number of components. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) std::enable_if_t< !numbers::NumberTraits::is_complex && (dim == spacedim), - void> - project( - const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints & constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec_result, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + void> project(const Mapping & mapping, + const DoFHandler &dof, + const AffineConstraints + & constraints, + const Quadrature &quadrature, + const Function + & function, + VectorType & vec_result, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { // If we can, use the matrix-free implementation bool use_matrix_free = @@ -830,20 +831,21 @@ namespace VectorTools * for which we are sure that we cannot use the MatrixFree implementation. */ template + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) std::enable_if_t< numbers::NumberTraits::is_complex || (dim < spacedim), - void> - project( - const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints & constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec_result, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + void> project(const Mapping & mapping, + const DoFHandler &dof, + const AffineConstraints + & constraints, + const Quadrature &quadrature, + const Function + & function, + VectorType & vec_result, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { Assert((dynamic_cast *>( &(dof.get_triangulation())) == nullptr), @@ -864,15 +866,16 @@ namespace VectorTools template - void - project(const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const std::function::active_cell_iterator &, - const unsigned int)> & func, - VectorType & vec_result) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const Mapping & mapping, + const DoFHandler & dof, + const AffineConstraints &constraints, + const Quadrature & quadrature, + const std::function::active_cell_iterator &, + const unsigned int)> & func, + VectorType & vec_result) { internal::project_parallel( mapping, dof, constraints, quadrature, func, vec_result); @@ -881,18 +884,19 @@ namespace VectorTools template - void - project(std::shared_ptr>> matrix_free, - const AffineConstraints &constraints, - const unsigned int, - const std::function( - const unsigned int, - const unsigned int)> &func, - VectorType & vec_result, - const unsigned int fe_component) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + std::shared_ptr>> matrix_free, + const AffineConstraints &constraints, + const unsigned int, + const std::function( + const unsigned int, + const unsigned int)> &func, + VectorType & vec_result, + const unsigned int fe_component) { internal::project_parallel( matrix_free, constraints, func, vec_result, fe_component); @@ -901,17 +905,18 @@ namespace VectorTools template - void - project(std::shared_ptr>> matrix_free, - const AffineConstraints &constraints, - const std::function( - const unsigned int, - const unsigned int)> & func, - VectorType & vec_result, - const unsigned int fe_component) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + std::shared_ptr>> matrix_free, + const AffineConstraints &constraints, + const std::function( + const unsigned int, + const unsigned int)> & func, + VectorType & vec_result, + const unsigned int fe_component) { project(matrix_free, constraints, @@ -924,16 +929,17 @@ namespace VectorTools template - void - project(const Mapping & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec_result, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const Mapping & mapping, + const DoFHandler & dof, + const AffineConstraints & constraints, + const Quadrature & quadrature, + const Function &function, + VectorType & vec_result, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { internal::project(mapping, dof, @@ -949,15 +955,16 @@ namespace VectorTools template - void - project(const DoFHandler & dof, - const AffineConstraints &constraints, - const Quadrature & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const DoFHandler & dof, + const AffineConstraints & constraints, + const Quadrature & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { project(get_default_linear_mapping(dof.get_triangulation()), dof, @@ -973,16 +980,17 @@ namespace VectorTools template - void - project(const hp::MappingCollection & mapping, - const DoFHandler & dof, - const AffineConstraints &constraints, - const hp::QCollection & quadrature, - const Function &function, - VectorType & vec_result, - const bool enforce_zero_boundary, - const hp::QCollection &q_boundary, - const bool project_to_boundary_first) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const hp::MappingCollection & mapping, + const DoFHandler & dof, + const AffineConstraints & constraints, + const hp::QCollection & quadrature, + const Function &function, + VectorType & vec_result, + const bool enforce_zero_boundary, + const hp::QCollection &q_boundary, + const bool project_to_boundary_first) { Assert((dynamic_cast *>( &(dof.get_triangulation())) == nullptr), @@ -1002,15 +1010,16 @@ namespace VectorTools template - void - project(const DoFHandler & dof, - const AffineConstraints &constraints, - const hp::QCollection & quadrature, - const Function &function, - VectorType & vec, - const bool enforce_zero_boundary, - const hp::QCollection &q_boundary, - const bool project_to_boundary_first) + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void project( + const DoFHandler & dof, + const AffineConstraints & constraints, + const hp::QCollection & quadrature, + const Function &function, + VectorType & vec, + const bool enforce_zero_boundary, + const hp::QCollection &q_boundary, + const bool project_to_boundary_first) { project(hp::StaticMappingQ1::mapping_collection, dof, diff --git a/include/deal.II/numerics/vector_tools_rhs.h b/include/deal.II/numerics/vector_tools_rhs.h index 40cc523691..06197b15e4 100644 --- a/include/deal.II/numerics/vector_tools_rhs.h +++ b/include/deal.II/numerics/vector_tools_rhs.h @@ -24,9 +24,11 @@ DEAL_II_NAMESPACE_OPEN template class AffineConstraints; + template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) class DoFHandler; + template class Function; template @@ -56,8 +58,8 @@ namespace VectorTools * See the general documentation of this namespace for further information. */ template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const Mapping & mapping, const DoFHandler & dof, const Quadrature & q, @@ -71,8 +73,8 @@ namespace VectorTools * mapping=MappingQ@(1). */ template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const DoFHandler & dof, const Quadrature & q, const Function &rhs, @@ -84,8 +86,8 @@ namespace VectorTools * Like the previous set of functions, but for hp-objects. */ template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const hp::MappingCollection & mapping, const DoFHandler & dof, const hp::QCollection & q, @@ -98,8 +100,8 @@ namespace VectorTools * Like the previous set of functions, but for hp-objects. */ template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const DoFHandler & dof, const hp::QCollection & q, const Function &rhs, @@ -117,8 +119,8 @@ namespace VectorTools * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const Mapping & mapping, const DoFHandler & dof, const Quadrature & q, @@ -135,8 +137,8 @@ namespace VectorTools * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const DoFHandler & dof, const Quadrature & q, const Function &rhs, @@ -151,8 +153,8 @@ namespace VectorTools * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const hp::MappingCollection & mapping, const DoFHandler & dof, const hp::QCollection & q, @@ -170,8 +172,8 @@ namespace VectorTools * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const DoFHandler & dof, const hp::QCollection & q, const Function &rhs, diff --git a/include/deal.II/numerics/vector_tools_rhs.templates.h b/include/deal.II/numerics/vector_tools_rhs.templates.h index 1caf1ad2e0..cc0472b56a 100644 --- a/include/deal.II/numerics/vector_tools_rhs.templates.h +++ b/include/deal.II/numerics/vector_tools_rhs.templates.h @@ -37,8 +37,8 @@ DEAL_II_NAMESPACE_OPEN namespace VectorTools { template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const Mapping & mapping, const DoFHandler & dof_handler, const Quadrature & quadrature, @@ -159,8 +159,8 @@ namespace VectorTools template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const DoFHandler & dof_handler, const Quadrature & quadrature, const Function &rhs_function, @@ -178,8 +178,8 @@ namespace VectorTools template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const hp::MappingCollection & mapping, const DoFHandler & dof_handler, const hp::QCollection & quadrature, @@ -312,8 +312,8 @@ namespace VectorTools template - void - create_boundary_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_boundary_right_hand_side( const DoFHandler & dof_handler, const hp::QCollection & quadrature, const Function &rhs_function, @@ -329,9 +329,11 @@ namespace VectorTools boundary_ids); } + + template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const Mapping & mapping, const DoFHandler & dof_handler, const Quadrature & quadrature, @@ -447,8 +449,8 @@ namespace VectorTools template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const DoFHandler & dof_handler, const Quadrature & quadrature, const Function &rhs_function, @@ -467,8 +469,8 @@ namespace VectorTools template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const hp::MappingCollection & mapping, const DoFHandler & dof_handler, const hp::QCollection & quadrature, @@ -603,8 +605,8 @@ namespace VectorTools template - void - create_right_hand_side( + DEAL_II_CXX20_REQUIRES(concepts::is_writable_dealii_vector_type) + void create_right_hand_side( const DoFHandler & dof_handler, const hp::QCollection & quadrature, const Function &rhs_function,