From ca8d2f8833d193411b897abd74107ef5bcc881c4 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Mon, 3 May 2010 22:37:29 +0200 Subject: [PATCH] check whether extensions are cylinder-coords approved or not... --- FDTD/operator_cylinder.cpp | 8 ++++++++ FDTD/operator_cylinder.h | 2 ++ FDTD/operator_ext_mur_abc.h | 4 ++++ FDTD/operator_extension.h | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/FDTD/operator_cylinder.cpp b/FDTD/operator_cylinder.cpp index 4ae3b16..579be89 100644 --- a/FDTD/operator_cylinder.cpp +++ b/FDTD/operator_cylinder.cpp @@ -16,6 +16,7 @@ */ #include "operator_cylinder.h" +#include "operator_extension.h" Operator_Cylinder* Operator_Cylinder::New() { @@ -408,3 +409,10 @@ bool Operator_Cylinder::Calc_EffMatPos(int /*n*/, unsigned int* /*pos*/, double* return false; } +void Operator_Cylinder::AddExtension(Operator_Extension* op_ext) +{ + if (op_ext->IsCylinderCoordsSave()) + m_Op_exts.push_back(op_ext); + else + cerr << "Operator_Cylinder::AddExtension: Warning: Operator extension \"" << op_ext->GetExtensionName() << "\" is not compatible with cylinder-coords!! skipping...!" << endl; +} diff --git a/FDTD/operator_cylinder.h b/FDTD/operator_cylinder.h index 1d5564b..491778c 100644 --- a/FDTD/operator_cylinder.h +++ b/FDTD/operator_cylinder.h @@ -44,6 +44,8 @@ public: bool GetClosedAlpha() const {return CC_closedAlpha;} bool GetR0Included() const {return CC_R0_included;} + virtual void AddExtension(Operator_Extension* op_ext); + protected: Operator_Cylinder(); virtual void Init(); diff --git a/FDTD/operator_ext_mur_abc.h b/FDTD/operator_ext_mur_abc.h index bcef302..43c7fae 100644 --- a/FDTD/operator_ext_mur_abc.h +++ b/FDTD/operator_ext_mur_abc.h @@ -35,6 +35,10 @@ public: virtual Engine_Extension* CreateEngineExtention(); + virtual bool IsCylinderCoordsSave() {return false;} //not yet save to use with cylinder-coords + + virtual string GetExtensionName() {return string("Mur ABC extension");} + protected: int m_ny; int m_nyP,m_nyPP; diff --git a/FDTD/operator_extension.h b/FDTD/operator_extension.h index b61efb2..b062162 100644 --- a/FDTD/operator_extension.h +++ b/FDTD/operator_extension.h @@ -18,6 +18,8 @@ #ifndef OPERATOR_EXTENSION_H #define OPERATOR_EXTENSION_H +#include + class Operator; class Engine_Extension; @@ -30,6 +32,10 @@ public: virtual Engine_Extension* CreateEngineExtention() {return 0;} + virtual bool IsCylinderCoordsSave() {return false;} + + virtual std::string GetExtensionName() {return std::string("Abstract Operator Extension Base Class");} + protected: Operator_Extension(Operator* op); Operator* m_Op;