From 69fe08593509751eac55306cfe6ad5759eb1c9ec Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 14 Sep 2019 09:29:51 +0200
Subject: [PATCH] choose frequency

---
 Magnetodynamics/electromagnet.pro | 7 +++++--
 Magnetodynamics/transfo.pro       | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Magnetodynamics/electromagnet.pro b/Magnetodynamics/electromagnet.pro
index a381e59..a693c64 100644
--- a/Magnetodynamics/electromagnet.pro
+++ b/Magnetodynamics/electromagnet.pro
@@ -14,7 +14,7 @@
 
    To compute the solution interactively from the Gmsh GUI:
        File > Open > electromagnet.pro
-       You may choose the Resolution in the left panel: 
+       You may choose the Resolution in the left panel:
        Magnetodynamics2D_av (default) or Magnetostatics2D_a
        Run (button at the bottom of the left panel)
    ------------------------------------------------------------------- */
@@ -41,9 +41,11 @@ Group {
 Function {
   DefineConstant[
     murCore = {100, Name "Model parameters/Mur core"},
-    Current = {0.01, Name "Model parameters/Current"}
+    Current = {0.01, Name "Model parameters/Current"},
+    frequency = {1, Name "Model parameters/Frequency"}
   ];
 
+  Freq = frequency;
   mu0 = 4.e-7 * Pi;
   nu[ Region[{Air, Ind, AirInf}] ]  = 1. / mu0;
   nu[ Core ]  = 1. / (murCore * mu0);
@@ -86,6 +88,7 @@ PostOperation {
     Operation {
       Print[ a, OnElementsOf Vol_Mag, File "a.pos" ];
       Print[ b, OnElementsOf Vol_Mag, File "b.pos" , HarmonicToTime 20];
+      Print[ j, OnElementsOf Vol_Mag, File "j.pos", HarmonicToTime 20];
     }
   }
 }
diff --git a/Magnetodynamics/transfo.pro b/Magnetodynamics/transfo.pro
index 3d7cd43..026b91d 100644
--- a/Magnetodynamics/transfo.pro
+++ b/Magnetodynamics/transfo.pro
@@ -215,6 +215,7 @@ PostOperation {
       Print[ b, OnElementsOf Vol_Mag, Format Gmsh, File "b.pos" ];
       Print[ az, OnElementsOf Vol_Mag, Format Gmsh, File "az.pos" ];
 
+    If (type_Analysis == 1) // frequency domain
       If (type_Source == 1) // current
         // In text file UI.txt: voltage and current for each coil portion (note
         // that the voltage is not equally distributed in PLUS and MINUS
@@ -246,6 +247,7 @@ PostOperation {
         Print[ U, OnRegion R_out, Format FrequencyTable, File > "UI.txt" ];
         Print[ I, OnRegion R_out, Format FrequencyTable, File > "UI.txt"];
       EndIf
+    EndIf
     }
   }
 }
-- 
GitLab