From 765490d7a3d6e7667882b9c638a4ba24559843cd Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Sun, 13 Nov 2016 22:09:36 +0100 Subject: [PATCH] cricital bug fix for mode matching probes Signed-off-by: Thorsten Liebig --- Common/processmodematch.cpp | 12 +++++++----- openems.cpp | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Common/processmodematch.cpp b/Common/processmodematch.cpp index 9c71c7a..620257d 100644 --- a/Common/processmodematch.cpp +++ b/Common/processmodematch.cpp @@ -135,22 +135,23 @@ void ProcessModeMatch::InitProcess() m_ModeDist[n] = Create2DArray(m_numLines); } + bool dualMesh = m_ModeFieldType==1; unsigned int pos[3] = {0,0,0}; double discLine[3] = {0,0,0}; double gridDelta = 1; // 1 -> mode-matching function is definied in drawing units... double var[7]; pos[m_ny] = start[m_ny]; - discLine[m_ny] = Op->GetDiscLine(m_ny,pos[m_ny],m_dualMesh); + discLine[m_ny] = Op->GetDiscLine(m_ny,pos[m_ny],dualMesh); double norm = 0; double area = 0; for (unsigned int posP = 0; posPGetDiscLine(nP,pos[nP],m_dualMesh); + discLine[nP] = Op->GetDiscLine(nP,pos[nP],dualMesh); for (unsigned int posPP = 0; posPPGetDiscLine(nPP,pos[nPP],m_dualMesh); + discLine[nPP] = Op->GetDiscLine(nPP,pos[nPP],dualMesh); var[0] = discLine[0] * gridDelta; // x var[1] = discLine[1] * gridDelta; // y @@ -169,7 +170,7 @@ void ProcessModeMatch::InitProcess() var[5] = sqrt(pow(discLine[0],2)+pow(discLine[2],2)) * gridDelta; // r var[6] = asin(1)-atan(var[2]/var[3]); //theta (t) } - area = Op->GetNodeArea(m_ny,pos,m_dualMesh); + area = Op->GetNodeArea(m_ny,pos,dualMesh); for (int n=0; n<2; ++n) { m_ModeDist[n][posP][posPP] = m_ModeParser[n]->Eval(var); //calc mode template @@ -227,6 +228,7 @@ double* ProcessModeMatch::CalcMultipleIntegrals() double field = 0; double purity = 0; double area = 0; + bool dualMesh = m_ModeFieldType==1; int nP = (m_ny+1)%3; int nPP = (m_ny+2)%3; @@ -242,7 +244,7 @@ double* ProcessModeMatch::CalcMultipleIntegrals() for (unsigned int posPP = 0; posPPGetNodeArea(m_ny,pos,m_dualMesh); + area = Op->GetNodeArea(m_ny,pos,dualMesh); if (m_ModeFieldType==0) m_Eng_Interface->GetEField(pos,out); if (m_ModeFieldType==1) diff --git a/openems.cpp b/openems.cpp index 5c5dc28..1aaad18 100644 --- a/openems.cpp +++ b/openems.cpp @@ -418,11 +418,13 @@ bool openEMS::SetupProcessing() } if (CylinderCoords) proc->SetMeshType(Processing::CYLINDRICAL_MESH); - if ((pb->GetProbeType()==1) || (pb->GetProbeType()==3) || (pb->GetProbeType()==11)) + if ((pb->GetProbeType()==1) || (pb->GetProbeType()==3)) { proc->SetDualTime(true); proc->SetDualMesh(true); } + if (pb->GetProbeType()==11) + proc->SetDualTime(true); proc->SetProcessInterval(Nyquist/m_OverSampling); if (pb->GetStartTime()>0 || pb->GetStopTime()>0) proc->SetProcessStartStopTime(pb->GetStartTime(), pb->GetStopTime());