Skip to content

Commit

Permalink
Remove block insertion check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lindsayad committed Jul 20, 2021
1 parent c7fa01f commit bec76f3
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions framework/include/materials/FunctorMaterialProperty.h
Expand Up @@ -53,26 +53,16 @@ FunctorMaterialProperty<T>::setFunction(const MooseMesh & mesh,
const std::set<SubdomainID> & 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;
Expand Down

0 comments on commit bec76f3

Please sign in to comment.