Skip to content

Commit

Permalink
ongoing: working on impedance bc for planar wg scatt
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandini committed Aug 2, 2023
1 parent 00972c2 commit 9a6ded1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Material/Electromagnetics/TPZPlanarWgScatt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ void TPZPlanarWgScatt::ContributeBC(const TPZMaterialDataT<CSTATE> &data,
case 1:
///PMC condition just adds zero to both matrices. nothing to do here....
break;
case 2:{ ///impedance boundary condition
const STATE k0 = fScaleFactor * 2*M_PI/fLambda;
TPZFNMatrix<9,CSTATE> er,ur;
GetPermittivity(data.x,er);
GetPermeability(data.x,ur);
const CSTATE eta = sqrt(ur.GetVal(0,0)/er.GetVal(0,0));
const CSTATE coeff = 1i*(k0 / eta);
const int nshape=phi.Rows();
for(int i = 0 ; i<nshape ; i++){
for(int j=0;j<nshape;j++){
const CSTATE stiff = coeff * phi(i,0) * phi(j,0);
ek(i,j) += stiff*weight;
}
}
break;
}

default:
PZError<<__PRETTY_FUNCTION__;
PZError<<"\nThis module supports only dirichlet and neumann boundary conditions.\n";
Expand Down

0 comments on commit 9a6ded1

Please sign in to comment.