Allow Lorentz material and cylindrical multi-grids

pull/1/head
Thorsten Liebig 2012-06-06 14:18:42 +02:00
parent 4250c6f888
commit f3dc73873d
6 changed files with 38 additions and 2 deletions

View File

@ -19,7 +19,19 @@
#include "tools/array_ops.h" #include "tools/array_ops.h"
Operator_Ext_Dispersive::Operator_Ext_Dispersive(Operator* op) : Operator_Extension(op) Operator_Ext_Dispersive::Operator_Ext_Dispersive(Operator* op) : Operator_Extension(op)
{
m_curr_ADE_On = NULL;
m_volt_ADE_On = NULL;
m_LM_pos=NULL;
m_curr_ADE_On=NULL;
m_volt_ADE_On=NULL;
m_Order = 0;
}
Operator_Ext_Dispersive::Operator_Ext_Dispersive(Operator* op, Operator_Ext_Dispersive* op_ext) : Operator_Extension(op,op_ext)
{ {
m_curr_ADE_On = NULL; m_curr_ADE_On = NULL;
m_volt_ADE_On = NULL; m_volt_ADE_On = NULL;

View File

@ -37,6 +37,8 @@ public:
protected: protected:
Operator_Ext_Dispersive(Operator* op); Operator_Ext_Dispersive(Operator* op);
//! Copy constructor
Operator_Ext_Dispersive(Operator* op, Operator_Ext_Dispersive* op_ext);
//! Dispersive order //! Dispersive order
int m_Order; int m_Order;

View File

@ -28,6 +28,14 @@ Operator_Ext_LorentzMaterial::Operator_Ext_LorentzMaterial(Operator* op) : Opera
i_ext_ADE = NULL; i_ext_ADE = NULL;
} }
Operator_Ext_LorentzMaterial::Operator_Ext_LorentzMaterial(Operator* op, Operator_Ext_LorentzMaterial* op_ext) : Operator_Ext_Dispersive(op,op_ext)
{
v_int_ADE = NULL;
v_ext_ADE = NULL;
i_int_ADE = NULL;
i_ext_ADE = NULL;
}
Operator_Ext_LorentzMaterial::~Operator_Ext_LorentzMaterial() Operator_Ext_LorentzMaterial::~Operator_Ext_LorentzMaterial()
{ {
for (int i=0;i<m_Order;++i) for (int i=0;i<m_Order;++i)
@ -66,6 +74,13 @@ Operator_Ext_LorentzMaterial::~Operator_Ext_LorentzMaterial()
i_ext_ADE = NULL; i_ext_ADE = NULL;
} }
Operator_Extension* Operator_Ext_LorentzMaterial::Clone(Operator* op)
{
if (dynamic_cast<Operator_Ext_LorentzMaterial*>(this)==NULL)
return NULL;
return new Operator_Ext_LorentzMaterial(op, this);
}
bool Operator_Ext_LorentzMaterial::BuildExtension() bool Operator_Ext_LorentzMaterial::BuildExtension()
{ {
double dT = m_Op->GetTimestep(); double dT = m_Op->GetTimestep();

View File

@ -28,17 +28,22 @@ public:
Operator_Ext_LorentzMaterial(Operator* op); Operator_Ext_LorentzMaterial(Operator* op);
virtual ~Operator_Ext_LorentzMaterial(); virtual ~Operator_Ext_LorentzMaterial();
virtual Operator_Extension* Clone(Operator* op);
virtual bool BuildExtension(); virtual bool BuildExtension();
virtual Engine_Extension* CreateEngineExtention(); virtual Engine_Extension* CreateEngineExtention();
virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {return true;} virtual bool IsCylinderCoordsSave(bool closedAlpha, bool R0_included) const {return true;}
virtual bool IsCylindricalMultiGridSave(bool child) const {UNUSED(child); return true;}
virtual string GetExtensionName() const {return string("Drude/Lorentz Dispersive Material Extension");} virtual string GetExtensionName() const {return string("Drude/Lorentz Dispersive Material Extension");}
virtual void ShowStat(ostream &ostr) const; virtual void ShowStat(ostream &ostr) const;
protected: protected:
//! Copy constructor
Operator_Ext_LorentzMaterial(Operator* op, Operator_Ext_LorentzMaterial* op_ext);
//ADE update coefficients, array setup: coeff[N_order][direction][mesh_pos_index] //ADE update coefficients, array setup: coeff[N_order][direction][mesh_pos_index]
FDTD_FLOAT ***v_int_ADE; FDTD_FLOAT ***v_int_ADE;

View File

@ -38,6 +38,8 @@ Operator_Extension::Operator_Extension(Operator* op, Operator_Extension* op_ext)
UNUSED(op_ext); UNUSED(op_ext);
m_Op = op; m_Op = op;
m_Op_Cyl = dynamic_cast<Operator_Cylinder*>(op); m_Op_Cyl = dynamic_cast<Operator_Cylinder*>(op);
if (m_Op_Cyl)
m_CC_R0_included=m_Op_Cyl->GetR0Included();
} }
void Operator_Extension::ShowStat(ostream &ostr) const void Operator_Extension::ShowStat(ostream &ostr) const

View File

@ -62,7 +62,7 @@ public:
protected: protected:
Operator_Extension(Operator* op); Operator_Extension(Operator* op);
//! Copy constructor, returns NULL if extension cannot be copied... //! Copy constructor
Operator_Extension(Operator* op, Operator_Extension* op_ext); Operator_Extension(Operator* op, Operator_Extension* op_ext);
//FDTD Operator //FDTD Operator