Skip to content

Commit

Permalink
Remove member variable as it's only used in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
loganharbour committed Nov 18, 2021
1 parent dc4427c commit be7ce39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions framework/include/meshgenerators/RenameBlockGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,4 @@ class RenameBlockGenerator : public MeshGenerator
std::vector<SubdomainName> _new_block;
/// The name of the parameter that specifies the old blocks
std::string _old_block_param_name;
/// The name of the parameter that specifies the new blocks
std::string _new_block_param_name;
};
9 changes: 5 additions & 4 deletions framework/src/meshgenerators/RenameBlockGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ RenameBlockGenerator::RenameBlockGenerator(const InputParameters & parameters)
_old_block_param_name = "old_block_name";
}

std::string new_block_param_name;
if (isParamValid("new_block"))
{
if (isParamValid("new_block_id"))
Expand All @@ -116,22 +117,22 @@ RenameBlockGenerator::RenameBlockGenerator(const InputParameters & parameters)
"Cannot use with 'new_block'. Use only 'new_block'; 'new_block_name' is "
"deprecated.");
_new_block = getParam<std::vector<SubdomainName>>("new_block");
_new_block_param_name = "new_block";
new_block_param_name = "new_block";
}
else if (isParamValid("new_block_id"))
{
for (const auto id : getParam<std::vector<SubdomainID>>("new_block_id"))
_new_block.push_back(std::to_string(id));
_new_block_param_name = "new_block_id";
new_block_param_name = "new_block_id";
}
else
{
_new_block = getParam<std::vector<SubdomainName>>("new_block_name");
_new_block_param_name = "new_block_name";
new_block_param_name = "new_block_name";
}

if (_old_block.size() != _new_block.size())
paramError(_new_block_param_name, "Must be the same length as '", _old_block_param_name, "'");
paramError(new_block_param_name, "Must be the same length as '", _old_block_param_name, "'");
}

std::unique_ptr<MeshBase>
Expand Down

0 comments on commit be7ce39

Please sign in to comment.