From 9d51971c2678d3df70676848dc5fa2df53f7cfbb Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 16 Feb 2011 15:28:14 +0100 Subject: [PATCH] MPI: fix for cylindrical coordinate engine + MPI --- FDTD/operator.cpp | 9 +++++---- FDTD/operator.h | 1 + FDTD/operator_cylinder.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/FDTD/operator.cpp b/FDTD/operator.cpp index 7b10a54..01dc573 100644 --- a/FDTD/operator.cpp +++ b/FDTD/operator.cpp @@ -35,6 +35,7 @@ Operator::Operator() : Operator_Base() { Exc = 0; m_InvaildTimestep = false; + m_TimeStepVar = 3; } Operator::~Operator() @@ -1192,11 +1193,11 @@ bool Operator::Calc_EC() double Operator::CalcTimestep() { -#if 1 //use the new timestep-calc (1) or the old one (0) - return CalcTimestep_Var3(); //the biggest one for cartesian meshes -#else + if (m_TimeStepVar==3) + return CalcTimestep_Var3(); //the biggest one for cartesian meshes + + //variant 1 is default return CalcTimestep_Var1(); -#endif } ////Berechnung nach Andreas Rennings Dissertation 2008, Seite 66, Formel 4.52 diff --git a/FDTD/operator.h b/FDTD/operator.h index 223e5a7..38d3bb2 100644 --- a/FDTD/operator.h +++ b/FDTD/operator.h @@ -156,6 +156,7 @@ protected: virtual void CalcPEC_Curves(); //internal to CalcPEC //Calc timestep only internal use + int m_TimeStepVar; virtual double CalcTimestep(); double opt_dT; bool m_InvaildTimestep; diff --git a/FDTD/operator_cylinder.cpp b/FDTD/operator_cylinder.cpp index 6de018b..9f520a1 100644 --- a/FDTD/operator_cylinder.cpp +++ b/FDTD/operator_cylinder.cpp @@ -229,5 +229,6 @@ void Operator_Cylinder::AddExtension(Operator_Extension* op_ext) double Operator_Cylinder::CalcTimestep() { - return CalcTimestep_Var1(); + m_TimeStepVar = 1; + return Operator_Multithread::CalcTimestep(); }