From: Wolfgang Bangerth Date: Mon, 5 Dec 2005 22:53:21 +0000 (+0000) Subject: Add second constructor to ComponentSelectFunction. X-Git-Tag: v8.0.0~12805 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf9f036e27d75bb8cb19b5ef1d6d36f78412a9e;p=dealii.git Add second constructor to ComponentSelectFunction. git-svn-id: https://svn.dealii.org/trunk@11831 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/function.h b/deal.II/base/include/base/function.h index fb83ca30a6..d42de79112 100644 --- a/deal.II/base/include/base/function.h +++ b/deal.II/base/include/base/function.h @@ -600,6 +600,16 @@ class ComponentSelectFunction : public ConstantFunction const double value, const unsigned int n_components); + /** + * Constructor. As before, but + * the value for the selected + * component is assumed to be + * one. In essence, this function + * then works as a mask. + */ + ComponentSelectFunction (const unsigned int selected, + const unsigned int n_components); + /** * Return the value of the function * at the given point for all diff --git a/deal.II/base/source/function.cc b/deal.II/base/source/function.cc index deb9f35aca..86ebdb96d7 100644 --- a/deal.II/base/source/function.cc +++ b/deal.II/base/source/function.cc @@ -415,6 +415,17 @@ ComponentSelectFunction (const unsigned int selected, +template +ComponentSelectFunction:: +ComponentSelectFunction (const unsigned int selected, + const unsigned int n_components) + : + ConstantFunction (1., n_components), + selected(selected) +{} + + + template void ComponentSelectFunction::vector_value (const Point &, Vector &return_value) const