]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix |= operator for Coupling
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 26 Jan 2006 11:31:38 +0000 (11:31 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Thu, 26 Jan 2006 11:31:38 +0000 (11:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@12181 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_tools.h

index 4639fec4707dfc6c5cf5ba5159f9950621acf70b..50591fda455e731677dd6f66077b59f94144d17c 100644 (file)
@@ -1638,14 +1638,14 @@ class DoFTools
  *
  * @relates DoFTools
  */
-DoFTools::Coupling operator |= (const DoFTools::Coupling& c1,
-                               const DoFTools::Coupling& c2)
+DoFTools::Coupling operator |= (DoFTools::Coupling& c1,
+                               const DoFTools::Coupling c2)
 {
-  if (c1 == DoFTools::always || c2 == DoFTools::always)
-    return DoFTools::always;
-  if (c1 == DoFTools::nonzero || c2 == DoFTools::nonzero)
-    return DoFTools::nonzero;
-  return DoFTools::none;
+  if (c2 == DoFTools::always)
+    c1 = DoFTools::always;
+  else if (c1 != DoFTools::always && c2 == DoFTools::nonzero)
+    return c1 = DoFTools::nonzero;
+  return c1;
 }
 
 
@@ -1654,8 +1654,8 @@ DoFTools::Coupling operator |= (const DoFTools::Coupling& c1,
  *
  * @relates DoFTools
  */
-DoFTools::Coupling operator | (const DoFTools::Coupling& c1,
-                              const DoFTools::Coupling& c2)
+DoFTools::Coupling operator | (const DoFTools::Coupling c1,
+                              const DoFTools::Coupling c2)
 {
   if (c1 == DoFTools::always || c2 == DoFTools::always)
     return DoFTools::always;

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.