]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add second constructor to ComponentSelectFunction.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 5 Dec 2005 22:53:21 +0000 (22:53 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 5 Dec 2005 22:53:21 +0000 (22:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@11831 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/function.h
deal.II/base/source/function.cc

index fb83ca30a694160807adae23c4975a59e46f49bd..d42de791125dbba0c7554508c101dc7a88f1acb9 100644 (file)
@@ -600,6 +600,16 @@ class ComponentSelectFunction : public ConstantFunction<dim>
                             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
index deb9f35aca15ee628bb596b549904a6ef76c8ee2..86ebdb96d725203278c86b61f13475b93332fa38 100644 (file)
@@ -415,6 +415,17 @@ ComponentSelectFunction (const unsigned int selected,
 
 
 
+template <int dim>
+ComponentSelectFunction<dim>::
+ComponentSelectFunction (const unsigned int selected,
+                         const unsigned int n_components)
+               :
+               ConstantFunction<dim> (1., n_components),
+                selected(selected)
+{}
+
+
+
 template <int dim>
 void ComponentSelectFunction<dim>::vector_value (const Point<dim> &,
                                                 Vector<double>   &return_value) const

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.