changed xml style

pull/1/head
Thorsten Liebig 2010-03-12 21:14:17 +01:00
parent b9a3165aac
commit bb7aa0b2a3
6 changed files with 346 additions and 315 deletions

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> <?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" /> <Excitation Type="0" f0="1000000000" fc="1000000000" />
<BoundaryCond xmin="0" xmax="0" ymin="0" ymax="0" zmin="0" zmax="0" /> <BoundaryCond xmin="0" xmax="0" ymin="0" ymax="0" zmin="0" zmax="0" />
</openEMS-Parameter> </FDTD>
<ContinuousStructure> <ContinuousStructure>
<RectilinearGrid DeltaUnit="0.001000"> <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> <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>
@ -98,3 +99,4 @@
</Cylinder> </Cylinder>
</Primitives> </Primitives>
</ContinuousStructure> </ContinuousStructure>
</openEMS>

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> <?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" /> <Excitation Type="0" f0="500000000" fc="500000000" />
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" /> <BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
</openEMS-Parameter> </FDTD>
<ContinuousStructure> <ContinuousStructure>
<RectilinearGrid DeltaUnit="0.001000"> <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> <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>
@ -39,3 +40,4 @@
</Box> </Box>
</Primitives> </Primitives>
</ContinuousStructure> </ContinuousStructure>
</openEMS>

View File

@ -68,7 +68,9 @@ void BuildDipol(const char* filename)
TiXmlDocument doc(filename); TiXmlDocument doc(filename);
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes")); 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); FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
TiXmlElement Excite("Excitation"); TiXmlElement Excite("Excitation");
@ -86,14 +88,16 @@ void BuildDipol(const char* filename)
BC.SetAttribute("zmax",bounds[5]); BC.SetAttribute("zmax",bounds[5]);
FDTD_Opts.InsertEndChild(BC); 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; cerr << "writing failed" << endl;
exit(-1); exit(-1);
} }
doc.InsertEndChild(openEMS);
doc.SaveFile(); doc.SaveFile();
} }
@ -209,7 +213,9 @@ void BuildPlaneWave(const char* filename)
TiXmlDocument doc(filename); TiXmlDocument doc(filename);
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes")); 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); FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
TiXmlElement Excite("Excitation"); TiXmlElement Excite("Excitation");
@ -227,14 +233,16 @@ void BuildPlaneWave(const char* filename)
BC.SetAttribute("zmax",bounds[5]); BC.SetAttribute("zmax",bounds[5]);
FDTD_Opts.InsertEndChild(BC); 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; cerr << "writing failed" << endl;
exit(-1); exit(-1);
} }
doc.InsertEndChild(openEMS);
doc.SaveFile(); doc.SaveFile();
} }
@ -382,7 +390,9 @@ void BuildMSL(const char* filename)
TiXmlDocument doc(filename); TiXmlDocument doc(filename);
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes")); 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); FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
TiXmlElement Excite("Excitation"); TiXmlElement Excite("Excitation");
@ -400,14 +410,16 @@ void BuildMSL(const char* filename)
BC.SetAttribute("zmax",bounds[5]); BC.SetAttribute("zmax",bounds[5]);
FDTD_Opts.InsertEndChild(BC); 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; cerr << "writing failed" << endl;
exit(-1); exit(-1);
} }
doc.InsertEndChild(openEMS);
doc.SaveFile(); doc.SaveFile();
} }
@ -552,7 +564,9 @@ void BuildCoaxial_Cartesian(const char* filename)
TiXmlDocument doc(filename); TiXmlDocument doc(filename);
doc.InsertEndChild(TiXmlDeclaration("1.0","ISO-8859-1","yes")); 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); FDTD_Opts.SetAttribute("NumberOfTimesteps",maxIter);
TiXmlElement Excite("Excitation"); TiXmlElement Excite("Excitation");
@ -570,14 +584,16 @@ void BuildCoaxial_Cartesian(const char* filename)
BC.SetAttribute("zmax",bounds[5]); BC.SetAttribute("zmax",bounds[5]);
FDTD_Opts.InsertEndChild(BC); 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; cerr << "writing failed" << endl;
exit(-1); exit(-1);
} }
doc.InsertEndChild(openEMS);
doc.SaveFile(); doc.SaveFile();
} }

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> <?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" /> <Excitation Type="0" f0="500000000" fc="500000000" />
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" /> <BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
</openEMS-Parameter> </FDTD>
<ContinuousStructure> <ContinuousStructure>
<RectilinearGrid DeltaUnit="0.001000"> <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> <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>
@ -80,3 +81,4 @@
</Box> </Box>
</Primitives> </Primitives>
</ContinuousStructure> </ContinuousStructure>
</openEMS>

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> <?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" /> <Excitation Type="0" f0="500000000" fc="500000000" />
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" /> <BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
</openEMS-Parameter> </FDTD>
<ContinuousStructure> <ContinuousStructure>
<RectilinearGrid DeltaUnit="0.001000"> <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> <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>
@ -79,3 +80,4 @@
</Box> </Box>
</Primitives> </Primitives>
</ContinuousStructure> </ContinuousStructure>
</openEMS>

View File

@ -76,10 +76,17 @@ int openEMS::SetupFDTD(const char* file)
} }
cout << "Read openEMS Settings..." << endl; 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) if (FDTD_Opts==NULL)
{ {
cerr << "Can't read openEMS Settings... " << endl; cerr << "Can't read openEMS FDTD Settings... " << endl;
exit(-1); exit(-1);
} }
FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&NrTS); FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&NrTS);
@ -112,7 +119,7 @@ int openEMS::SetupFDTD(const char* file)
cout << "Read Geometry..." << endl; cout << "Read Geometry..." << endl;
ContinuousStructure CSX; ContinuousStructure CSX;
string EC(CSX.ReadFromXML(&doc)); string EC(CSX.ReadFromXML(openEMSxml));
if (EC.empty()==false) if (EC.empty()==false)
{ {
cerr << EC << endl; cerr << EC << endl;