From ca8c5eeee43e97091d1200ffc6c600d3f16efec9 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 8 Jun 2011 10:29:00 +0200 Subject: [PATCH] upml: critical bug in upml grading function wrong upml grading function has made the pml unstable or fail for small mesh delta units --- FDTD/extensions/operator_ext_upml.cpp | 2 +- FDTD/extensions/operator_ext_upml.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FDTD/extensions/operator_ext_upml.cpp b/FDTD/extensions/operator_ext_upml.cpp index 8672630..6a1b7f0 100644 --- a/FDTD/extensions/operator_ext_upml.cpp +++ b/FDTD/extensions/operator_ext_upml.cpp @@ -25,7 +25,7 @@ Operator_Ext_UPML::Operator_Ext_UPML(Operator* op) : Operator_Extension(op) { m_GradingFunction = new FunctionParser(); //default grading function - SetGradingFunction(" -log(1e-6)*log(2.5)/(2*dl*pow(2.5,W/dl)-1) * pow(2.5, D/dl) / Z "); + SetGradingFunction(" -log(1e-6)*log(2.5)/(2*dl*Z*(pow(2.5,W/dl)-1)) * pow(2.5, D/dl) "); for (int n=0; n<6; ++n) { diff --git a/FDTD/extensions/operator_ext_upml.h b/FDTD/extensions/operator_ext_upml.h index 1f54364..725c127 100644 --- a/FDTD/extensions/operator_ext_upml.h +++ b/FDTD/extensions/operator_ext_upml.h @@ -54,7 +54,7 @@ public: W = width (length) of the pml in meter N = number of cells for the pml Z = wave impedance at the current depth and position - example: SetGradingFunction("-log(1e-6)*log(2.5)/(2*dl*pow(2.5,W/dl)-1) * pow(2.5, D/dl) / Z"); + example: SetGradingFunction(" -log(1e-6)*log(2.5)/(2*dl*Z*(pow(2.5,W/dl)-1)) * pow(2.5, D/dl) "); An empty function string will be ignored. */