Skip to content

Commit

Permalink
Continue to allow users to non-block-restrict vars in mixed-d meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad committed Jan 23, 2024
1 parent 8d8d065 commit 1379b65
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions framework/src/variables/MooseVariableBase.C
Expand Up @@ -131,15 +131,21 @@ MooseVariableBase::MooseVariableBase(const InputParameters & parameters)
_var_name = _sys.system().variable(_var_num).name();
}

const auto & blk_ids = blockIDs();
mooseAssert(!blk_ids.empty(), "Every variable should have at least one subdomain");
_is_lower_d = _mesh.isLowerD(*blk_ids.begin());
#ifndef NDEBUG
for (auto it = ++blk_ids.begin(); it != blk_ids.end(); ++it)
mooseAssert(
_is_lower_d == _mesh.isLowerD(*it),
"A variable should not have a mix of lower-dimensional and higher-dimensional blocks");
if (!blockRestricted())
_is_lower_d = false;
else
{
const auto & blk_ids = blockIDs();
mooseAssert(!blk_ids.empty(), "Every variable should have at least one subdomain");

_is_lower_d = _mesh.isLowerD(*blk_ids.begin());
#ifdef DEBUG
for (auto it = ++blk_ids.begin(); it != blk_ids.end(); ++it)
mooseAssert(_is_lower_d == _mesh.isLowerD(*it),
"A user should not specify a mix of lower-dimensional and higher-dimensional "
"blocks for a variable");
#endif
}
}

const std::vector<dof_id_type> &
Expand Down

0 comments on commit 1379b65

Please sign in to comment.