Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 19, 2024
1 parent 914677e commit eb14cde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/particles/elements/Aperture.H
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace impactx

static std::string
shape_name (Shape const & shape);

static std::string
action_name (Action const & action);

Expand Down Expand Up @@ -143,7 +143,7 @@ namespace impactx
amrex::ParticleIDWrapper{idcpu}.make_invalid();
}
break;

case Shape::elliptical :
if (std::pow(u,2) + std::pow(v,2) > 1_prt) {
amrex::ParticleIDWrapper{idcpu}.make_invalid();
Expand All @@ -161,7 +161,7 @@ namespace impactx
amrex::ParticleIDWrapper{idcpu}.make_invalid();
}
break;

case Shape::elliptical :
if (std::pow(u,2) + std::pow(v,2) < 1_prt) {
amrex::ParticleIDWrapper{idcpu}.make_invalid();
Expand Down
6 changes: 3 additions & 3 deletions src/python/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void init_elements(py::module& m)

if (action != "transmit" && action != "absorb")
throw std::runtime_error(R"(action must be "transmit" or "absorb")");

Aperture::Shape const s = shape == "rectangular" ?
Aperture::Shape::rectangular :
Aperture::Shape::elliptical;
Expand Down Expand Up @@ -341,14 +341,14 @@ void init_elements(py::module& m)
)
.def_property("action",
[](Aperture & ap)
{
{
return ap.action_name(ap.m_action);
},
[](Aperture & ap, std::string const & action)
{
if (action != "transmit" && action != "absorb")
throw std::runtime_error(R"(action must be "transmit" or "absorb")");

ap.m_action = action == "transmit" ?
Aperture::Action::transmit :
Aperture::Action::absorb;
Expand Down

0 comments on commit eb14cde

Please sign in to comment.