changed xml style
parent
b9a3165aac
commit
bb7aa0b2a3
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||
<openEMS-Parameter NumberOfTimesteps="1000">
|
||||
<openEMS>
|
||||
<FDTD NumberOfTimesteps="1000">
|
||||
<Excitation Type="0" f0="1000000000" fc="1000000000" />
|
||||
<BoundaryCond xmin="0" xmax="0" ymin="0" ymax="0" zmin="0" zmax="0" />
|
||||
</openEMS-Parameter>
|
||||
<ContinuousStructure>
|
||||
</FDTD>
|
||||
<ContinuousStructure>
|
||||
<RectilinearGrid DeltaUnit="0.001000">
|
||||
<XLines Qty="93">-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</XLines>
|
||||
<YLines Qty="93">-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</YLines>
|
||||
|
@ -97,4 +98,5 @@
|
|||
<P1 X="0.000000e+00" Y="0.000000e+00" Z="1.500000e+03" />
|
||||
</Cylinder>
|
||||
</Primitives>
|
||||
</ContinuousStructure>
|
||||
</ContinuousStructure>
|
||||
</openEMS>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||
<openEMS-Parameter NumberOfTimesteps="1000">
|
||||
<openEMS>
|
||||
<FDTD NumberOfTimesteps="1000">
|
||||
<Excitation Type="0" f0="500000000" fc="500000000" />
|
||||
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
|
||||
</openEMS-Parameter>
|
||||
<ContinuousStructure>
|
||||
</FDTD>
|
||||
<ContinuousStructure>
|
||||
<RectilinearGrid DeltaUnit="0.001000">
|
||||
<XLines Qty="100">-990,-970,-950,-930,-910,-890,-870,-850,-830,-810,-790,-770,-750,-730,-710,-690,-670,-650,-630,-610,-590,-570,-550,-530,-510,-490,-470,-450,-430,-410,-390,-370,-350,-330,-310,-290,-270,-250,-230,-210,-190,-170,-150,-130,-110,-90,-70,-50,-30,-10,10,30,50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990</XLines>
|
||||
<YLines Qty="100">-990,-970,-950,-930,-910,-890,-870,-850,-830,-810,-790,-770,-750,-730,-710,-690,-670,-650,-630,-610,-590,-570,-550,-530,-510,-490,-470,-450,-430,-410,-390,-370,-350,-330,-310,-290,-270,-250,-230,-210,-190,-170,-150,-130,-110,-90,-70,-50,-30,-10,10,30,50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990</YLines>
|
||||
|
@ -38,4 +39,5 @@
|
|||
<P2 X="1.000000e+01" Y="7.500000e+01" Z="1.000000e+01" />
|
||||
</Box>
|
||||
</Primitives>
|
||||
</ContinuousStructure>
|
||||
</ContinuousStructure>
|
||||
</openEMS>
|
||||
|
|
|
@ -68,7 +68,9 @@ void BuildDipol(const char* filename)
|
|||
TiXmlDocument doc(filename);
|
||||
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes"));
|
||||
|
||||
TiXmlElement FDTD_Opts("openEMS-Parameter");
|
||||
TiXmlElement openEMS("openEMS");
|
||||
|
||||
TiXmlElement FDTD_Opts("FDTD");
|
||||
FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
|
||||
|
||||
TiXmlElement Excite("Excitation");
|
||||
|
@ -86,14 +88,16 @@ void BuildDipol(const char* filename)
|
|||
BC.SetAttribute("zmax",bounds[5]);
|
||||
FDTD_Opts.InsertEndChild(BC);
|
||||
|
||||
doc.InsertEndChild(FDTD_Opts);
|
||||
openEMS.InsertEndChild(FDTD_Opts);
|
||||
|
||||
if (CSX.Write2XML(&doc,true)==false)
|
||||
if (CSX.Write2XML(&openEMS,true)==false)
|
||||
{
|
||||
cerr << "writing failed" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
doc.InsertEndChild(openEMS);
|
||||
|
||||
doc.SaveFile();
|
||||
}
|
||||
|
||||
|
@ -209,7 +213,9 @@ void BuildPlaneWave(const char* filename)
|
|||
TiXmlDocument doc(filename);
|
||||
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes"));
|
||||
|
||||
TiXmlElement FDTD_Opts("openEMS-Parameter");
|
||||
TiXmlElement openEMS("openEMS");
|
||||
|
||||
TiXmlElement FDTD_Opts("FDTD");
|
||||
FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
|
||||
|
||||
TiXmlElement Excite("Excitation");
|
||||
|
@ -227,14 +233,16 @@ void BuildPlaneWave(const char* filename)
|
|||
BC.SetAttribute("zmax",bounds[5]);
|
||||
FDTD_Opts.InsertEndChild(BC);
|
||||
|
||||
doc.InsertEndChild(FDTD_Opts);
|
||||
openEMS.InsertEndChild(FDTD_Opts);
|
||||
|
||||
if (CSX.Write2XML(&doc,true)==false)
|
||||
if (CSX.Write2XML(&openEMS,true)==false)
|
||||
{
|
||||
cerr << "writing failed" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
doc.InsertEndChild(openEMS);
|
||||
|
||||
doc.SaveFile();
|
||||
}
|
||||
|
||||
|
@ -382,7 +390,9 @@ void BuildMSL(const char* filename)
|
|||
TiXmlDocument doc(filename);
|
||||
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes"));
|
||||
|
||||
TiXmlElement FDTD_Opts("openEMS-Parameter");
|
||||
TiXmlElement openEMS("openEMS");
|
||||
|
||||
TiXmlElement FDTD_Opts("FDTD");
|
||||
FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
|
||||
|
||||
TiXmlElement Excite("Excitation");
|
||||
|
@ -400,14 +410,16 @@ void BuildMSL(const char* filename)
|
|||
BC.SetAttribute("zmax",bounds[5]);
|
||||
FDTD_Opts.InsertEndChild(BC);
|
||||
|
||||
doc.InsertEndChild(FDTD_Opts);
|
||||
openEMS.InsertEndChild(FDTD_Opts);
|
||||
|
||||
if (CSX.Write2XML(&doc,true)==false)
|
||||
if (CSX.Write2XML(&openEMS,true)==false)
|
||||
{
|
||||
cerr << "writing failed" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
doc.InsertEndChild(openEMS);
|
||||
|
||||
doc.SaveFile();
|
||||
}
|
||||
|
||||
|
@ -552,7 +564,9 @@ void BuildCoaxial_Cartesian(const char* filename)
|
|||
TiXmlDocument doc(filename);
|
||||
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes"));
|
||||
|
||||
TiXmlElement FDTD_Opts("openEMS-Parameter");
|
||||
TiXmlElement openEMS("openEMS");
|
||||
|
||||
TiXmlElement FDTD_Opts("FDTD");
|
||||
FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
|
||||
|
||||
TiXmlElement Excite("Excitation");
|
||||
|
@ -570,14 +584,16 @@ void BuildCoaxial_Cartesian(const char* filename)
|
|||
BC.SetAttribute("zmax",bounds[5]);
|
||||
FDTD_Opts.InsertEndChild(BC);
|
||||
|
||||
doc.InsertEndChild(FDTD_Opts);
|
||||
openEMS.InsertEndChild(FDTD_Opts);
|
||||
|
||||
if (CSX.Write2XML(&doc,true)==false)
|
||||
if (CSX.Write2XML(&openEMS,true)==false)
|
||||
{
|
||||
cerr << "writing failed" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
doc.InsertEndChild(openEMS);
|
||||
|
||||
doc.SaveFile();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||
<openEMS-Parameter NumberOfTimesteps="1000">
|
||||
<openEMS>
|
||||
<FDTD NumberOfTimesteps="1000">
|
||||
<Excitation Type="0" f0="500000000" fc="500000000" />
|
||||
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
|
||||
</openEMS-Parameter>
|
||||
<ContinuousStructure>
|
||||
</FDTD>
|
||||
<ContinuousStructure>
|
||||
<RectilinearGrid DeltaUnit="0.001000">
|
||||
<XLines Qty="51">-500,-480,-460,-440,-420,-400,-380,-360,-340,-320,-300,-280,-260,-240,-220,-200,-180,-160,-140,-120,-100,-80,-60,-40,-20,0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500</XLines>
|
||||
<YLines Qty="51">0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400,410,420,430,440,450,460,470,480,490,500</YLines>
|
||||
|
@ -79,4 +80,5 @@
|
|||
<P2 X="1.200000e+02" Y="7.500000e+01" Z="0.000000e+00" />
|
||||
</Box>
|
||||
</Primitives>
|
||||
</ContinuousStructure>
|
||||
</ContinuousStructure>
|
||||
</openEMS>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||
<openEMS-Parameter NumberOfTimesteps="1000">
|
||||
<openEMS>
|
||||
<FDTD NumberOfTimesteps="1000">
|
||||
<Excitation Type="0" f0="500000000" fc="500000000" />
|
||||
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
|
||||
</openEMS-Parameter>
|
||||
<ContinuousStructure>
|
||||
</FDTD>
|
||||
<ContinuousStructure>
|
||||
<RectilinearGrid DeltaUnit="0.001000">
|
||||
<XLines Qty="51">-500,-480,-460,-440,-420,-400,-380,-360,-340,-320,-300,-280,-260,-240,-220,-200,-180,-160,-140,-120,-100,-80,-60,-40,-20,0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500</XLines>
|
||||
<YLines Qty="51">-500,-480,-460,-440,-420,-400,-380,-360,-340,-320,-300,-280,-260,-240,-220,-200,-180,-160,-140,-120,-100,-80,-60,-40,-20,0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500</YLines>
|
||||
|
@ -78,4 +79,5 @@
|
|||
<P2 X="3.333333e+02" Y="0.000000e+00" Z="1.800000e+03" />
|
||||
</Box>
|
||||
</Primitives>
|
||||
</ContinuousStructure>
|
||||
</ContinuousStructure>
|
||||
</openEMS>
|
||||
|
|
13
openems.cpp
13
openems.cpp
|
@ -76,10 +76,17 @@ int openEMS::SetupFDTD(const char* file)
|
|||
}
|
||||
|
||||
cout << "Read openEMS Settings..." << endl;
|
||||
TiXmlElement* FDTD_Opts = doc.FirstChildElement("openEMS-Parameter");
|
||||
TiXmlElement* openEMSxml = doc.FirstChildElement("openEMS");
|
||||
if (openEMSxml==NULL)
|
||||
{
|
||||
cerr << "Can't read openEMS ... " << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
TiXmlElement* FDTD_Opts = openEMSxml->FirstChildElement("FDTD");
|
||||
if (FDTD_Opts==NULL)
|
||||
{
|
||||
cerr << "Can't read openEMS Settings... " << endl;
|
||||
cerr << "Can't read openEMS FDTD Settings... " << endl;
|
||||
exit(-1);
|
||||
}
|
||||
FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&NrTS);
|
||||
|
@ -112,7 +119,7 @@ int openEMS::SetupFDTD(const char* file)
|
|||
|
||||
cout << "Read Geometry..." << endl;
|
||||
ContinuousStructure CSX;
|
||||
string EC(CSX.ReadFromXML(&doc));
|
||||
string EC(CSX.ReadFromXML(openEMSxml));
|
||||
if (EC.empty()==false)
|
||||
{
|
||||
cerr << EC << endl;
|
||||
|
|
Loading…
Reference in New Issue