Skip to content

Commit

Permalink
Bug fix to convert from Pozar coordinates to Kass coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Jul 17, 2023
1 parent b8c3700 commit 92d49cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Source/Fields/LMCPozarCylindricalCavity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace locust

double z = zKass + L/2.;

if ((r > R) || (fabs(z) > L/2.)) // outside the cavity
if ((r > R) || (fabs(zKass) > L/2.)) // outside the cavity
{
return {0.,0.};
}
Expand Down Expand Up @@ -66,7 +66,7 @@ namespace locust

double z = zKass + L/2.;

if ((r > R) || (fabs(z) > L/2.)) // outside the cavity
if ((r > R) || (fabs(zKass) > L/2.)) // outside the cavity
{
return {0.,0.,0.};
}
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace locust
{
double z = zKass + L/2.;

if ((r > R) || (fabs(z) > L/2.)) // outside the cavity
if ((r > R) || (fabs(zKass) > L/2.)) // outside the cavity
{
return {0.,0.,0.};
}
Expand Down Expand Up @@ -145,7 +145,7 @@ namespace locust
{
double z = zKass + L/2.;

if ((r > R) || (fabs(z) > L/2.)) // outside the cavity
if ((r > R) || (fabs(zKass) > L/2.)) // outside the cavity
{
return {0.,0.};
}
Expand Down
8 changes: 4 additions & 4 deletions Source/Fields/LMCPozarRectangularWaveguide.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace locust
double x = xKass + dimX/2.;
double y = yKass + dimY/2.;

if ((fabs(x) > dimX/2.) || (fabs(y) > dimY/2.))
if ((fabs(xKass) > dimX/2.) || (fabs(yKass) > dimY/2.))
{
return {0.,0.};
}
Expand Down Expand Up @@ -51,7 +51,7 @@ namespace locust
double x = xKass + dimX/2.;
double y = yKass + dimY/2.;

if ((fabs(x) > dimX/2.) || (fabs(y) > dimY/2.))
if ((fabs(xKass) > dimX/2.) || (fabs(yKass) > dimY/2.))
{
return {0.,0.};
}
Expand Down Expand Up @@ -81,7 +81,7 @@ namespace locust
double x = xKass + dimX/2.;
double y = yKass + dimY/2.;

if ((fabs(x) > dimX/2.) || (fabs(y) > dimY/2.))
if ((fabs(xKass) > dimX/2.) || (fabs(yKass) > dimY/2.))
{
return {0.,0.};
}
Expand Down Expand Up @@ -109,7 +109,7 @@ namespace locust
double x = xKass + dimX/2.;
double y = yKass + dimY/2.;

if ((fabs(x) > dimX/2.) || (fabs(y) > dimY/2.))
if ((fabs(xKass) > dimX/2.) || (fabs(yKass) > dimY/2.))
{
return {0.,0.};
}
Expand Down

0 comments on commit 92d49cc

Please sign in to comment.