excitation setup speedup

* get all excitation primitives inside a yz-slice only

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
This commit is contained in:
Thorsten Liebig 2020-11-22 19:08:07 +01:00
parent 46827dccb0
commit 9017d91594

View File

@ -135,14 +135,13 @@ bool Operator_Ext_Excitation::BuildExtension()
CSPropExcitation* elec=NULL; CSPropExcitation* elec=NULL;
CSProperties* prop=NULL; CSProperties* prop=NULL;
int priority=0;
unsigned int numLines[] = {m_Op->GetNumberOfLines(0,true),m_Op->GetNumberOfLines(1,true),m_Op->GetNumberOfLines(2,true)}; unsigned int numLines[] = {m_Op->GetNumberOfLines(0,true),m_Op->GetNumberOfLines(1,true),m_Op->GetNumberOfLines(2,true)};
for (pos[2]=0; pos[2]<numLines[2]; ++pos[2]) for (pos[2]=0; pos[2]<numLines[2]; ++pos[2])
{ {
for (pos[1]=0; pos[1]<numLines[1]; ++pos[1]) for (pos[1]=0; pos[1]<numLines[1]; ++pos[1])
{ {
vector<CSPrimitives*> vPrims = m_Op->GetPrimitivesBoundBox(-1, pos[1], pos[2], CSProperties::EXCITATION);
for (pos[0]=0; pos[0]<numLines[0]; ++pos[0]) for (pos[0]=0; pos[0]<numLines[0]; ++pos[0])
{ {
//electric field excite //electric field excite
@ -156,14 +155,12 @@ bool Operator_Ext_Excitation::BuildExtension()
if (m_CC_R0_included && (n==1) && (pos[0]==0)) if (m_CC_R0_included && (n==1) && (pos[0]==0))
continue; continue;
for (size_t p=0; p<vec_prop.size(); ++p) CSProperties* prop = CSX->GetPropertyByCoordPriority(volt_coord, vPrims, true);
if (prop)
{ {
prop = vec_prop.at(p);
elec = prop->ToExcitation(); elec = prop->ToExcitation();
if (elec==NULL) if (elec==NULL)
continue; continue;
if (prop->CheckCoordInPrimitive(volt_coord,priority,true))
{
if ((elec->GetActiveDir(n)) && ( (elec->GetExcitType()==0) || (elec->GetExcitType()==1) ))//&& (pos[n]<numLines[n]-1)) if ((elec->GetActiveDir(n)) && ( (elec->GetExcitType()==0) || (elec->GetExcitType()==1) ))//&& (pos[n]<numLines[n]-1))
{ {
amp = elec->GetWeightedExcitation(n,volt_coord)*m_Op->GetEdgeLength(n,pos);// delta[n]*gridDelta; amp = elec->GetWeightedExcitation(n,volt_coord)*m_Op->GetEdgeLength(n,pos);// delta[n]*gridDelta;
@ -184,7 +181,6 @@ bool Operator_Ext_Excitation::BuildExtension()
} }
} }
} }
}
//magnetic field excite //magnetic field excite
for (int n=0; n<3; ++n) for (int n=0; n<3; ++n)
@ -193,14 +189,12 @@ bool Operator_Ext_Excitation::BuildExtension()
continue; //skip the last H-Line which is outside the FDTD-domain continue; //skip the last H-Line which is outside the FDTD-domain
if (m_Op->GetYeeCoords(n,pos,curr_coord,true)==false) if (m_Op->GetYeeCoords(n,pos,curr_coord,true)==false)
continue; continue;
for (size_t p=0; p<vec_prop.size(); ++p) CSProperties* prop = CSX->GetPropertyByCoordPriority(curr_coord, vPrims, true);
if (prop)
{ {
prop = vec_prop.at(p);
elec = prop->ToExcitation(); elec = prop->ToExcitation();
if (elec==NULL) if (elec==NULL)
continue; continue;
if (prop->CheckCoordInPrimitive(curr_coord,priority,true))
{
if ((elec->GetActiveDir(n)) && ( (elec->GetExcitType()==2) || (elec->GetExcitType()==3) )) if ((elec->GetActiveDir(n)) && ( (elec->GetExcitType()==2) || (elec->GetExcitType()==3) ))
{ {
amp = elec->GetWeightedExcitation(n,curr_coord)*m_Op->GetEdgeLength(n,pos,true);// delta[n]*gridDelta; amp = elec->GetWeightedExcitation(n,curr_coord)*m_Op->GetEdgeLength(n,pos,true);// delta[n]*gridDelta;
@ -221,7 +215,6 @@ bool Operator_Ext_Excitation::BuildExtension()
} }
} }
} }
}
} }
} }