show extensions status & define const methods

pull/1/head
Thorsten Liebig 2010-07-11 23:45:41 +02:00
parent 03b03b9834
commit 911f7c5528
13 changed files with 71 additions and 9 deletions

View File

@ -308,6 +308,13 @@ void Operator::ShowStat() const
cout << "-----------------------------------" << endl;
}
void Operator::ShowExtStat() const
{
cout << "-----------------------------------" << endl;
for (size_t n=0;n<m_Op_exts.size();++n)
m_Op_exts.at(n)->ShowStat(cout);
cout << "-----------------------------------" << endl;
}
void Operator::DumpOperator2File(string filename)
{

View File

@ -62,6 +62,7 @@ public:
virtual unsigned int GetOriginalNumLines(int ny) const {return numLines[ny];}
virtual void ShowStat() const;
virtual void ShowExtStat() const;
virtual void DumpOperator2File(string filename);
virtual void DumpMaterial2File(string filename);

View File

@ -58,3 +58,12 @@ Engine_Extension* Operator_Ext_Cylinder::CreateEngineExtention()
Engine_Ext_Cylinder* eng_ext = new Engine_Ext_Cylinder(this);
return eng_ext;
}
void Operator_Ext_Cylinder::ShowStat(ostream &ostr) const
{
Operator_Extension::ShowStat(ostr);
string On_Off[2] = {"Off", "On"};
ostr << " Zeroth Radius\t\t: " << On_Off[CC_R0_included] << endl;
ostr << " Closed Rotation\t: " << On_Off[CC_closedAlpha] << endl;
}

View File

@ -17,9 +17,11 @@ public:
virtual Engine_Extension* CreateEngineExtention();
virtual bool IsCylinderCoordsSave() {return true;}
virtual bool IsCylinderCoordsSave() const {return true;}
virtual std::string GetExtensionName() {return std::string("Extension for the Cylinder-Coords Operator");}
virtual std::string GetExtensionName() const {return std::string("Extension for the Cylinder-Coords Operator");}
virtual void ShowStat(ostream &ostr) const;
protected:
Operator_Cylinder* m_Op_Cyl;

View File

@ -39,3 +39,12 @@ Operator_Ext_Dispersive::~Operator_Ext_Dispersive()
m_LM_pos[1]=NULL;
m_LM_pos[2]=NULL;
}
void Operator_Ext_Dispersive::ShowStat(ostream &ostr) const
{
Operator_Extension::ShowStat(ostr);
string On_Off[2] = {"Off", "On"};
ostr << " Active cells\t\t: " << m_LM_Count << endl;
ostr << " Voltage ADE is \t: " << On_Off[m_volt_ADE_On] << endl;
ostr << " Current ADE is \t: " << On_Off[m_curr_ADE_On] << endl;
}

View File

@ -28,7 +28,9 @@ class Operator_Ext_Dispersive : public Operator_Extension
public:
virtual ~Operator_Ext_Dispersive();
virtual string GetExtensionName() {return string("Dispersive Material Abstract Base class");}
virtual string GetExtensionName() const {return string("Dispersive Material Abstract Base class");}
virtual void ShowStat(ostream &ostr) const;
protected:
Operator_Ext_Dispersive(Operator* op);

View File

@ -175,3 +175,8 @@ Engine_Extension* Operator_Ext_LorentzMaterial::CreateEngineExtention()
Engine_Ext_LorentzMaterial* eng_ext_lor = new Engine_Ext_LorentzMaterial(this);
return eng_ext_lor;
}
void Operator_Ext_LorentzMaterial::ShowStat(ostream &ostr) const
{
Operator_Ext_Dispersive::ShowStat(ostr);
}

View File

@ -32,9 +32,11 @@ public:
virtual Engine_Extension* CreateEngineExtention();
virtual bool IsCylinderCoordsSave() {return false;}
virtual bool IsCylinderCoordsSave() const {return false;}
virtual std::string GetExtensionName() {return std::string("Lorentz Dispersive Material Extension");}
virtual std::string GetExtensionName() const {return std::string("Lorentz Dispersive Material Extension");}
virtual void ShowStat(ostream &ostr) const;
protected:

View File

@ -139,3 +139,11 @@ Engine_Extension* Operator_Ext_Mur_ABC::CreateEngineExtention()
Engine_Ext_Mur_ABC* eng_ext = new Engine_Ext_Mur_ABC(this);
return eng_ext;
}
void Operator_Ext_Mur_ABC::ShowStat(ostream &ostr) const
{
Operator_Extension::ShowStat(ostr);
string XYZ[3] = {"x","y","z"};
ostr << " Active direction: " << XYZ[m_ny] << " at line: " << m_LineNr << endl;
}

View File

@ -35,9 +35,11 @@ public:
virtual Engine_Extension* CreateEngineExtention();
virtual bool IsCylinderCoordsSave() {if (m_ny==2) return true; else return false;}
virtual bool IsCylinderCoordsSave() const {if (m_ny==2) return true; else return false;}
virtual string GetExtensionName() {return string("Mur ABC extension");}
virtual string GetExtensionName() const {return string("Mur ABC Extension");}
virtual void ShowStat(ostream &ostr) const;
protected:
int m_ny;

View File

@ -23,3 +23,8 @@ Operator_Extension::Operator_Extension(Operator* op)
{
m_Op = op;
}
void Operator_Extension::ShowStat(ostream &ostr) const
{
ostr << "--- " << GetExtensionName() << " ---" << endl;
}

View File

@ -20,6 +20,13 @@
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
class Operator;
class Engine_Extension;
@ -32,9 +39,11 @@ public:
virtual Engine_Extension* CreateEngineExtention() {return 0;}
virtual bool IsCylinderCoordsSave() {return false;}
virtual bool IsCylinderCoordsSave() const {return false;}
virtual std::string GetExtensionName() {return std::string("Abstract Operator Extension Base Class");}
virtual std::string GetExtensionName() const {return std::string("Abstract Operator Extension Base Class");}
virtual void ShowStat(ostream &ostr) const;
protected:
Operator_Extension(Operator* op);

View File

@ -298,6 +298,7 @@ int openEMS::SetupFDTD(const char* file)
gettimeofday(&OpDoneTime,NULL);
FDTD_Op->ShowStat();
FDTD_Op->ShowExtStat();
cout << "Creation time for operator: " << CalcDiffTime(OpDoneTime,startTime) << " s" << endl;