fixed extensions handling for cylindrical multigrid

pull/1/head
Thorsten Liebig 2010-09-22 16:08:39 +02:00
parent 8c95f21858
commit 8870a20787
4 changed files with 16 additions and 10 deletions

View File

@ -195,16 +195,20 @@ void Operator_CylinderMultiGrid::SetBoundaryCondition(int* BCs)
void Operator_CylinderMultiGrid::AddExtension(Operator_Extension* op_ext)
{
if (dynamic_cast<Operator_Ext_Cylinder*>(op_ext))
{
//check whether extension is save to use in multi-grid
if (op_ext->IsCylindricalMultiGridSave(false)==false)
return;
else
{
cerr << "Operator_CylinderMultiGrid::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylindrical multi-grids!! skipping...!" << endl;
Operator_Cylinder::AddExtension(op_ext);
return;
}
Operator_Cylinder::AddExtension(op_ext);
// cylinder extension does not need to be cloned, it will be created by each operator of its own...
if (dynamic_cast<Operator_Ext_Cylinder*>(op_ext))
return;
//check whether extension is save to use in child multi-grid
if (op_ext->IsCylindricalMultiGridSave(true))
{
Operator_Extension* child_Ext = op_ext->Clone(m_InnerOp);
@ -216,8 +220,6 @@ void Operator_CylinderMultiGrid::AddExtension(Operator_Extension* op_ext)
//give the copy to child
m_InnerOp->AddExtension(child_Ext);
}
Operator_Cylinder::AddExtension(op_ext);
}
void Operator_CylinderMultiGrid::ShowStat() const

View File

@ -35,7 +35,7 @@ public:
virtual Engine_Extension* CreateEngineExtention();
virtual bool IsCylinderCoordsSave() const {return true;}
virtual bool IsCylindricalMultiGridChildSave(bool child) const {UNUSED(child);return true;}
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child);return true;}
virtual std::string GetExtensionName() const {return std::string("Extension for the Cylinder-Coords Operator");}

View File

@ -24,6 +24,8 @@
#include <stdio.h>
#include <stdlib.h>
#include "tools/global.h"
using namespace std;
class Operator;
@ -49,7 +51,7 @@ public:
virtual bool IsCylinderCoordsSave() const {return false;}
//! The cylindrical multi grid operator will check whether the extension is save to use. Default is false. Derive this method to override.
virtual bool IsCylindricalMultiGridSave(bool /*child*/) const {return false;}
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child);return false;}
virtual std::string GetExtensionName() const {return std::string("Abstract Operator Extension Base Class");}

View File

@ -20,6 +20,8 @@
#include <sstream>
#define UNUSED(x) (void)(x);
class Global
{
public: