Cylindrical MultiGrid Operator: record level of multi grid

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/1/head
Thorsten Liebig 2013-03-27 12:00:46 +01:00
parent 50418b8f4f
commit 70ff8634f4
2 changed files with 8 additions and 6 deletions

View File

@ -20,11 +20,12 @@
#include "extensions/operator_ext_cylinder.h" #include "extensions/operator_ext_cylinder.h"
#include "tools/useful.h" #include "tools/useful.h"
Operator_CylinderMultiGrid::Operator_CylinderMultiGrid(vector<double> Split_Radii) : Operator_Cylinder() Operator_CylinderMultiGrid::Operator_CylinderMultiGrid(vector<double> Split_Radii, unsigned int level) : Operator_Cylinder()
{ {
m_Split_Radii = Split_Radii; m_Split_Radii = Split_Radii;
m_Split_Rad = m_Split_Radii.back(); m_Split_Rad = m_Split_Radii.back();
m_Split_Radii.pop_back(); m_Split_Radii.pop_back();
m_MultiGridLevel = level;
} }
Operator_CylinderMultiGrid::~Operator_CylinderMultiGrid() Operator_CylinderMultiGrid::~Operator_CylinderMultiGrid()
@ -32,7 +33,7 @@ Operator_CylinderMultiGrid::~Operator_CylinderMultiGrid()
Delete(); Delete();
} }
Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector<double> Split_Radii, unsigned int numThreads) Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector<double> Split_Radii, unsigned int numThreads, unsigned int level)
{ {
if ((Split_Radii.size()==0) || (Split_Radii.size()>CYLIDINDERMULTIGRID_LIMIT)) if ((Split_Radii.size()==0) || (Split_Radii.size()>CYLIDINDERMULTIGRID_LIMIT))
{ {
@ -40,7 +41,7 @@ Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector<double> Split
return NULL; return NULL;
} }
cout << "Create cylindrical multi grid FDTD operator " << endl; cout << "Create cylindrical multi grid FDTD operator " << endl;
Operator_CylinderMultiGrid* op = new Operator_CylinderMultiGrid(Split_Radii); Operator_CylinderMultiGrid* op = new Operator_CylinderMultiGrid(Split_Radii, level);
op->setNumThreads(numThreads); op->setNumThreads(numThreads);
op->Init(); op->Init();
@ -129,7 +130,7 @@ void Operator_CylinderMultiGrid::Init()
if (m_Split_Radii.empty()) if (m_Split_Radii.empty())
m_InnerOp = Operator_Cylinder::New(m_numThreads); m_InnerOp = Operator_Cylinder::New(m_numThreads);
else else
m_InnerOp = Operator_CylinderMultiGrid::New(m_Split_Radii,m_numThreads); m_InnerOp = Operator_CylinderMultiGrid::New(m_Split_Radii,m_numThreads, m_MultiGridLevel+1);
for (int n=0;n<2;++n) for (int n=0;n<2;++n)
{ {

View File

@ -32,7 +32,7 @@ class Operator_CylinderMultiGrid : public Operator_Cylinder
{ {
friend class Engine_CylinderMultiGrid; friend class Engine_CylinderMultiGrid;
public: public:
static Operator_CylinderMultiGrid* New(vector<double> Split_Radii, unsigned int numThreads = 0); static Operator_CylinderMultiGrid* New(vector<double> Split_Radii, unsigned int numThreads = 0, unsigned int level = 0);
virtual ~Operator_CylinderMultiGrid(); virtual ~Operator_CylinderMultiGrid();
virtual double GetNumberCells() const; virtual double GetNumberCells() const;
@ -63,7 +63,7 @@ public:
#endif #endif
protected: protected:
Operator_CylinderMultiGrid(vector<double> Split_Radii); Operator_CylinderMultiGrid(vector<double> Split_Radii, unsigned int level);
virtual void Init(); virtual void Init();
void Delete(); void Delete();
virtual void Reset(); virtual void Reset();
@ -75,6 +75,7 @@ protected:
//! The material data storage in the sub-grid area's will not be filled by the base-operator. Check and do this here! //! The material data storage in the sub-grid area's will not be filled by the base-operator. Check and do this here!
void FillMissingDataStorage(); void FillMissingDataStorage();
unsigned int m_MultiGridLevel;
double m_Split_Rad; double m_Split_Rad;
vector<double> m_Split_Radii; vector<double> m_Split_Radii;
unsigned int m_Split_Pos; unsigned int m_Split_Pos;