Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check custom blocks params #24825

Merged
merged 1 commit into from Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions framework/include/actions/SetupQuadratureAction.h
Expand Up @@ -31,7 +31,6 @@ class SetupQuadratureAction : public Action
Order _order;
Order _element_order;
Order _side_order;
const std::vector<SubdomainID> & _custom_blocks;
const std::vector<std::string> & _custom_orders;
const std::vector<std::pair<SubdomainID, MooseEnumItem>> _custom_block_orders;
const bool _allow_negative_qweights;
};
21 changes: 12 additions & 9 deletions framework/src/actions/SetupQuadratureAction.C
Expand Up @@ -22,6 +22,9 @@ SetupQuadratureAction::validParams()
"ELEVENTH TWELFTH THIRTEENTH FOURTEENTH FIFTEENTH SIXTEENTH SEVENTEENTH "
"EIGHTTEENTH NINTEENTH TWENTIETH",
"AUTO");
MultiMooseEnum orders("CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH TENTH "
"ELEVENTH TWELFTH THIRTEENTH FOURTEENTH FIFTEENTH SIXTEENTH SEVENTEENTH "
"EIGHTTEENTH NINTEENTH TWENTIETH");

InputParameters params = Action::validParams();
params.addClassDescription("Sets the quadrature type for the simulation.");
Expand All @@ -32,9 +35,10 @@ SetupQuadratureAction::validParams()
params.addParam<std::vector<SubdomainID>>("custom_blocks",
std::vector<SubdomainID>{},
"list of blocks to specify custom quadrature order");
params.addParam<std::vector<std::string>>("custom_orders",
std::vector<std::string>{},
"list of quadrature orders (e.g. FIRST, SECOND, etc.)");
params.addParam<MultiMooseEnum>(
"custom_orders",
orders,
"list of quadrature orders for the blocks specified in `custom_blocks`");
params.addParam<bool>(
"allow_negative_qweights", true, "Whether or not allow negative quadrature weights");

Expand All @@ -47,8 +51,7 @@ SetupQuadratureAction::SetupQuadratureAction(const InputParameters & parameters)
_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("order"))),
_element_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("element_order"))),
_side_order(Moose::stringToEnum<Order>(getParam<MooseEnum>("side_order"))),
_custom_blocks(getParam<std::vector<SubdomainID>>("custom_blocks")),
_custom_orders(getParam<std::vector<std::string>>("custom_orders")),
_custom_block_orders(getParam<SubdomainID, MooseEnumItem>("custom_blocks", "custom_orders")),
_allow_negative_qweights(getParam<bool>("allow_negative_qweights"))
{
}
Expand All @@ -64,11 +67,11 @@ SetupQuadratureAction::act()
_type, _order, _element_order, _side_order, Moose::ANY_BLOCK_ID, _allow_negative_qweights);

// add custom block-specific quadrature rules
for (unsigned int i = 0; i < _custom_blocks.size(); i++)
for (const auto & [block, order] : _custom_block_orders)
_problem->createQRules(_type,
_order,
Moose::stringToEnum<Order>(_custom_orders[i]),
Moose::stringToEnum<Order>(_custom_orders[i]),
_custom_blocks[i],
Moose::stringToEnum<Order>(order),
Moose::stringToEnum<Order>(order),
block,
_allow_negative_qweights);
}
54 changes: 31 additions & 23 deletions test/tests/quadrature/order/tests
@@ -1,55 +1,63 @@
[Tests]
[./order3]
[order3]
type = CSVDiff
input = 'order5.i'
csvdiff = 'order5_out.csv'

requirement = 'The system shall support the ability to manually increase'
' the quadrature order used for numerical integration on the entire mesh.'
requirement = "The system shall support the ability to manually increase the quadrature order "
"used for numerical integration on the entire mesh."
issues = '#3380'
design = 'Quadrature/index.md'
[../]
[./per-block-order]
[]
[per-block-order]
type = CSVDiff
input = 'block-order.i'
csvdiff = 'block-order_out.csv'

requirement = 'The system shall support the ability to manually specify'
' the quadrature order used for numerical integration on a per-block basis'
' with face quadrature between blocks preferring the higher-order between'
' the two sides.'
requirement = "The system shall support the ability to manually specify the quadrature order "
"used for numerical integration on a per-block basis with face quadrature between "
"blocks preferring the higher-order between the two sides."
issues = '#14055'
design = 'Quadrature/index.md'
[../]
[./code-order-bump]
[]
[per-block-order-error]
type = RunException
input = 'block-order.i'
cli_args = 'Executioner/Quadrature/custom_orders=""'
expect_err = '\(Executioner/Quadrature/custom_orders\)\(size: 0\) are of different lengths'
requirement = "The system shall ensure that for per-block specified quadrature orders exactly "
"one order is given per specified block."
issues = '#24820'
design = 'Quadrature/index.md'
[]
[code-order-bump]
type = CSVDiff
input = 'code-order-bump.i'
csvdiff = 'code-order-bump_out.csv'

requirement = 'The system shall support the ability for objects to increase quadrature order'
' in code during runtime.'
requirement = "The system shall support the ability for objects to increase quadrature order in "
"code during runtime."
issues = '#14055'
design = 'Quadrature/index.md'
[../]
[./elem5_side7]
[]
[elem5_side7]
type = CSVDiff
input = 'elem5_side7.i'
csvdiff = 'elem5_side7_out.csv'

requirement = 'The system shall support the ability to control the'
' volumetric and side quadrature orders used for'
' numerical integration on the entire mesh.'
requirement = "The system shall support the ability to control the volumetric and side "
"quadrature orders used for numerical integration on the entire mesh."
issues = '#3380'
design = 'Quadrature/index.md'
[../]
[./material-bumps-block-order]
[]
[material-bumps-block-order]
type = CSVDiff
input = 'material_with_order.i'
csvdiff = 'material_with_order_out.csv'

requirement = 'The system shall support the ability to allow object code to increase'
' the quadrature order used for numerical integration on a per-block basis.'
requirement = "The system shall support the ability to allow object code to increase the "
"quadrature order used for numerical integration on a per-block basis."
issues = '#14055 #15072'
design = 'Quadrature/index.md'
[../]
[]
[]