fix boundary conditions
Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
This commit is contained in:
parent
db79848ed4
commit
205c1546f6
13
openems.cpp
13
openems.cpp
@ -258,6 +258,7 @@ bool openEMS::SetupBoundaryConditions()
|
|||||||
FDTD_Op->SetBCSize(n, 1);
|
FDTD_Op->SetBCSize(n, 1);
|
||||||
Operator_Ext_Mur_ABC* op_ext_mur = new Operator_Ext_Mur_ABC(FDTD_Op);
|
Operator_Ext_Mur_ABC* op_ext_mur = new Operator_Ext_Mur_ABC(FDTD_Op);
|
||||||
op_ext_mur->SetDirection(n/2,n%2);
|
op_ext_mur->SetDirection(n/2,n%2);
|
||||||
|
if (m_Mur_v_ph[n]>0)
|
||||||
op_ext_mur->SetPhaseVelocity(m_Mur_v_ph[n]);
|
op_ext_mur->SetPhaseVelocity(m_Mur_v_ph[n]);
|
||||||
FDTD_Op->AddExtension(op_ext_mur);
|
FDTD_Op->AddExtension(op_ext_mur);
|
||||||
}
|
}
|
||||||
@ -265,6 +266,7 @@ bool openEMS::SetupBoundaryConditions()
|
|||||||
FDTD_Op->SetBCSize(n, m_PML_size[n]);
|
FDTD_Op->SetBCSize(n, m_PML_size[n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//create the upml
|
//create the upml
|
||||||
Operator_Ext_UPML::Create_UPML(FDTD_Op, m_BC_type, m_PML_size, string());
|
Operator_Ext_UPML::Create_UPML(FDTD_Op, m_BC_type, m_PML_size, string());
|
||||||
|
|
||||||
@ -618,10 +620,12 @@ bool openEMS::ParseFDTDSetup(std::string file)
|
|||||||
int ihelp = 0;
|
int ihelp = 0;
|
||||||
FDTD_Opts->QueryIntAttribute("CylinderCoords",&ihelp);
|
FDTD_Opts->QueryIntAttribute("CylinderCoords",&ihelp);
|
||||||
if (ihelp==1)
|
if (ihelp==1)
|
||||||
|
{
|
||||||
this->SetCylinderCoords(true);
|
this->SetCylinderCoords(true);
|
||||||
const char* cchelp = FDTD_Opts->Attribute("MultiGrid");
|
const char* cchelp = FDTD_Opts->Attribute("MultiGrid");
|
||||||
if (cchelp!=NULL)
|
if (cchelp!=NULL)
|
||||||
this->SetupCylinderMultiGrid(string(cchelp));
|
this->SetupCylinderMultiGrid(string(cchelp));
|
||||||
|
}
|
||||||
|
|
||||||
dhelp = 0;
|
dhelp = 0;
|
||||||
FDTD_Opts->QueryDoubleAttribute("endCriteria",&dhelp);
|
FDTD_Opts->QueryDoubleAttribute("endCriteria",&dhelp);
|
||||||
@ -654,19 +658,22 @@ bool openEMS::ParseFDTDSetup(std::string file)
|
|||||||
// pml_gradFunc = string(tmp);
|
// pml_gradFunc = string(tmp);
|
||||||
|
|
||||||
string bound_names[] = {"xmin","xmax","ymin","ymax","zmin","zmax"};
|
string bound_names[] = {"xmin","xmax","ymin","ymax","zmin","zmax"};
|
||||||
|
string s_bc;
|
||||||
for (int n=0; n<6; ++n)
|
for (int n=0; n<6; ++n)
|
||||||
{
|
{
|
||||||
int EC = BC->QueryIntAttribute(bound_names[n].c_str(),&ihelp);
|
int EC = BC->QueryIntAttribute(bound_names[n].c_str(),&ihelp);
|
||||||
if (EC==TIXML_SUCCESS)
|
if (EC==TIXML_SUCCESS)
|
||||||
|
{
|
||||||
this->Set_BC_Type(n, ihelp);
|
this->Set_BC_Type(n, ihelp);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (EC==TIXML_WRONG_TYPE)
|
if (EC==TIXML_WRONG_TYPE)
|
||||||
{
|
{
|
||||||
string s_bc;
|
|
||||||
const char* tmp = BC->Attribute(bound_names[n].c_str());
|
const char* tmp = BC->Attribute(bound_names[n].c_str());
|
||||||
if (tmp)
|
if (tmp)
|
||||||
s_bc = string(tmp);
|
s_bc = string(tmp);
|
||||||
|
else
|
||||||
|
cerr << "openEMS::SetupBoundaryConditions: Warning, boundary condition for \"" << bound_names[n] << "\" unknown... set to PEC " << endl;
|
||||||
if (s_bc=="PEC")
|
if (s_bc=="PEC")
|
||||||
this->Set_BC_Type(n, 0);
|
this->Set_BC_Type(n, 0);
|
||||||
else if (s_bc=="PMC")
|
else if (s_bc=="PMC")
|
||||||
@ -683,7 +690,7 @@ bool openEMS::ParseFDTDSetup(std::string file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//read general mur phase velocity
|
//read general mur phase velocity
|
||||||
if (BC->QueryDoubleAttribute("MUR_PhaseVelocity",&dhelp) != TIXML_SUCCESS)
|
if (BC->QueryDoubleAttribute("MUR_PhaseVelocity",&dhelp) == TIXML_SUCCESS)
|
||||||
for (int n=0;n<6;++n)
|
for (int n=0;n<6;++n)
|
||||||
this->Set_Mur_PhaseVel(n, dhelp);
|
this->Set_Mur_PhaseVel(n, dhelp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user