diff --git a/src/orange/OrangeParams.cc b/src/orange/OrangeParams.cc index 0d366a6e6d..da1461683a 100644 --- a/src/orange/OrangeParams.cc +++ b/src/orange/OrangeParams.cc @@ -7,12 +7,10 @@ //---------------------------------------------------------------------------// #include "OrangeParams.hh" -#include #include #include #include #include -#include #include #include #include @@ -104,43 +102,6 @@ OrangeInput input_from_file(std::string filename) return input_from_json(std::move(filename)); } -//---------------------------------------------------------------------------// -/*! - * Update faces/intersections if we know the "automatic" value is wrong. - * - * See https://github.com/celeritas-project/celeritas/issues/1334 . - */ -void apply_face_intersect_hack(std::string const& var, - OrangeParamsScalars* scalars) -{ - std::string mfi = celeritas::getenv(var); - if (mfi.empty()) - { - return; - } - CELER_LOG(warning) - << "Using a temporary, unsupported, and dangerous hack to " - "override maximum faces and intersections in ORANGE: " - << var << "='" << mfi << "'"; - - static std::regex const mfi_regex{R"re(^(\d+),(\d+)$)re"}; - std::smatch mfi_match; - CELER_VALIDATE(std::regex_match(mfi, mfi_match, mfi_regex), - << "invalid pattern for " << var); - auto update = [](char const* type, auto const& submatch, size_type* dest) { - auto&& s = submatch.str(); - int updated{-1}; - std::from_chars(s.data(), s.data() + s.length(), updated); - CELER_VALIDATE(updated > 0, - << "invalid maximum " << type << ": " << updated); - CELER_LOG(warning) << "Forcing maximum " << type << " from " << *dest - << " to " << updated; - *dest = static_cast(updated); - }; - update("faces", mfi_match[0], &scalars->max_faces); - update("intersections", mfi_match[1], &scalars->max_intersections); -} - //---------------------------------------------------------------------------// } // namespace @@ -237,8 +198,6 @@ OrangeParams::OrangeParams(OrangeInput&& input) "stack is limited to a depth of " << detail::LogicStack::max_stack_depth()); - apply_face_intersect_hack("ORANGE_MAX_FACE_INTERSECT", &host_data.scalars); - // Construct device values and device/host references CELER_ASSERT(host_data); data_ = CollectionMirror{std::move(host_data)}; diff --git a/src/orange/detail/UnitInserter.cc b/src/orange/detail/UnitInserter.cc index f1c0ac32c6..d1ed623630 100644 --- a/src/orange/detail/UnitInserter.cc +++ b/src/orange/detail/UnitInserter.cc @@ -8,7 +8,9 @@ #include "UnitInserter.hh" #include +#include #include +#include #include #include @@ -19,7 +21,9 @@ #include "corecel/cont/Span.hh" #include "corecel/data/Collection.hh" #include "corecel/data/Ref.hh" +#include "corecel/io/Logger.hh" #include "corecel/math/Algorithms.hh" +#include "corecel/sys/Environment.hh" #include "UniverseInserter.hh" #include "../OrangeInput.hh" @@ -159,12 +163,14 @@ std::vector