From 70ff8634f4c9ba216953c7f7106c7c4c9e093cca Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 27 Mar 2013 12:00:46 +0100 Subject: [PATCH] Cylindrical MultiGrid Operator: record level of multi grid Signed-off-by: Thorsten Liebig --- FDTD/operator_cylindermultigrid.cpp | 9 +++++---- FDTD/operator_cylindermultigrid.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/FDTD/operator_cylindermultigrid.cpp b/FDTD/operator_cylindermultigrid.cpp index bd1066d..4100430 100644 --- a/FDTD/operator_cylindermultigrid.cpp +++ b/FDTD/operator_cylindermultigrid.cpp @@ -20,11 +20,12 @@ #include "extensions/operator_ext_cylinder.h" #include "tools/useful.h" -Operator_CylinderMultiGrid::Operator_CylinderMultiGrid(vector Split_Radii) : Operator_Cylinder() +Operator_CylinderMultiGrid::Operator_CylinderMultiGrid(vector Split_Radii, unsigned int level) : Operator_Cylinder() { m_Split_Radii = Split_Radii; m_Split_Rad = m_Split_Radii.back(); m_Split_Radii.pop_back(); + m_MultiGridLevel = level; } Operator_CylinderMultiGrid::~Operator_CylinderMultiGrid() @@ -32,7 +33,7 @@ Operator_CylinderMultiGrid::~Operator_CylinderMultiGrid() Delete(); } -Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector Split_Radii, unsigned int numThreads) +Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector Split_Radii, unsigned int numThreads, unsigned int level) { if ((Split_Radii.size()==0) || (Split_Radii.size()>CYLIDINDERMULTIGRID_LIMIT)) { @@ -40,7 +41,7 @@ Operator_CylinderMultiGrid* Operator_CylinderMultiGrid::New(vector Split return NULL; } 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->Init(); @@ -129,7 +130,7 @@ void Operator_CylinderMultiGrid::Init() if (m_Split_Radii.empty()) m_InnerOp = Operator_Cylinder::New(m_numThreads); 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) { diff --git a/FDTD/operator_cylindermultigrid.h b/FDTD/operator_cylindermultigrid.h index f61489d..1174e56 100644 --- a/FDTD/operator_cylindermultigrid.h +++ b/FDTD/operator_cylindermultigrid.h @@ -32,7 +32,7 @@ class Operator_CylinderMultiGrid : public Operator_Cylinder { friend class Engine_CylinderMultiGrid; public: - static Operator_CylinderMultiGrid* New(vector Split_Radii, unsigned int numThreads = 0); + static Operator_CylinderMultiGrid* New(vector Split_Radii, unsigned int numThreads = 0, unsigned int level = 0); virtual ~Operator_CylinderMultiGrid(); virtual double GetNumberCells() const; @@ -63,7 +63,7 @@ public: #endif protected: - Operator_CylinderMultiGrid(vector Split_Radii); + Operator_CylinderMultiGrid(vector Split_Radii, unsigned int level); virtual void Init(); void Delete(); 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! void FillMissingDataStorage(); + unsigned int m_MultiGridLevel; double m_Split_Rad; vector m_Split_Radii; unsigned int m_Split_Pos;