From bb7aa0b2a322ffd5a46bc84b568592ccdcb37c67 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 12 Mar 2010 21:14:17 +0100 Subject: [PATCH] changed xml style --- examples/Coax_Cart.xml | 200 +++++++++++++++++++------------------ examples/Dipol.xml | 82 +++++++-------- examples/FDTD_examples.cpp | 40 +++++--- examples/MSL.xml | 164 +++++++++++++++--------------- examples/PlaneWave.xml | 162 +++++++++++++++--------------- openems.cpp | 13 ++- 6 files changed, 346 insertions(+), 315 deletions(-) diff --git a/examples/Coax_Cart.xml b/examples/Coax_Cart.xml index 7b03a67..cd0032d 100644 --- a/examples/Coax_Cart.xml +++ b/examples/Coax_Cart.xml @@ -1,100 +1,102 @@ - - - - - - - -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 - -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 - -500,-490,-480,-470,-460,-450,-440,-430,-420,-410,-400,-390,-380,-370,-360,-350,-340,-330,-320,-310,-300,-290,-280,-270,-260,-250,-240,-230,-220,-210,-200,-190,-180,-170,-160,-150,-140,-130,-120,-110,-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,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,510,520,530,540,550,560,570,580,590,600,610,620,630,640,650,660,670,680,690,700,710,720,730,740,750,760,770,780,790,800,810,820,830,840,850,860,870,880,890,900,910,920,930,940,950,960,970,980,990,1000,1010,1020,1030,1040,1050,1060,1070,1080,1090,1100,1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220,1230,1240,1250,1260,1270,1280,1290,1300,1310,1320,1330,1340,1350,1360,1370,1380,1390,1400,1410,1420,1430,1440,1450,1460,1470,1480,1490,1500 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + -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 + -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 + -500,-490,-480,-470,-460,-450,-440,-430,-420,-410,-400,-390,-380,-370,-360,-350,-340,-330,-320,-310,-300,-290,-280,-270,-260,-250,-240,-230,-220,-210,-200,-190,-180,-170,-160,-150,-140,-130,-120,-110,-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,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,510,520,530,540,550,560,570,580,590,600,610,620,630,640,650,660,670,680,690,700,710,720,730,740,750,760,770,780,790,800,810,820,830,840,850,860,870,880,890,900,910,920,930,940,950,960,970,980,990,1000,1010,1020,1030,1040,1050,1060,1070,1080,1090,1100,1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220,1230,1240,1250,1260,1270,1280,1290,1300,1310,1320,1330,1340,1350,1360,1370,1380,1390,1400,1410,1420,1430,1440,1450,1460,1470,1480,1490,1500 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Dipol.xml b/examples/Dipol.xml index 08c12b7..45331e0 100644 --- a/examples/Dipol.xml +++ b/examples/Dipol.xml @@ -1,41 +1,43 @@ - - - - - - - -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 - -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 - -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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + -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 + -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 + -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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/FDTD_examples.cpp b/examples/FDTD_examples.cpp index 7089fa1..e73c035 100644 --- a/examples/FDTD_examples.cpp +++ b/examples/FDTD_examples.cpp @@ -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(); } diff --git a/examples/MSL.xml b/examples/MSL.xml index 00f7d68..3d99f45 100644 --- a/examples/MSL.xml +++ b/examples/MSL.xml @@ -1,82 +1,84 @@ - - - - - - - -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 - 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 - -1000,-980,-960,-940,-920,-900,-880,-860,-840,-820,-800,-780,-760,-740,-720,-700,-680,-660,-640,-620,-600,-580,-560,-540,-520,-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,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + -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 + 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 + -1000,-980,-960,-940,-920,-900,-880,-860,-840,-820,-800,-780,-760,-740,-720,-700,-680,-660,-640,-620,-600,-580,-560,-540,-520,-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,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/PlaneWave.xml b/examples/PlaneWave.xml index c0b90f3..bb0e251 100644 --- a/examples/PlaneWave.xml +++ b/examples/PlaneWave.xml @@ -1,81 +1,83 @@ - - - - - - - -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 - -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 - -2000,-1980,-1960,-1940,-1920,-1900,-1880,-1860,-1840,-1820,-1800,-1780,-1760,-1740,-1720,-1700,-1680,-1660,-1640,-1620,-1600,-1580,-1560,-1540,-1520,-1500,-1480,-1460,-1440,-1420,-1400,-1380,-1360,-1340,-1320,-1300,-1280,-1260,-1240,-1220,-1200,-1180,-1160,-1140,-1120,-1100,-1080,-1060,-1040,-1020,-1000,-980,-960,-940,-920,-900,-880,-860,-840,-820,-800,-780,-760,-740,-720,-700,-680,-660,-640,-620,-600,-580,-560,-540,-520,-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,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + -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 + -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 + -2000,-1980,-1960,-1940,-1920,-1900,-1880,-1860,-1840,-1820,-1800,-1780,-1760,-1740,-1720,-1700,-1680,-1660,-1640,-1620,-1600,-1580,-1560,-1540,-1520,-1500,-1480,-1460,-1440,-1420,-1400,-1380,-1360,-1340,-1320,-1300,-1280,-1260,-1240,-1220,-1200,-1180,-1160,-1140,-1120,-1100,-1080,-1060,-1040,-1020,-1000,-980,-960,-940,-920,-900,-880,-860,-840,-820,-800,-780,-760,-740,-720,-700,-680,-660,-640,-620,-600,-580,-560,-540,-520,-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,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openems.cpp b/openems.cpp index 706519f..21cad84 100644 --- a/openems.cpp +++ b/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;