From eebdf8242c2146799fa706b8d9eba3413a4221a3 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 14 Sep 2019 09:29:23 +0200
Subject: [PATCH] BC type was inverted (fixes #2)

---
 ElectrostaticsFloating/floating.pro | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/ElectrostaticsFloating/floating.pro b/ElectrostaticsFloating/floating.pro
index cbe37d6..040a4ee 100644
--- a/ElectrostaticsFloating/floating.pro
+++ b/ElectrostaticsFloating/floating.pro
@@ -96,19 +96,21 @@ Constraint {
   { Name SetGlobalPotential; Type Assign;
     Case {
       /* Impose the potential regionwise on the different parts of
-	 "Sur_Electrodes_Ele". No voltage is imposed to the Microstrip electrode
-	 when the "Fixed charge" option is enabled (if MicrostripTypeBC != 0). */
+	 "Sur_Electrodes_Ele". The voltage is imposed to the Microstrip
+	 electrode when the "Fixed voltage" option is enabled, i.e. if
+	 MicrostripTypeBC == 0. */
       { Region Ground; Value 0; }
-      If(!MicrostripTypeBC)
-	    { Region Microstrip; Value MicrostripValueBC; }
+      If(MicrostripTypeBC == 0)
+        { Region Microstrip; Value MicrostripValueBC; }
       EndIf
     }
   }
   { Name SetArmatureCharge; Type Assign;
     Case {
-      /* Impose the charge if MicrostripTypeBC != 0 */
-      If(MicrostripTypeBC)
-	    { Region Microstrip; Value MicrostripValueBC; }
+      /* Impose the charge on the Microstrip electrode when the "Fixed charged"
+      option is enabled, i.e. if MicrostripTypeBC == 1. */
+      If(MicrostripTypeBC == 1)
+        { Region Microstrip; Value MicrostripValueBC; }
       EndIf
     }
   }
-- 
GitLab