Update Helix example

pull/1/head
Thorsten Liebig 2010-03-15 16:58:28 +01:00
parent 7539396cc3
commit 3bf292c95c
2 changed files with 97 additions and 68 deletions

View File

@ -599,18 +599,20 @@ void BuildCoaxial_Cartesian(const char* filename)
void BuildHelix(const char* filename)
{
int maxIter = 10000;
double f0=0.15e9;
double fc=0.15e9;
int maxIter = 1e5;
double f0=0.5e9;
double fc=0.5e9;
int Excit_Type=0;
int bounds[] = {1,1,1,1,0,0};
int bounds[] = {1,1,1,1,1,1};
cerr << "Create Helix Geometry..." << endl;
ContinuousStructure CSX;
double width = 800;
double length = 800;
double delta[] = {5,5,5};
double feed_length=10;
double wire_rad = 0.7;
double coil_rad = 10;
double coil_length = 50;
double delta[] = {0.5,0.5,0.5};
//MSL
CSPropMaterial* copper = new CSPropMaterial(CSX.GetParameterSet());
@ -620,19 +622,37 @@ void BuildHelix(const char* filename)
CSPrimUserDefined* helix = new CSPrimUserDefined(CSX.GetParameterSet(),copper);
helix->SetCoordSystem(CSPrimUserDefined::CYLINDER_SYSTEM);
helix->SetFunction("(r<110)&(r>90)&(sqrt(pow(x-r*cos(2*pi*z/100),2)+pow(y-r*sin(2*pi*z/100),2))<20)&(z>200)&(z<600)");
helix->SetFunction("(r>9)&(r<11)&(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))<2)&(z>0)&(z<50)");
CSX.AddPrimitive(helix);
CSPrimCylinder* cyl = new CSPrimCylinder(CSX.GetParameterSet(),copper);
cyl->SetRadius(10);
cyl->SetCoord(0,100.0);cyl->SetCoord(1,310.0);
cyl->SetRadius(wire_rad);
cyl->SetCoord(0,coil_rad);cyl->SetCoord(1,coil_rad+feed_length);
cyl->SetCoord(2,0.0);cyl->SetCoord(3,0.0);
cyl->SetCoord(4,200.0);cyl->SetCoord(5,200.0);
cyl->SetCoord(4,0.0);cyl->SetCoord(5,0.0);
CSX.AddPrimitive(cyl);
cyl = new CSPrimCylinder(CSX.GetParameterSet(),copper);
cyl->SetRadius(10);
cyl->SetCoord(0,100.0);cyl->SetCoord(1,310.0);
cyl->SetRadius(wire_rad);
cyl->SetCoord(0,coil_rad);cyl->SetCoord(1,coil_rad+feed_length);
cyl->SetCoord(2,0.0);cyl->SetCoord(3,0.0);
cyl->SetCoord(4,600.0);cyl->SetCoord(5,600.0);
cyl->SetCoord(4,coil_length);cyl->SetCoord(5,coil_length);
CSX.AddPrimitive(cyl);
double kappa_resist = (coil_length-2.0*delta[2])/(PI*wire_rad*wire_rad)/50/1e-3;
CSPropMaterial* Src_Resist = new CSPropMaterial(CSX.GetParameterSet());
Src_Resist->SetKappa(kappa_resist);
Src_Resist->SetName("resist");
CSX.AddProperty(Src_Resist);
cyl = new CSPrimCylinder(CSX.GetParameterSet(),Src_Resist);
cyl->SetRadius(wire_rad);
cyl->SetCoord(0,coil_rad+feed_length);cyl->SetCoord(1,coil_rad+feed_length);
cyl->SetCoord(2,0.0);cyl->SetCoord(3,0.0);
cyl->SetCoord(4,0.0);cyl->SetCoord(5,coil_length/2.0-delta[2]);
CSX.AddPrimitive(cyl);
cyl = new CSPrimCylinder(CSX.GetParameterSet(),Src_Resist);
cyl->SetRadius(wire_rad);
cyl->SetCoord(0,coil_rad+feed_length);cyl->SetCoord(1,coil_rad+feed_length);
cyl->SetCoord(2,0.0);cyl->SetCoord(3,0.0);
cyl->SetCoord(4,coil_length/2.0+delta[2]);cyl->SetCoord(5,coil_length);
CSX.AddPrimitive(cyl);
CSPropElectrode* elec = new CSPropElectrode(CSX.GetParameterSet());
@ -641,23 +661,24 @@ void BuildHelix(const char* filename)
// elec->SetDelay(2.0e-9);
CSX.AddProperty(elec);
cyl = new CSPrimCylinder(CSX.GetParameterSet(),elec);
cyl->SetRadius(10);
cyl->SetCoord(0,300.0);cyl->SetCoord(1,300.0);
cyl->SetRadius(wire_rad);
cyl->SetCoord(0,coil_rad+feed_length);cyl->SetCoord(1,coil_rad+feed_length);
cyl->SetCoord(2,0.0);cyl->SetCoord(3,0.0);
cyl->SetCoord(4,200.0);cyl->SetCoord(5,600.0);
cyl->SetCoord(4,coil_length/2.0-delta[2]);cyl->SetCoord(5,coil_length/2.0+delta[2]);
CSX.AddPrimitive(cyl);
CSPropDumpBox* Edump = NULL;
CSPrimBox* box = NULL;
//E-field dump xz
Edump = new CSPropDumpBox(CSX.GetParameterSet());
Edump->SetDumpType(0);
Edump->SetName("Et_xz_");
CSX.AddProperty(Edump);
CSPrimBox* box = new CSPrimBox(CSX.GetParameterSet(),Edump);
box->SetCoord(0,width/-2.0);box->SetCoord(1,width/2.0);
box->SetCoord(2,0.0);box->SetCoord(3,0.0);
box->SetCoord(4,-50.0);box->SetCoord(5,length);
CSX.AddPrimitive(box);
// Edump = new CSPropDumpBox(CSX.GetParameterSet());
// Edump->SetDumpType(0);
// Edump->SetName("Et_xz_");
// CSX.AddProperty(Edump);
// box = new CSPrimBox(CSX.GetParameterSet(),Edump);
// box->SetCoord(0,coil_rad/-2.0-25.0);box->SetCoord(1,coil_rad/2.0+25.0+feed_length);
// box->SetCoord(2,0.0);box->SetCoord(3,0.0);
// box->SetCoord(4,-25.0);box->SetCoord(5,coil_length+25.0);
// CSX.AddPrimitive(box);
//
// //E-field dump xy
// Edump = new CSPropDumpBox(CSX.GetParameterSet());
@ -688,29 +709,30 @@ void BuildHelix(const char* filename)
volt->SetName("u1");
CSX.AddProperty(volt);
box = new CSPrimBox(CSX.GetParameterSet(),volt);
box->SetCoord(0,300.0);box->SetCoord(1,300.0);
box->SetCoord(0,coil_rad+feed_length);box->SetCoord(1,coil_rad+feed_length);
box->SetCoord(2,0.0);box->SetCoord(3,0.0);
box->SetCoord(4,200.0);box->SetCoord(5,600.0);
box->SetCoord(4,coil_length/2.0+delta[2]);box->SetCoord(5,coil_length/2.0-delta[2]);
CSX.AddPrimitive(box);
//current calc
double curr_dist = 2;
CSPropProbeBox* curr = new CSPropProbeBox(CSX.GetParameterSet());
curr->SetProbeType(1);
curr->SetName("i1");
CSX.AddProperty(curr);
box = new CSPrimBox(CSX.GetParameterSet(),curr);
box->SetCoord(0,200.0);box->SetCoord(1,200.0);
box->SetCoord(2,-50.0);box->SetCoord(3,50.0);
box->SetCoord(4,150.0);box->SetCoord(5,250.0);
box->SetCoord(0,coil_rad+feed_length-curr_dist);box->SetCoord(1,coil_rad+feed_length+curr_dist);
box->SetCoord(2,-curr_dist);box->SetCoord(3,curr_dist);
box->SetCoord(4,coil_length/2.0);box->SetCoord(5,coil_length/2.0);
CSX.AddPrimitive(box);
CSRectGrid* grid = CSX.GetGrid();
for (double n=width/-2.0;n<=width/2;n+=delta[0])
for (double n=coil_rad/-2.0-25.0;n<=coil_rad/2.0+25.0+feed_length;n+=delta[0])
grid->AddDiscLine(0,n);
for (double n=width/-2.0;n<=width/2;n+=delta[0])
for (double n=coil_rad/-2.0-25.0;n<=coil_rad/2.0+25.0;n+=delta[1])
grid->AddDiscLine(1,n);
for (double n=-50;n<=length;n+=delta[2])
for (double n=-25.0;n<=coil_length+25.0;n+=delta[2])
grid->AddDiscLine(2,n);
grid->SetDeltaUnit(1e-3);

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<openEMS>
<FDTD NumberOfTimesteps="10000">
<Excitation Type="0" f0="150000000" fc="150000000" />
<BoundaryCond xmin="1" xmax="1" ymin="1" ymax="1" zmin="0" zmax="0" />
<FDTD NumberOfTimesteps="100000">
<Excitation Type="0" f0="500000000" fc="500000000" />
<BoundaryCond xmin="1" xmax="1" ymin="1" ymax="1" zmin="1" zmax="1" />
</FDTD>
<ContinuousStructure>
<RectilinearGrid DeltaUnit="0.001000">
<XLines Qty="161">-400,-395,-390,-385,-380,-375,-370,-365,-360,-355,-350,-345,-340,-335,-330,-325,-320,-315,-310,-305,-300,-295,-290,-285,-280,-275,-270,-265,-260,-255,-250,-245,-240,-235,-230,-225,-220,-215,-210,-205,-200,-195,-190,-185,-180,-175,-170,-165,-160,-155,-150,-145,-140,-135,-130,-125,-120,-115,-110,-105,-100,-95,-90,-85,-80,-75,-70,-65,-60,-55,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400</XLines>
<YLines Qty="161">-400,-395,-390,-385,-380,-375,-370,-365,-360,-355,-350,-345,-340,-335,-330,-325,-320,-315,-310,-305,-300,-295,-290,-285,-280,-275,-270,-265,-260,-255,-250,-245,-240,-235,-230,-225,-220,-215,-210,-205,-200,-195,-190,-185,-180,-175,-170,-165,-160,-155,-150,-145,-140,-135,-130,-125,-120,-115,-110,-105,-100,-95,-90,-85,-80,-75,-70,-65,-60,-55,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400</YLines>
<ZLines Qty="171">-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505,510,515,520,525,530,535,540,545,550,555,560,565,570,575,580,585,590,595,600,605,610,615,620,625,630,635,640,645,650,655,660,665,670,675,680,685,690,695,700,705,710,715,720,725,730,735,740,745,750,755,760,765,770,775,780,785,790,795,800</ZLines>
<XLines Qty="141">-30,-29.5,-29,-28.5,-28,-27.5,-27,-26.5,-26,-25.5,-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30,30.5,31,31.5,32,32.5,33,33.5,34,34.5,35,35.5,36,36.5,37,37.5,38,38.5,39,39.5,40</XLines>
<YLines Qty="121">-30,-29.5,-29,-28.5,-28,-27.5,-27,-26.5,-26,-25.5,-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30</YLines>
<ZLines Qty="201">-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30,30.5,31,31.5,32,32.5,33,33.5,34,34.5,35,35.5,36,36.5,37,37.5,38,38.5,39,39.5,40,40.5,41,41.5,42,42.5,43,43.5,44,44.5,45,45.5,46,46.5,47,47.5,48,48.5,49,49.5,50,50.5,51,51.5,52,52.5,53,53.5,54,54.5,55,55.5,56,56.5,57,57.5,58,58.5,59,59.5,60,60.5,61,61.5,62,62.5,63,63.5,64,64.5,65,65.5,66,66.5,67,67.5,68,68.5,69,69.5,70,70.5,71,71.5,72,72.5,73,73.5,74,74.5,75</ZLines>
</RectilinearGrid>
<ParameterSet />
<Properties>
@ -22,19 +22,22 @@
<WeightY Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="1.000000e+00" Sigma="1.000000e+00" />
<WeightZ Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="1.000000e+00" Sigma="1.000000e+00" />
</Material>
<Electrode ID="1" Name="" Number="0" Delay="0.000000e+00">
<Material ID="1" Name="resist" Isotropy="1">
<FillColor R="135" G="112" B="233" a="255" />
<EdgeColor R="135" G="112" B="233" a="255" />
<Property Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="6.366198e+02" Sigma="0.000000e+00" />
<PropertyY Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="0.000000e+00" Sigma="0.000000e+00" />
<PropertyZ Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="0.000000e+00" Sigma="0.000000e+00" />
<WeightX Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="1.000000e+00" Sigma="1.000000e+00" />
<WeightY Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="1.000000e+00" Sigma="1.000000e+00" />
<WeightZ Epsilon="1.000000e+00" Mue="1.000000e+00" Kappa="1.000000e+00" Sigma="1.000000e+00" />
</Material>
<Electrode ID="2" Name="" Number="0" Delay="0.000000e+00">
<FillColor R="62" G="161" B="65" a="255" />
<EdgeColor R="62" G="161" B="65" a="255" />
<Excitation Type="1" Excit_X="0.000000e+00" Excit_Y="0.000000e+00" Excit_Z="1.000000e+00" />
<Weight X="1.000000e+00" Y="1.000000e+00" Z="1.000000e+00" />
</Electrode>
<DumpBox ID="2" Name="Et_xz_" GlobalSetting="1" DumpType="0" DumpMode="0">
<FillColor R="62" G="161" B="65" a="255" />
<EdgeColor R="62" G="161" B="65" a="255" />
<ScalarDump DumpPhi="1" DumpDivE="0" DumpDivD="0" DumpDivP="0" DumpFieldW="0" DumpChargeW="0" />
<VectorDump DumpEField="0" DumpDField="0" DumpPField="0" />
<SubGridDump SubGridDump="0" SimpleDump="0" SubGridLevel="-1" />
</DumpBox>
<ProbeBox ID="3" Name="u1" Number="0" Type="0">
<FillColor R="225" G="252" B="103" a="255" />
<EdgeColor R="225" G="252" B="103" a="255" />
@ -47,31 +50,35 @@
<Primitives>
<UserDefined ID="0" PropertyID="0" Priority="0" CoordSystem="1">
<CoordShift X="0.000000e+00" Y="0.000000e+00" Z="0.000000e+00" />
<Function>(r&lt;110)&amp;(r&gt;90)&amp;(sqrt(pow(x-r*cos(2*pi*z/100),2)+pow(y-r*sin(2*pi*z/100),2))&lt;20)&amp;(z&gt;200)&amp;(z&lt;600)</Function>
<Function>(r&gt;9)&amp;(r&lt;11)&amp;(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))&lt;2)&amp;(z&gt;0)&amp;(z&lt;50)</Function>
</UserDefined>
<Cylinder ID="1" PropertyID="0" Priority="0" Radius="1.000000e+01">
<P0 X="1.000000e+02" Y="0.000000e+00" Z="2.000000e+02" />
<P1 X="3.100000e+02" Y="0.000000e+00" Z="2.000000e+02" />
<Cylinder ID="1" PropertyID="0" Priority="0" Radius="7.000000e-01">
<P0 X="1.000000e+01" Y="0.000000e+00" Z="0.000000e+00" />
<P1 X="2.000000e+01" Y="0.000000e+00" Z="0.000000e+00" />
</Cylinder>
<Cylinder ID="2" PropertyID="0" Priority="0" Radius="1.000000e+01">
<P0 X="1.000000e+02" Y="0.000000e+00" Z="6.000000e+02" />
<P1 X="3.100000e+02" Y="0.000000e+00" Z="6.000000e+02" />
<Cylinder ID="2" PropertyID="0" Priority="0" Radius="7.000000e-01">
<P0 X="1.000000e+01" Y="0.000000e+00" Z="5.000000e+01" />
<P1 X="2.000000e+01" Y="0.000000e+00" Z="5.000000e+01" />
</Cylinder>
<Cylinder ID="3" PropertyID="1" Priority="0" Radius="1.000000e+01">
<P0 X="3.000000e+02" Y="0.000000e+00" Z="2.000000e+02" />
<P1 X="3.000000e+02" Y="0.000000e+00" Z="6.000000e+02" />
<Cylinder ID="3" PropertyID="1" Priority="0" Radius="7.000000e-01">
<P0 X="2.000000e+01" Y="0.000000e+00" Z="0.000000e+00" />
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.450000e+01" />
</Cylinder>
<Box ID="4" PropertyID="2" Priority="0">
<P1 X="-4.000000e+02" Y="0.000000e+00" Z="-5.000000e+01" />
<P2 X="4.000000e+02" Y="0.000000e+00" Z="8.000000e+02" />
<Cylinder ID="4" PropertyID="1" Priority="0" Radius="7.000000e-01">
<P0 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
<P1 X="2.000000e+01" Y="0.000000e+00" Z="5.000000e+01" />
</Cylinder>
<Cylinder ID="5" PropertyID="2" Priority="0" Radius="7.000000e-01">
<P0 X="2.000000e+01" Y="0.000000e+00" Z="2.450000e+01" />
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
</Cylinder>
<Box ID="6" PropertyID="3" Priority="0">
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
<P2 X="2.000000e+01" Y="0.000000e+00" Z="2.450000e+01" />
</Box>
<Box ID="5" PropertyID="3" Priority="0">
<P1 X="3.000000e+02" Y="0.000000e+00" Z="2.000000e+02" />
<P2 X="3.000000e+02" Y="0.000000e+00" Z="6.000000e+02" />
</Box>
<Box ID="6" PropertyID="4" Priority="0">
<P1 X="2.000000e+02" Y="-5.000000e+01" Z="1.500000e+02" />
<P2 X="2.000000e+02" Y="5.000000e+01" Z="2.500000e+02" />
<Box ID="7" PropertyID="4" Priority="0">
<P1 X="1.800000e+01" Y="-2.000000e+00" Z="2.500000e+01" />
<P2 X="2.200000e+01" Y="2.000000e+00" Z="2.500000e+01" />
</Box>
</Primitives>
</ContinuousStructure>