support for multigrid level request of dump boxes

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/12/head
Thorsten Liebig 2013-12-19 15:15:36 +01:00
parent 390bd9f478
commit 6892a0c589
3 changed files with 29 additions and 6 deletions

View File

@ -50,6 +50,9 @@ public:
virtual void AddExtension(Operator_Extension* op_ext); virtual void AddExtension(Operator_Extension* op_ext);
//! Get the multi grid level of this operator, e.g. 0 is main grid --> no parent grid
int GetMultiGridLevel() const {return m_MultiGridLevel;}
Operator_Cylinder* GetInnerOperator() const {return m_InnerOp;} Operator_Cylinder* GetInnerOperator() const {return m_InnerOp;}
virtual void SetExcitationSignal(Excitation* exc); virtual void SetExcitationSignal(Excitation* exc);

View File

@ -304,10 +304,30 @@ bool openEMS::SetupBoundaryConditions(TiXmlElement* BC)
return true; return true;
} }
Engine_Interface_FDTD* openEMS::NewEngineInterface() Engine_Interface_FDTD* openEMS::NewEngineInterface(int multigridlevel)
{ {
Operator_Cylinder* op_cyl = dynamic_cast<Operator_Cylinder*>(FDTD_Op); Operator_CylinderMultiGrid* op_cyl_mg = dynamic_cast<Operator_CylinderMultiGrid*>(FDTD_Op);
Engine_sse* eng_sse = dynamic_cast<Engine_sse*>(FDTD_Eng); Engine_sse* eng_sse = dynamic_cast<Engine_sse*>(FDTD_Eng);
while (op_cyl_mg && eng_sse && multigridlevel>0)
{
int mgl = op_cyl_mg->GetMultiGridLevel();
if (mgl==multigridlevel)
{
if (g_settings.GetVerboseLevel()>0)
cerr << __func__ << ": Operator with requested multi-grid level found." << endl;
return new Engine_Interface_Cylindrical_FDTD(op_cyl_mg,eng_sse);
}
Operator_Cylinder* op_cyl_inner = op_cyl_mg->GetInnerOperator();
op_cyl_mg = dynamic_cast<Operator_CylinderMultiGrid*>(op_cyl_inner);
if (op_cyl_mg==NULL) //inner most operator reached
{
if (g_settings.GetVerboseLevel()>0)
cerr << __func__ << ": Operator with highest multi-grid level chosen." << endl;
return new Engine_Interface_Cylindrical_FDTD(op_cyl_inner,eng_sse);
}
// try next level
}
Operator_Cylinder* op_cyl = dynamic_cast<Operator_Cylinder*>(FDTD_Op);
if (op_cyl && eng_sse) if (op_cyl && eng_sse)
return new Engine_Interface_Cylindrical_FDTD(op_cyl,eng_sse); return new Engine_Interface_Cylindrical_FDTD(op_cyl,eng_sse);
Operator_sse* op_sse = dynamic_cast<Operator_sse*>(FDTD_Op); Operator_sse* op_sse = dynamic_cast<Operator_sse*>(FDTD_Op);
@ -432,12 +452,12 @@ bool openEMS::SetupProcessing()
if (db) if (db)
{ {
if ((db->GetDumpType()>=0) && (db->GetDumpType()<=3)) if ((db->GetDumpType()>=0) && (db->GetDumpType()<=3))
ProcField = new ProcessFieldsTD(NewEngineInterface()); ProcField = new ProcessFieldsTD(NewEngineInterface(db->GetMultiGridLevel()));
else if ((db->GetDumpType()>=10) && (db->GetDumpType()<=13)) else if ((db->GetDumpType()>=10) && (db->GetDumpType()<=13))
ProcField = new ProcessFieldsFD(NewEngineInterface()); ProcField = new ProcessFieldsFD(NewEngineInterface(db->GetMultiGridLevel()));
else if ( ((db->GetDumpType()>=20) && (db->GetDumpType()<=22)) || (db->GetDumpType()==29) ) else if ( ((db->GetDumpType()>=20) && (db->GetDumpType()<=22)) || (db->GetDumpType()==29) )
{ {
ProcessFieldsSAR* procSAR = new ProcessFieldsSAR(NewEngineInterface()); ProcessFieldsSAR* procSAR = new ProcessFieldsSAR(NewEngineInterface(db->GetMultiGridLevel()));
ProcField = procSAR; ProcField = procSAR;
string method = db->GetAttributeValue("SAR_Method"); string method = db->GetAttributeValue("SAR_Method");
if (!method.empty()) if (!method.empty())

View File

@ -68,7 +68,7 @@ public:
//! Check for abort conditions //! Check for abort conditions
bool CheckAbortCond(); bool CheckAbortCond();
Engine_Interface_FDTD* NewEngineInterface(); Engine_Interface_FDTD* NewEngineInterface(int multigridlevel = 0);
protected: protected:
bool CylinderCoords; bool CylinderCoords;