From: bangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Sat, 26 Jan 2008 04:46:51 +0000 (+0000)
Subject: Add an assertion for the right size of the component mask which apparently was forgotten.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=369d6ac6bd1de1662b142191bd0a134b037c9037;p=dealii-svn.git

Add an assertion for the right size of the component mask which apparently was forgotten.

git-svn-id: https://svn.dealii.org/trunk@15689 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/deal.II/include/numerics/vectors.templates.h b/deal.II/deal.II/include/numerics/vectors.templates.h
index e944621fa7..0b90d4057f 100644
--- a/deal.II/deal.II/include/numerics/vectors.templates.h
+++ b/deal.II/deal.II/include/numerics/vectors.templates.h
@@ -1197,7 +1197,12 @@ VectorTools::interpolate_boundary_values (const Mapping<dim>         &,
 {
   Assert (boundary_component != 255,
 	  ExcInvalidBoundaryIndicator());
-
+  Assert ((component_mask_.size() == 0) ||
+	  (component_mask_.size() == dof.get_fe().n_components()),
+	  ExcMessage ("The number of components in the mask has to be either "
+		      "zero or equal to the number of components in the finite "
+		      "element."));
+    
 				   // check whether boundary values at
 				   // the left or right boundary of
 				   // the line are
@@ -1296,6 +1301,13 @@ interpolate_boundary_values (const Mapping<dim>            &mapping,
                              std::map<unsigned int,double> &boundary_values,
                              const std::vector<bool>       &component_mask_)
 {
+  Assert ((component_mask_.size() == 0) ||
+	  (component_mask_.size() == dof.get_fe().n_components()),
+	  ExcMessage ("The number of components in the mask has to be either "
+		      "zero or equal to the number of components in the finite "
+		      "element."));
+
+
 				   // if for whatever reason we were
 				   // passed an empty map, return
 				   // immediately