#include <deal.II/base/config.h>
+#include <deal.II/lac/read_vector.h>
+
#include <vector>
DEAL_II_NAMESPACE_OPEN
* finite element function with mean value zero. In fact, it only works for
* Lagrangian elements. For all other elements, you will need to compute the
* mean value and subtract it right inside the evaluation routine.
- *
- * @dealiiConceptRequires{concepts::is_dealii_vector_type<VectorType>}
*/
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type compute_mean_value(
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(
const hp::MappingCollection<dim, spacedim> &mapping_collection,
const DoFHandler<dim, spacedim> & dof,
const hp::QCollection<dim> & q_collection,
- const VectorType & v,
+ const ReadVector<Number> & v,
const unsigned int component);
/**
* Calls the other compute_mean_value() function, see above, for the non-hp
* case. That means, it requires a single FiniteElement, a single Quadrature,
* and a single Mapping object.
- *
- * @dealiiConceptRequires{concepts::is_dealii_vector_type<VectorType>}
*/
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type
- compute_mean_value(const Mapping<dim, spacedim> & mapping,
- const DoFHandler<dim, spacedim> &dof,
- const Quadrature<dim> & quadrature,
- const VectorType & v,
- const unsigned int component);
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(const Mapping<dim, spacedim> & mapping,
+ const DoFHandler<dim, spacedim> &dof,
+ const Quadrature<dim> & quadrature,
+ const ReadVector<Number> & v,
+ const unsigned int component);
/**
* Call the other compute_mean_value() function, see above, with
* <tt>mapping=MappingQ@<dim@>(1)</tt>.
- *
- * @dealiiConceptRequires{concepts::is_dealii_vector_type<VectorType>}
*/
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type
- compute_mean_value(const DoFHandler<dim, spacedim> &dof,
- const Quadrature<dim> & quadrature,
- const VectorType & v,
- const unsigned int component);
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(const DoFHandler<dim, spacedim> &dof,
+ const Quadrature<dim> & quadrature,
+ const ReadVector<Number> & v,
+ const unsigned int component);
/** @} */
} // namespace VectorTools
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type compute_mean_value(
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(
const hp::MappingCollection<dim, spacedim> &mapping_collection,
const DoFHandler<dim, spacedim> & dof,
const hp::QCollection<dim> & q_collection,
- const VectorType & v,
+ const ReadVector<Number> & v,
const unsigned int component)
{
- using Number = typename VectorType::value_type;
-
const hp::FECollection<dim, spacedim> &fe_collection =
dof.get_fe_collection();
const unsigned int n_components = fe_collection.n_components();
}
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type
- compute_mean_value(const Mapping<dim, spacedim> & mapping,
- const DoFHandler<dim, spacedim> &dof,
- const Quadrature<dim> & quadrature,
- const VectorType & v,
- const unsigned int component)
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(const Mapping<dim, spacedim> & mapping,
+ const DoFHandler<dim, spacedim> &dof,
+ const Quadrature<dim> & quadrature,
+ const ReadVector<Number> & v,
+ const unsigned int component)
{
return compute_mean_value(hp::MappingCollection<dim, spacedim>(mapping),
dof,
}
- template <int dim, typename VectorType, int spacedim>
- DEAL_II_CXX20_REQUIRES(concepts::is_dealii_vector_type<VectorType>)
- typename VectorType::value_type
- compute_mean_value(const DoFHandler<dim, spacedim> &dof,
- const Quadrature<dim> & quadrature,
- const VectorType & v,
- const unsigned int component)
+ template <int dim, typename Number, int spacedim>
+ Number
+ compute_mean_value(const DoFHandler<dim, spacedim> &dof,
+ const Quadrature<dim> & quadrature,
+ const ReadVector<Number> & v,
+ const unsigned int component)
{
return compute_mean_value(get_default_linear_mapping(
dof.get_triangulation()),
//
// ---------------------------------------------------------------------
-
-for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
namespace VectorTools
\{
-
- template VEC::value_type
- compute_mean_value<deal_II_dimension>(
+ template S
+ compute_mean_value(
const Mapping<deal_II_dimension, deal_II_space_dimension> &,
const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
const Quadrature<deal_II_dimension> &,
- const VEC &,
+ const ReadVector<S> &,
const unsigned int);
- template VEC::value_type
- compute_mean_value<deal_II_dimension>(
+ template S
+ compute_mean_value(
const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
const Quadrature<deal_II_dimension> &,
- const VEC &,
+ const ReadVector<S> &,
const unsigned int);
+ \}
+#endif
+ }
+for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+ deal_II_space_dimension : SPACE_DIMENSIONS)
+ {
+#if deal_II_dimension <= deal_II_space_dimension
+ namespace VectorTools
+ \{
template void
- add_constant<>(VEC & solution,
- const DoFHandler<deal_II_dimension,
- deal_II_space_dimension> &dof_handler,
- const unsigned int component,
- const typename VEC::value_type constant_adjustment);
+ add_constant(VEC &solution,
+ const DoFHandler<deal_II_dimension, deal_II_space_dimension>
+ & dof_handler,
+ const unsigned int component,
+ const typename VEC::value_type constant_adjustment);
\}
#endif
}