]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
introduce function to set single components in mask
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 20 Jun 2014 15:39:05 +0000 (15:39 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 20 Jun 2014 15:39:05 +0000 (15:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@33066 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/fe/component_mask.h

index bb60046fc4da7d48918eef1ac80e1e879459768e..04099c9a1471b494c76604c174cf291f90d59166 100644 (file)
@@ -98,6 +98,11 @@ public:
   ComponentMask (const unsigned int n_components,
                  const bool         initializer);
 
+  /**
+   * Set a particular entry in the mask to a value.
+   */
+  void set (const unsigned int index, const bool value);
+    
   /**
    * If this component mask has been initialized with a mask of
    * size greater than zero, then return the size of the mask
@@ -274,6 +279,15 @@ ComponentMask::size () const
 }
 
 
+inline
+void
+ComponentMask::set(const unsigned int index, const bool value)
+{
+  AssertIndexRange(index, component_mask.size());
+  component_mask[index] = value;
+}
+
+
 inline
 bool
 ComponentMask::operator [](const unsigned int component_index) const
@@ -286,8 +300,7 @@ ComponentMask::operator [](const unsigned int component_index) const
     {
       // otherwise check the validity of the index and
       // return whatever is appropriate
-      Assert (component_index < component_mask.size(),
-              ExcIndexRange (component_index, 0, component_mask.size()));
+      AssertIndexRange (component_index, component_mask.size());
       return component_mask[component_index];
     }
 }

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.