2010-10-04 09:52:39 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Thorsten Liebig (Thorsten.Liebig@gmx.de)
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "engine_ext_upml.h"
|
|
|
|
#include "operator_ext_upml.h"
|
2010-12-06 14:30:47 +00:00
|
|
|
#include "FDTD/engine.h"
|
|
|
|
#include "FDTD/engine_sse.h"
|
2010-10-04 09:52:39 +00:00
|
|
|
#include "tools/array_ops.h"
|
2010-10-06 08:30:55 +00:00
|
|
|
#include "tools/useful.h"
|
2010-10-04 09:52:39 +00:00
|
|
|
|
|
|
|
Engine_Ext_UPML::Engine_Ext_UPML(Operator_Ext_UPML* op_ext) : Engine_Extension(op_ext)
|
|
|
|
{
|
|
|
|
m_Op_UPML = op_ext;
|
|
|
|
|
|
|
|
//this ABC extension should be executed first!
|
2011-03-16 15:26:01 +00:00
|
|
|
m_Priority = ENG_EXT_PRIO_UPML;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
|
|
|
volt_flux = Create_N_3DArray<FDTD_FLOAT>(m_Op_UPML->m_numLines);
|
|
|
|
curr_flux = Create_N_3DArray<FDTD_FLOAT>(m_Op_UPML->m_numLines);
|
2010-10-06 08:30:55 +00:00
|
|
|
|
|
|
|
SetNumberOfThreads(1);
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Engine_Ext_UPML::~Engine_Ext_UPML()
|
|
|
|
{
|
|
|
|
Delete_N_3DArray<FDTD_FLOAT>(volt_flux,m_Op_UPML->m_numLines);
|
|
|
|
volt_flux=NULL;
|
|
|
|
Delete_N_3DArray<FDTD_FLOAT>(curr_flux,m_Op_UPML->m_numLines);
|
|
|
|
curr_flux=NULL;
|
|
|
|
}
|
|
|
|
|
2010-10-06 08:30:55 +00:00
|
|
|
void Engine_Ext_UPML::SetNumberOfThreads(int nrThread)
|
|
|
|
{
|
|
|
|
Engine_Extension::SetNumberOfThreads(nrThread);
|
|
|
|
|
|
|
|
m_numX = AssignJobs2Threads(m_Op_UPML->m_numLines[0],m_NrThreads,false);
|
|
|
|
m_start.resize(m_NrThreads,0);
|
|
|
|
m_start.at(0)=0;
|
2010-12-06 12:04:37 +00:00
|
|
|
for (size_t n=1; n<m_numX.size(); ++n)
|
2010-10-06 08:30:55 +00:00
|
|
|
m_start.at(n) = m_start.at(n-1) + m_numX.at(n-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Engine_Ext_UPML::DoPreVoltageUpdates(int threadID)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
|
|
|
if (m_Eng==NULL)
|
|
|
|
return;
|
|
|
|
|
2010-10-06 08:30:55 +00:00
|
|
|
if (threadID>=m_NrThreads)
|
|
|
|
return;
|
|
|
|
|
2010-10-04 09:52:39 +00:00
|
|
|
unsigned int pos[3];
|
|
|
|
unsigned int loc_pos[3];
|
2010-10-07 17:25:22 +00:00
|
|
|
FDTD_FLOAT f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
switch (m_Eng->GetType())
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-05 09:50:30 +00:00
|
|
|
case Engine::BASIC:
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetVolt(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetVolt(0,pos, volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetVolt(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetVolt(1,pos, volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetVolt(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetVolt(2,pos, volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
2010-12-06 12:04:37 +00:00
|
|
|
break;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
case Engine::SSE:
|
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
Engine_sse* eng_sse = (Engine_sse*) m_Eng;
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-06 08:30:55 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetVolt(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-06 08:30:55 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(0,pos, volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetVolt(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-06 08:30:55 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(1,pos, volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetVolt(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-06 08:30:55 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(2,pos, volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-06 08:30:55 +00:00
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-06 08:30:55 +00:00
|
|
|
break;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->vv[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetVolt(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetVolt(0,pos, volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
|
|
|
|
|
|
|
f_help = m_Op_UPML->vv[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetVolt(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetVolt(1,pos, volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
|
|
|
|
|
|
|
f_help = m_Op_UPML->vv[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetVolt(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->vvfo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetVolt(2,pos, volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
|
2010-10-06 08:30:55 +00:00
|
|
|
void Engine_Ext_UPML::DoPostVoltageUpdates(int threadID)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
|
|
|
if (m_Eng==NULL)
|
|
|
|
return;
|
2010-10-06 08:30:55 +00:00
|
|
|
if (threadID>=m_NrThreads)
|
|
|
|
return;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
|
|
|
unsigned int pos[3];
|
|
|
|
unsigned int loc_pos[3];
|
2010-10-07 17:25:22 +00:00
|
|
|
FDTD_FLOAT f_help;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-05 09:50:30 +00:00
|
|
|
switch (m_Eng->GetType())
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-05 09:50:30 +00:00
|
|
|
case Engine::BASIC:
|
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
2010-10-07 17:25:22 +00:00
|
|
|
|
|
|
|
f_help = volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetVolt(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetVolt(0,pos, f_help + m_Op_UPML->vvfn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetVolt(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetVolt(1,pos, f_help + m_Op_UPML->vvfn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetVolt(2,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetVolt(2,pos, f_help + m_Op_UPML->vvfn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Engine::SSE:
|
|
|
|
{
|
|
|
|
Engine_sse* eng_sse = (Engine_sse*) m_Eng;
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetVolt(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(0,pos, f_help + m_Op_UPML->vvfn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetVolt(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(1,pos, f_help + m_Op_UPML->vvfn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetVolt(2,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetVolt(2,pos, f_help + m_Op_UPML->vvfn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetVolt(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->SetVolt(0,pos, f_help + m_Op_UPML->vvfn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
|
|
|
|
|
|
|
f_help = volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetVolt(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->SetVolt(1,pos, f_help + m_Op_UPML->vvfn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
|
|
|
volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetVolt(2,pos);
|
2010-12-06 12:04:37 +00:00
|
|
|
m_Eng->SetVolt(2,pos, f_help + m_Op_UPML->vvfn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * volt_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
break;
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
|
2010-10-06 08:30:55 +00:00
|
|
|
void Engine_Ext_UPML::DoPreCurrentUpdates(int threadID)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
|
|
|
if (m_Eng==NULL)
|
|
|
|
return;
|
2010-10-06 08:30:55 +00:00
|
|
|
if (threadID>=m_NrThreads)
|
|
|
|
return;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
|
|
|
unsigned int pos[3];
|
|
|
|
unsigned int loc_pos[3];
|
2010-10-07 17:25:22 +00:00
|
|
|
FDTD_FLOAT f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
|
|
|
switch (m_Eng->GetType())
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-05 09:50:30 +00:00
|
|
|
case Engine::BASIC:
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetCurr(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetCurr(0,pos, curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetCurr(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetCurr(1,pos, curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->Engine::GetCurr(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->Engine::SetCurr(2,pos, curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Engine::SSE:
|
|
|
|
{
|
|
|
|
Engine_sse* eng_sse = (Engine_sse*) m_Eng;
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetCurr(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(0,pos, curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetCurr(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(1,pos, curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * eng_sse->Engine_sse::GetCurr(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(2,pos, curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = m_Op_UPML->ii[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetCurr(0,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetCurr(0,pos, curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
|
|
|
|
|
|
|
f_help = m_Op_UPML->ii[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetCurr(1,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetCurr(1,pos, curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
|
|
|
|
|
|
|
f_help = m_Op_UPML->ii[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * m_Eng->GetCurr(2,pos)
|
2010-12-06 12:04:37 +00:00
|
|
|
- m_Op_UPML->iifo[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
m_Eng->SetCurr(2,pos, curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-07 17:25:22 +00:00
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = f_help;
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-06 08:30:55 +00:00
|
|
|
void Engine_Ext_UPML::DoPostCurrentUpdates(int threadID)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
|
|
|
if (m_Eng==NULL)
|
|
|
|
return;
|
2010-10-06 08:30:55 +00:00
|
|
|
if (threadID>=m_NrThreads)
|
|
|
|
return;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
|
|
|
unsigned int pos[3];
|
|
|
|
unsigned int loc_pos[3];
|
2010-10-07 17:25:22 +00:00
|
|
|
FDTD_FLOAT f_help;
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-05 09:50:30 +00:00
|
|
|
switch (m_Eng->GetType())
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-05 09:50:30 +00:00
|
|
|
case Engine::BASIC:
|
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetCurr(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetCurr(0,pos, f_help + m_Op_UPML->iifn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetCurr(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetCurr(1,pos, f_help + m_Op_UPML->iifn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->Engine::GetCurr(2,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->Engine::SetCurr(2,pos, f_help + m_Op_UPML->iifn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Engine::SSE:
|
|
|
|
{
|
|
|
|
Engine_sse* eng_sse = (Engine_sse*) m_Eng;
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetCurr(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(0,pos, f_help + m_Op_UPML->iifn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetCurr(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(1,pos, f_help + m_Op_UPML->iifn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = eng_sse->Engine_sse::GetCurr(2,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
eng_sse->Engine_sse::SetCurr(2,pos, f_help + m_Op_UPML->iifn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-12-06 12:04:37 +00:00
|
|
|
for (unsigned int lineX=0; lineX<m_numX.at(threadID); ++lineX)
|
2010-10-04 09:52:39 +00:00
|
|
|
{
|
2010-10-06 08:30:55 +00:00
|
|
|
loc_pos[0]=lineX+m_start.at(threadID);
|
2010-10-05 09:50:30 +00:00
|
|
|
pos[0] = loc_pos[0] + m_Op_UPML->m_StartPos[0];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[1]=0; loc_pos[1]<m_Op_UPML->m_numLines[1]; ++loc_pos[1])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[1] = loc_pos[1] + m_Op_UPML->m_StartPos[1];
|
2010-12-06 12:04:37 +00:00
|
|
|
for (loc_pos[2]=0; loc_pos[2]<m_Op_UPML->m_numLines[2]; ++loc_pos[2])
|
2010-10-05 09:50:30 +00:00
|
|
|
{
|
|
|
|
pos[2] = loc_pos[2] + m_Op_UPML->m_StartPos[2];
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetCurr(0,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->SetCurr(0,pos, f_help + m_Op_UPML->iifn[0][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[0][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
|
|
|
|
|
|
|
f_help = curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
2010-10-05 09:50:30 +00:00
|
|
|
curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetCurr(1,pos);
|
2010-10-07 17:25:22 +00:00
|
|
|
m_Eng->SetCurr(1,pos, f_help + m_Op_UPML->iifn[1][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[1][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
2010-10-04 09:52:39 +00:00
|
|
|
|
2010-10-07 17:25:22 +00:00
|
|
|
f_help = curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]];
|
|
|
|
curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] = m_Eng->GetCurr(2,pos);
|
2010-12-06 12:04:37 +00:00
|
|
|
m_Eng->SetCurr(2,pos, f_help + m_Op_UPML->iifn[2][loc_pos[0]][loc_pos[1]][loc_pos[2]] * curr_flux[2][loc_pos[0]][loc_pos[1]][loc_pos[2]]);
|
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
}
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
2010-10-05 09:50:30 +00:00
|
|
|
break;
|
2010-10-04 09:52:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|