From d7ce1b2d1e465947d57c7d088ac0802de3fb3456 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Henrotte?= <francois.henrotte@uclouvain.be>
Date: Wed, 18 Mar 2020 13:04:59 +0100
Subject: [PATCH] update

---
 Conductors3D/w3d.geo        |  3 +++
 Conductors3D/w3d.pro        | 14 ++++++++------
 Conductors3D/w3d_common.pro |  4 +++-
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Conductors3D/w3d.geo b/Conductors3D/w3d.geo
index 58a8812..cdc2a4c 100644
--- a/Conductors3D/w3d.geo
+++ b/Conductors3D/w3d.geo
@@ -101,6 +101,7 @@ ElseIf( Flag_RegSleeve ) // regular sleeve
   Wires[]=  {};
   For i In {1:NumWires}
     e[] = Extrude {0,0,Lz} { Point{ centerWires[i-1] } ; /*Layers{1};*/ } ;
+    Transfinite Curve{ e[1] } = NbDivision+1;
     Physical Line  (Sprintf("LWIRE_%g",i), 50+i) = { e[1] };
     Physical Point (Sprintf("PANODE_%g",i), 60+i) = { centerWires[i-1] };
     Physical Point (Sprintf("PCATHODE_%g",i), 70+i) = { e[0] };
@@ -115,6 +116,7 @@ ElseIf( Flag_RegSleeve ) // regular sleeve
   s1 = news; Plane Surface(s1) = {ll1,-llWires[]};
   e[] = Extrude {0,0,Lz} { Surface{ s1 } ; /*Layers{1}; Recombine;*/ } ;
   Physical Volume ("AIR", 1) = { e[1], Wires[] };
+  Physical Volume ("BLA", 5) = { e[1] };
 
 Else
 
@@ -125,6 +127,7 @@ Else
   Physical Volume ("AIR", 1) = { v1 };
   For i In {1:NumWires}
     e[] = Extrude {0,0,Lz} { Point{ centerWires[i-1] } ; /*Layers{1};*/ } ;
+    Transfinite Curve{ e[1] } = NbDivision+1;
     //Printf("e=", e[]);
     Physical Line  (Sprintf("LWIRE_%g",i), 50+i) = { e[1] };
     Physical Point (Sprintf("PANODE_%g",i), 60+i) = { centerWires[i-1] };
diff --git a/Conductors3D/w3d.pro b/Conductors3D/w3d.pro
index c4c5a47..b3700d4 100644
--- a/Conductors3D/w3d.pro
+++ b/Conductors3D/w3d.pro
@@ -34,6 +34,7 @@ Group{
   INF = Region[ 2 ];
   SKIN = Region[ 3 ];
   LINTREE = Region[ 4 ]; // not used
+  BLA = Region[ 5 ]; 
 
   VWIRES = Region[ {} ];
   LWIRES = Region[ {} ];
@@ -82,8 +83,8 @@ Group{
 
   // additional Groups for the semi_analytic approach
   Dom_Hthin_a = ElementsOf[ Vol_nu, OnOneSideOf LWIRES ];
-  //Vol_Tree = ElementsOf[ Vol_nu, Not Dom_Hthin_a ];
-  Vol_Tree = Region[ { Vol_nu } ];
+  Vol_Tree = ElementsOf[ Vol_nu, DisjointOf LWIRES ];
+  //Vol_Tree = Region[ { BLA } ];
   Sur_Tree = Region[ { Sur_Dirichlet_a /*, SKIN*/ } ];
   If( !Flag_SemiAnalytic )
     Lin_Tree = Region[ {} ];
@@ -434,12 +435,12 @@ Formulation {
           
         Integral { [ nu[] * Dof{d a} , {d a} ];
           In Vol_nu; Jacobian Vol; Integration I1; }
-        GlobalTerm { [ -Dof{I}*1e1 , {F} ]; 
+        GlobalTerm { [ -Dof{I}*NbDivision , {F} ]; 
           In Vol_nu; }
           
         Integral { [ nu[] * Dof{d as} , {d as} ];
           In Vol_nu; Jacobian Vol; Integration I1; }
-        GlobalTerm { [ -Dof{Is}*1e1 , {Fs} ]; 
+        GlobalTerm { [ -Dof{Is}*NbDivision , {Fs} ]; 
           In Vol_nu; }
             
         // Integral { [ -Dof{i}/A_c , {as} ];
@@ -569,7 +570,7 @@ PostProcessing {
 
 PostOperation map UsingPost MagnetoDynamics {
      
-  Print[ b, OnElementsOf Vol_nu, File "b.pos"];
+  Print[ b, OnElementsOf Vol_Tree, File "b.pos"];
     
   If( !Flag_SemiAnalytic )
     Print[ J, OnElementsOf Vol_C, File "j.pos"];
@@ -579,7 +580,8 @@ PostOperation map UsingPost MagnetoDynamics {
       In Vol_nu, File "group.pos"];
   EndIf
   PrintGroup[ EdgesOfTreeIn[ { Vol_Tree }, StartingOn { Sur_Tree, Lin_Tree } ],
-    In Vol_Tree, File "Tree.pos"];
+    In Vol_nu, File "Tree.pos"];
+
   //PrintGroup[ _CO_Entity_44, In Vol_nu, File "Tree.pos"];
 
 }
diff --git a/Conductors3D/w3d_common.pro b/Conductors3D/w3d_common.pro
index 3f34eed..8bb6be1 100644
--- a/Conductors3D/w3d_common.pro
+++ b/Conductors3D/w3d_common.pro
@@ -14,7 +14,7 @@ DefineConstant[
   
   Flag_Thin = {1, Name "Parameters/01Thin wires", 
     Choices {0,1}, Visible 1}
-  Flag_RegSleeve = {0, Name "Parameters/02Regular sleeves", 
+  Flag_RegSleeve = {1, Name "Parameters/02Regular sleeves", 
     Choices {0,1}, Visible Flag_Thin}
   
   Flag_SemiAnalytic = {1, Name "Parameters/03Semi-analytic approach", 
@@ -44,6 +44,8 @@ DefineConstant[
   A_c = Pi*rw^2 // wire cross section
   rout = box
   Lz = 10*mm
+  NbDivision = 10
+  
 
   /* 'WireRadius' is the actual radius of the wire.
      'MeshSizeWire' is the imposed mesh size at the nodes of the wire,
-- 
GitLab