diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index 038bcec649..04fc238967 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -282,6 +282,21 @@ Tally::Tally(pugi::xml_node node) "Invalid estimator '{}' on tally {}", est, id_)}; } } + +#ifdef LIBMESH + // ensure a tracklength tally isn't used with a libMesh filter + for (auto i : this->filters_) { + auto df = dynamic_cast(model::tally_filters[i].get()); + int32_t mesh {-1}; + if (df) { mesh = df->mesh(); } + auto lm = dynamic_cast(model::meshes[mesh].get()); + if (lm && estimator_ == TallyEstimator::TRACKLENGTH) { + fatal_error("A tracklength estimator cannot be used with " + "an unstructured LibMesh tally."); + } + } +#endif + } Tally::~Tally()