From bec76f305fcc6d6f12f8bb34bcf5b6ab24276633 Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Tue, 20 Jul 2021 12:36:31 -0700 Subject: [PATCH] Remove block insertion check This check was immediately triggered because we add three material objects per material in the input file, e.g. volumetric, face, and neighbor face materials. Without the check we are vulnerable to user error such as defining two materials in the input file that define the same functor property on a given block. Maybe the best remedy in the future is to have distinct `FunctorMaterials` that don't get added in triplicate because there is no functional reason for that in a system where we are evaluating material properties on the fly as opposed to having references to triplicate storage --- .../include/materials/FunctorMaterialProperty.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/framework/include/materials/FunctorMaterialProperty.h b/framework/include/materials/FunctorMaterialProperty.h index 4286ab0e3858..22fae95b5b1f 100644 --- a/framework/include/materials/FunctorMaterialProperty.h +++ b/framework/include/materials/FunctorMaterialProperty.h @@ -53,26 +53,16 @@ FunctorMaterialProperty::setFunction(const MooseMesh & mesh, const std::set & block_ids, PolymorphicLambda my_lammy) { - auto add_new_lambda = [&](const SubdomainID lm_block_id) { - auto pr = _elem_functor.emplace(lm_block_id, ElemFn(my_lammy)); - if (!pr.second) - mooseError("No insertion in the functor material property ", - _name, - " for block id ", - lm_block_id, - ". Another material must already provide this material property on that block."); - }; - for (const auto block_id : block_ids) { if (block_id == Moose::ANY_BLOCK_ID) { const auto & inner_block_ids = mesh.meshSubdomains(); for (const auto inner_block_id : inner_block_ids) - add_new_lambda(inner_block_id); + _elem_functor.emplace(inner_block_id, my_lammy); } else - add_new_lambda(block_id); + _elem_functor.emplace(block_id, my_lammy); } return *this;