From 161bdf9c28c5a4f67739066f60b5ac2ef72d8d5a Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 5 Mar 2010 13:53:05 +0100 Subject: [PATCH] Seperate Operator init --- FDTD/cartoperator.cpp | 17 +++++++++++------ FDTD/cartoperator.h | 1 + FDTD/processfields.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/FDTD/cartoperator.cpp b/FDTD/cartoperator.cpp index e359227..1686277 100644 --- a/FDTD/cartoperator.cpp +++ b/FDTD/cartoperator.cpp @@ -63,13 +63,8 @@ void CartOperator::SetGeometryCSX(ContinuousStructure* geo) MainOp->AddCellAdrOp(); } -int CartOperator::CalcECOperator() +void CartOperator::InitOperator() { - if (Calc_EC()==0) - return -1; - - CalcTimestep(); - Delete_N_3DArray(vv,numLines); Delete_N_3DArray(vi,numLines); Delete_N_3DArray(iv,numLines); @@ -78,6 +73,16 @@ int CartOperator::CalcECOperator() vi = Create_N_3DArray(numLines); iv = Create_N_3DArray(numLines); ii = Create_N_3DArray(numLines); +} + +int CartOperator::CalcECOperator() +{ + if (Calc_EC()==0) + return -1; + + CalcTimestep(); + + InitOperator(); unsigned int i=0; unsigned int pos[3]; diff --git a/FDTD/cartoperator.h b/FDTD/cartoperator.h index 3a0f63a..8e3744e 100644 --- a/FDTD/cartoperator.h +++ b/FDTD/cartoperator.h @@ -20,6 +20,7 @@ public: protected: virtual void Init(); + virtual void InitOperator(); AdrOp* MainOp; AdrOp* DualOp; diff --git a/FDTD/processfields.h b/FDTD/processfields.h index 682da8b..51368b9 100644 --- a/FDTD/processfields.h +++ b/FDTD/processfields.h @@ -24,7 +24,7 @@ public: protected: ProcessFields(Operator* op, Engine* eng); - bool DumpFieldArray2VTK(ofstream &file, string name, FDTD_FLOAT**** array, double** discLines, unsigned int* numLines); + static bool DumpFieldArray2VTK(ofstream &file, string name, FDTD_FLOAT**** array, double** discLines, unsigned int* numLines); int DumpMode; int DumpType;