From 3dd48d8cf98e8db381becde26d979f3c3a868179 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Tue, 11 Sep 2012 09:42:15 +0200 Subject: [PATCH] fixed priority system for dispersive media --- FDTD/extensions/operator_ext_conductingsheet.cpp | 8 +++----- FDTD/extensions/operator_ext_lorentzmaterial.cpp | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/FDTD/extensions/operator_ext_conductingsheet.cpp b/FDTD/extensions/operator_ext_conductingsheet.cpp index 5f82cbf..9870f91 100644 --- a/FDTD/extensions/operator_ext_conductingsheet.cpp +++ b/FDTD/extensions/operator_ext_conductingsheet.cpp @@ -84,12 +84,10 @@ bool Operator_Ext_ConductingSheet::BuildExtension() if (m_CC_R0_included && (n==2) && (pos[0]==0)) disable_pos = true; - CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::CONDUCTINGSHEET, false, &cs_sheet); - if (prop) + CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,(CSProperties::PropertyType)(CSProperties::METAL | CSProperties::MATERIAL), false, &cs_sheet); + CSPropConductingSheet* cs_prop = dynamic_cast(prop); + if (cs_prop) { - CSPropConductingSheet* cs_prop = dynamic_cast(prop); - if (cs_prop==NULL) - return false; //sanity check, this should never happen if (cs_sheet==NULL) return false; //sanity check, this should never happen if (cs_sheet->GetDimension()!=2) diff --git a/FDTD/extensions/operator_ext_lorentzmaterial.cpp b/FDTD/extensions/operator_ext_lorentzmaterial.cpp index 8cea4db..b0268c8 100644 --- a/FDTD/extensions/operator_ext_lorentzmaterial.cpp +++ b/FDTD/extensions/operator_ext_lorentzmaterial.cpp @@ -151,7 +151,7 @@ bool Operator_Ext_LorentzMaterial::BuildExtension() if (m_CC_R0_included && (n==2) && (pos[0]==0)) coord[1] = m_Op->GetDiscLine(1,0); - CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL, true); + CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,(CSProperties::PropertyType)(CSProperties::METAL | CSProperties::MATERIAL), true); if ((mat = prop->ToLorentzMaterial())) { w_plasma = mat->GetEpsPlasmaFreqWeighted(order,n,coord) * 2 * PI; @@ -176,7 +176,7 @@ bool Operator_Ext_LorentzMaterial::BuildExtension() if (m_Op->GetYeeCoords(n,pos,coord,true)==false) continue; - CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL, true); + CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,(CSProperties::PropertyType)(CSProperties::METAL | CSProperties::MATERIAL), true); if ((mat = prop->ToLorentzMaterial())) { w_plasma = mat->GetMuePlasmaFreqWeighted(order,n,coord) * 2 * PI;