changed CSXCAD API handling used primitives

This commit is contained in:
Thorsten Liebig 2010-10-19 16:54:35 +02:00
parent da3e55a65c
commit 7dec28731c
3 changed files with 16 additions and 16 deletions

View File

@ -762,7 +762,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
// cerr << ny << " " << pos[0] << " " << pos[1] << " " << pos[2] << ": " << A_n << endl; // cerr << ny << " " << pos[0] << " " << pos[1] << " " << pos[2] << ": " << A_n << endl;
// exit(0); // exit(0);
// } // }
CSProperties* prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); CSProperties* prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -784,7 +784,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
--loc_pos[nP]; --loc_pos[nP];
A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true); A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true);
// cerr << A_n << endl; // cerr << A_n << endl;
prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -805,7 +805,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
++loc_pos[nP]; ++loc_pos[nP];
--loc_pos[nPP]; --loc_pos[nPP];
A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true); A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true);
prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -825,7 +825,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
shiftCoord[nPP] = coord[nPP]-deltaPP_M*0.25; shiftCoord[nPP] = coord[nPP]-deltaPP_M*0.25;
--loc_pos[nP]; --loc_pos[nP];
A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true); A_n = GetNodeArea(ny,(unsigned int*)loc_pos,true);
prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -851,7 +851,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
shiftCoord[nPP] = coord[nPP]+deltaPP*0.5; shiftCoord[nPP] = coord[nPP]+deltaPP*0.5;
--loc_pos[n]; --loc_pos[n];
double delta_ny = GetNodeWidth(n,(unsigned int*)loc_pos,true); double delta_ny = GetNodeWidth(n,(unsigned int*)loc_pos,true);
prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -874,7 +874,7 @@ bool Operator::Calc_EffMatPos(int ny, const unsigned int* pos, double* EffMat) c
shiftCoord[nPP] = coord[nPP]+deltaPP*0.5; shiftCoord[nPP] = coord[nPP]+deltaPP*0.5;
++loc_pos[n]; ++loc_pos[n];
delta_ny = GetNodeWidth(n,(unsigned int*)loc_pos,true); delta_ny = GetNodeWidth(n,(unsigned int*)loc_pos,true);
prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL); prop = CSX->GetPropertyByCoordPriority(shiftCoord,CSProperties::MATERIAL,true);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();
@ -1143,9 +1143,9 @@ bool Operator::CalcFieldExcitation()
{ {
prop = vec_prop.at(p); prop = vec_prop.at(p);
elec = prop->ToElectrode(); elec = prop->ToElectrode();
if (prop->CheckCoordInPrimitive(volt_coord,priority)==false) if (elec==NULL)
elec=NULL; continue;
if (elec!=NULL) 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))
{ {
@ -1185,9 +1185,9 @@ bool Operator::CalcFieldExcitation()
{ {
prop = vec_prop.at(p); prop = vec_prop.at(p);
elec = prop->ToElectrode(); elec = prop->ToElectrode();
if (prop->CheckCoordInPrimitive(curr_coord,priority)==false) if (elec==NULL)
elec=NULL; continue;
if (elec!=NULL) 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) ))
{ {
@ -1316,7 +1316,7 @@ void Operator::CalcPEC_Range(unsigned int startX, unsigned int stopX, unsigned i
coord[2] = discLines[2][pos[2]]; coord[2] = discLines[2][pos[2]];
delta=MainOp->GetIndexDelta(n,pos[n]); delta=MainOp->GetIndexDelta(n,pos[n]);
coord[n]= discLines[n][pos[n]] + delta*0.5; coord[n]= discLines[n][pos[n]] + delta*0.5;
CSProperties* prop = CSX->GetPropertyByCoordPriority(coord, (CSProperties::PropertyType)(CSProperties::MATERIAL | CSProperties::METAL)); CSProperties* prop = CSX->GetPropertyByCoordPriority(coord, (CSProperties::PropertyType)(CSProperties::MATERIAL | CSProperties::METAL), true);
if (prop) if (prop)
{ {
if (prop->GetType()==CSProperties::METAL) //set to PEC if (prop->GetType()==CSProperties::METAL) //set to PEC

View File

@ -78,7 +78,7 @@ bool Operator_Ext_LorentzMaterial::BuildExtension()
coord[2] = m_Op->GetDiscLine(2,pos[2]); coord[2] = m_Op->GetDiscLine(2,pos[2]);
coord[n] = m_Op->GetDiscLine(n,pos[n],true); //pos of E_n coord[n] = m_Op->GetDiscLine(n,pos[n],true); //pos of E_n
CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL); CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL, true);
if ((mat = prop->ToLorentzMaterial())) if ((mat = prop->ToLorentzMaterial()))
{ {
w_plasma = mat->GetEpsPlasmaFreqWeighted(n,coord) * 2 * PI; w_plasma = mat->GetEpsPlasmaFreqWeighted(n,coord) * 2 * PI;
@ -99,7 +99,7 @@ bool Operator_Ext_LorentzMaterial::BuildExtension()
coord[2] = m_Op->GetDiscLine(2,pos[2],true); coord[2] = m_Op->GetDiscLine(2,pos[2],true);
coord[n] = m_Op->GetDiscLine(n,pos[n]); //pos of H_n coord[n] = m_Op->GetDiscLine(n,pos[n]); //pos of H_n
CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL); CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::LORENTZMATERIAL, true);
if ((mat = prop->ToLorentzMaterial())) if ((mat = prop->ToLorentzMaterial()))
{ {
w_plasma = mat->GetMuePlasmaFreqWeighted(n,coord) * 2 * PI; w_plasma = mat->GetMuePlasmaFreqWeighted(n,coord) * 2 * PI;

View File

@ -144,7 +144,7 @@ bool Operator_Ext_Mur_ABC::BuildExtension()
for (pos[m_nyPP]=0;pos[m_nyPP]<m_numLines[1];++pos[m_nyPP]) for (pos[m_nyPP]=0;pos[m_nyPP]<m_numLines[1];++pos[m_nyPP])
{ {
coord[m_nyPP] = m_Op->GetDiscLine(m_nyPP,pos[m_nyPP]); coord[m_nyPP] = m_Op->GetDiscLine(m_nyPP,pos[m_nyPP]);
CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord,CSProperties::MATERIAL); CSProperties* prop = m_Op->GetGeometryCSX()->GetPropertyByCoordPriority(coord, CSProperties::MATERIAL, false);
if (prop) if (prop)
{ {
CSPropMaterial* mat = prop->ToMaterial(); CSPropMaterial* mat = prop->ToMaterial();