diff --git a/Antennas/dipole.pro b/Antennas/dipole.pro index cbf83b11e998f8f80fb74430409ceef2f07bae3a..cf022c8075069ac03b6c35f819661abbd370d1f4 100644 --- a/Antennas/dipole.pro +++ b/Antennas/dipole.pro @@ -130,6 +130,7 @@ Function { eta0 = 120*Pi ; // eta0 = Sqrt(mu0/eps0) + // FIXME: CG "Y[]" should be 0 in 3D !? dR[] = (Flag_3Dmodel) ? Unit[ Vector[Sin[Atan2[Z[],X[]]#1], Y[], -Cos[#1]] ] : Vector[0,0,-1] ; diff --git a/ElectricMachines/driver.py b/ElectricMachines/driver.py index 60660cf1f7df609b960c55a1a1e68c00d57076bc..9eb76903b5c75b364679a481829afccd904aba70 100644 --- a/ElectricMachines/driver.py +++ b/ElectricMachines/driver.py @@ -13,19 +13,24 @@ import onelab # create a new onelab client c = onelab.client(__file__) -# get Gmsh and GetDP locations from Gmsh options +# get Gmsh location from Gmsh options mygmsh = c.getString('General.ExecutableFileName') -mygetdp = '' -for s in range(9): - n = c.getString('Solver.Name' + str(s)) - if(n == 'GetDP'): - mygetdp = c.getString('Solver.Executable' + str(s)) - break + +# Either force GetDP location, or also get it from Gmsh options: adapt the +# following line if you want to force the value: +mygetdp = '' # '/usr/local/bin/getdp' if(not len(mygetdp)): - c.sendError('This appears to be the first time you are trying to run GetDP') - c.sendError('Please run a GetDP model interactively once with Gmsh to ' + - 'initialize the solver location') - exit(0) + for s in range(9): + n = c.getString('Solver.Name' + str(s)) + if(n == 'GetDP'): + mygetdp = c.getString('Solver.Executable' + str(s)) + break + if(not len(mygetdp)): + c.sendError('This appears to be the first time you are trying to run GetDP') + c.sendError('Please run a GetDP model interactively once with Gmsh to ' + + 'initialize the solver location; or set the location by by hand ' + + 'in the python script' ) + exit(0) c.sendInfo('Will use gmsh={0} and getdp={1}'.format(mygmsh, mygetdp)) @@ -45,17 +50,16 @@ machine_pro = c.getPath(machine + '.pro') angles = [0, 10, 20, 30] for angle in angles: c.setNumber('Input/21Start rotor angle [deg]', value=angle) - + # run gmsh as a subclient c.runSubClient('myGmsh', mygmsh + ' ' + machine_geo + ' -2 -v 2') - + # run getdp as a subclient c.runSubClient('myGetDP', mygetdp + ' ' + machine_pro + ' -msh ' + machine_msh + ' -setnumber Flag_PrintFields 0 -solve Analysis -v 2') - + # retrieve the torque torque = c.getNumber('Output - Mechanics/0Torque [Nm]/rotor') c.sendInfo('Torque={0} for angle={1}'.format(torque, angle)) - diff --git a/GetDDM/waveguide2d.pro b/GetDDM/waveguide2d.pro index 4f444742890dde55289e9861cf3cbf41706227c4..8e6fc0b94aa823739d21f6c3f0170a83c7a83a8d 100644 --- a/GetDDM/waveguide2d.pro +++ b/GetDDM/waveguide2d.pro @@ -48,7 +48,7 @@ Function { // OO2 Gander 2002, pp. 46-47 xsimin = 0; xsimax = Pi / LC; - deltak[] = Pi; + deltak[] = Pi; // Ruyiang+Nicolas test Pi/0.06 alphastar[] = I[] * ((k[]^2 - xsimin^2) * (k[]^2 - (k[]-deltak[])^2))^(1/4); betastar[] = ((xsimax^2 - k[]^2) * ((k[]+deltak[])^2 - k[]^2))^(1/4); a[] = - (alphastar[] * betastar[] - k[]^2) / (alphastar[] + betastar[]); @@ -67,12 +67,12 @@ Group{ For idom In {0:N_DOM-1} left = (idom-1)%N_DOM; // left boundary right = (idom+1)%N_DOM; // right boundary - + D() += idom; - + Omega~{idom} = Region[((idom+1)*1000+200)]; GammaD0~{idom} = Region[{}]; - + If(WALLS == 1) GammaD0~{idom} += Region[ ((idom+1)*1000+202) ]; EndIf @@ -84,14 +84,14 @@ Group{ If (idom == 0) D~{idom} = {right}; - + Pml~{idom}~{right} = Region[{}]; PmlD0~{idom}~{right} = Region[{}]; PmlInf~{idom}~{right} = Region[{}]; - + Sigma~{idom}~{right} = Region[ ((idom+1)*1000+20) ]; Sigma~{idom} = Region[{Sigma~{idom}~{right}}] ; - + GammaD~{idom} = Region[ ((idom+1)*1000+10) ]; Pml~{idom}~{right} += Region[ ((idom+1)*1000+300) ]; If(WALLS == 1) @@ -101,20 +101,20 @@ Group{ PmlInf~{idom}~{right} += Region[ ((idom+1)*1000+302) ]; EndIf PmlInf~{idom}~{right} += Region[ ((idom+1)*1000+4) ]; - + BndSigma~{idom}~{right} = Region[{}]; BndSigma~{idom} = Region[{BndSigma~{idom}~{right}}] ; - + BndGammaInf~{idom}~{right} = Region[{}]; BndGammaInf~{idom} = Region[{BndGammaInf~{idom}~{right}}] ; EndIf If (idom == N_DOM-1) D~{idom} = {left}; - + Pml~{idom}~{left} = Region[{}]; PmlD0~{idom}~{left} = Region[{}]; PmlInf~{idom}~{left} = Region[{}]; - + Sigma~{idom}~{left} = Region[ ((idom+1)*1000+10) ]; Sigma~{idom} = Region[{Sigma~{idom}~{left}}] ; @@ -128,27 +128,27 @@ Group{ PmlInf~{idom}~{left} += Region[ ((idom+1)*1000+102) ]; EndIf PmlInf~{idom}~{left} += Region[ ((idom+1)*1000+1) ]; - + BndSigma~{idom}~{left} = Region[{}]; BndSigma~{idom} = Region[{BndSigma~{idom}~{left}}] ; - + BndGammaInf~{idom}~{left} = Region[{}]; BndGammaInf~{idom} = Region[{BndGammaInf~{idom}~{left}}] ; EndIf If (idom >= 1 && idom < N_DOM-1) D~{idom} = {left, right}; - + Pml~{idom}~{left} = Region[{}]; Pml~{idom}~{right} = Region[{}]; PmlD0~{idom}~{left} = Region[{}]; PmlD0~{idom}~{right} = Region[{}]; PmlInf~{idom}~{left} = Region[{}]; PmlInf~{idom}~{right} = Region[{}]; - + Sigma~{idom}~{left} = Region[ ((idom+1)*1000+10) ]; Sigma~{idom}~{right} = Region[ ((idom+1)*1000+20) ]; Sigma~{idom} = Region[{Sigma~{idom}~{left}, Sigma~{idom}~{right}}] ; - + GammaD~{idom} = Region[{}]; Pml~{idom}~{left} += Region[ ((idom+1)*1000+100) ]; Pml~{idom}~{right} += Region[ ((idom+1)*1000+300) ]; @@ -162,11 +162,11 @@ Group{ EndIf PmlInf~{idom}~{left} += Region[ ((idom+1)*1000+1) ]; PmlInf~{idom}~{right} += Region[ ((idom+1)*1000+4) ]; - + BndSigma~{idom}~{left} = Region[{}]; BndSigma~{idom}~{right} = Region[{}]; BndSigma~{idom} = Region[{BndSigma~{idom}~{left}, BndSigma~{idom}~{right}}] ; - + BndGammaInf~{idom}~{left} = Region[{}]; BndGammaInf~{idom}~{right} = Region[{}]; BndGammaInf~{idom} = Region[{BndGammaInf~{idom}~{left}, BndGammaInf~{idom}~{right}}] ; @@ -196,7 +196,7 @@ Function{ idom = ii; left = (idom-1)%N_DOM; // left boundary right = (idom+1)%N_DOM; // right boundary - + If (idom == 0) kPml~{idom}~{right}[] = k[ Vector[xSigma~{idom}~{right},Y[],Z[]] ] ; // Bermudez damping functions