diff --git a/src/particles/elements/Aperture.H b/src/particles/elements/Aperture.H index d11b3ee2f..90d8157e6 100644 --- a/src/particles/elements/Aperture.H +++ b/src/particles/elements/Aperture.H @@ -49,7 +49,7 @@ namespace impactx static std::string shape_name (Shape const & shape); - + static std::string action_name (Action const & action); @@ -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(); @@ -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(); diff --git a/src/python/elements.cpp b/src/python/elements.cpp index 5a1a511b2..2c42cbfd5 100644 --- a/src/python/elements.cpp +++ b/src/python/elements.cpp @@ -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; @@ -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;