diff --git a/framework/include/problems/FEProblemBase.h b/framework/include/problems/FEProblemBase.h index cd6856dbc464..2a837c289d07 100644 --- a/framework/include/problems/FEProblemBase.h +++ b/framework/include/problems/FEProblemBase.h @@ -153,6 +153,16 @@ class FEProblemBase : public SubProblem, public Restartable FEProblemBase(const InputParameters & parameters); virtual ~FEProblemBase(); + enum class CoverageCheckMode + { + FALSE, + TRUE, + OFF, + ON, + SKIP_LIST, + ONLY_LIST, + }; + virtual EquationSystems & es() override { return _req.set().es(); } virtual MooseMesh & mesh() override { return _mesh; } virtual const MooseMesh & mesh() const override { return _mesh; } @@ -1735,7 +1745,16 @@ class FEProblemBase : public SubProblem, public Restartable * Set flag to indicate whether kernel coverage checks should be performed. This check makes * sure that at least one kernel is active on all subdomains in the domain (default: true). */ - void setKernelCoverageCheck(bool flag) { _kernel_coverage_check = flag; } + void setKernelCoverageCheck(CoverageCheckMode mode) { _kernel_coverage_check = mode; } + + /** + * Set flag to indicate whether kernel coverage checks should be performed. This check makes + * sure that at least one kernel is active on all subdomains in the domain (default: true). + */ + void setKernelCoverageCheck(bool flag) + { + _kernel_coverage_check = flag ? CoverageCheckMode::TRUE : CoverageCheckMode::FALSE; + } /** * Set flag to indicate whether material coverage checks should be performed. This check makes @@ -1743,7 +1762,18 @@ class FEProblemBase : public SubProblem, public Restartable * supplied. If no materials are supplied anywhere, a simulation is still considered OK as long as * no properties are being requested anywhere. */ - void setMaterialCoverageCheck(bool flag) { _material_coverage_check = flag; } + void setMaterialCoverageCheck(CoverageCheckMode mode) { _material_coverage_check = mode; } + + /** + * Set flag to indicate whether material coverage checks should be performed. This check makes + * sure that at least one material is active on all subdomains in the domain if any material is + * supplied. If no materials are supplied anywhere, a simulation is still considered OK as long as + * no properties are being requested anywhere. + */ + void setMaterialCoverageCheck(bool flag) + { + _material_coverage_check = flag ? CoverageCheckMode::TRUE : CoverageCheckMode::FALSE; + } /** * Toggle parallel barrier messaging (defaults to on). @@ -2640,8 +2670,9 @@ class FEProblemBase : public SubProblem, public Restartable SolverParams _solver_params; - /// Determines whether a check to verify an active kernel on every subdomain - bool _kernel_coverage_check; + /// Determines whether and which subdomains are to be checked to ensure that they have an active kernel + CoverageCheckMode _kernel_coverage_check; + std::vector _kernel_coverage_blocks; /// whether to perform checking of boundary restricted nodal object variable dependencies, /// e.g. whether the variable dependencies are defined on the selected boundaries @@ -2651,8 +2682,9 @@ class FEProblemBase : public SubProblem, public Restartable /// e.g. whether the variable dependencies are defined on the selected boundaries const bool _boundary_restricted_elem_integrity_check; - /// Determines whether a check to verify an active material on every subdomain - bool _material_coverage_check; + /// Determines whether and which subdomains are to be checked to ensure that they have an active material + CoverageCheckMode _material_coverage_check; + std::vector _material_coverage_blocks; /// Whether to check overlapping Dirichlet and Flux BCs and/or multiple DirichletBCs per sideset bool _fv_bcs_integrity_check; diff --git a/framework/src/problems/ExternalProblem.C b/framework/src/problems/ExternalProblem.C index e20990bba0bb..92ea54838e7a 100644 --- a/framework/src/problems/ExternalProblem.C +++ b/framework/src/problems/ExternalProblem.C @@ -20,7 +20,7 @@ ExternalProblem::validParams() // there is no nonlinear system (we set it as empty in the constructor) params.suppressParameter("ignore_zeros_in_jacobian"); - params.suppressParameter("kernel_coverage_check"); + params.suppressParameter("kernel_coverage_check"); params.suppressParameter>("nl_sys_names"); params.suppressParameter("previous_nl_solution_required"); params.suppressParameter("skip_nl_system_check"); diff --git a/framework/src/problems/FEProblemBase.C b/framework/src/problems/FEProblemBase.C index 73b34f440eba..4ceb16baef14 100644 --- a/framework/src/problems/FEProblemBase.C +++ b/framework/src/problems/FEProblemBase.C @@ -205,8 +205,29 @@ FEProblemBase::validParams() rz_coord_axis, "The rotation axis (X | Y) for axisymetric coordinates", "Please use 'Mesh/rz_coord_axis' instead"); - params.addParam( - "kernel_coverage_check", true, "Set to false to disable kernel->subdomain coverage check"); + auto coverage_check_description = [](std::string scope, std::string list_param_name) + { + return "Controls, if and how a " + scope + + " subdomain coverage check is performed. " + "With 'TRUE' or 'ON' all subdomains are checked (the default). Setting 'FALSE' or 'OFF' " + "will disable the check for all subdomains. " + "To exclude a predefined set of subdomains 'SKIP_LIST' is to " + "be used, while the subdomains to skip are to be defined in the parameter '" + + list_param_name + + "'. To limit the check to a list of subdomains, 'ONLY_LIST' is to " + "be used (again, using the parameter '" + + list_param_name + "')."; + }; + MooseEnum kernel_coverage_check_modes("FALSE TRUE OFF ON SKIP_LIST ONLY_LIST", "TRUE"); + params.addParam("kernel_coverage_check", + kernel_coverage_check_modes, + coverage_check_description("kernel", "kernel_coverage_block_list")); + params.addParam>( + "kernel_coverage_block_list", + {}, + "List of subdomains for kernel coverage check. The meaning of this list is controlled by the " + "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, " + "not to be checked or not taken into account)."); params.addParam( "boundary_restricted_node_integrity_check", true, @@ -217,9 +238,18 @@ FEProblemBase::validParams() "Set to false to disable checking of boundary restricted elemental object " "variable dependencies, e.g. are the variable dependencies defined on the " "selected boundaries?"); - params.addParam("material_coverage_check", - true, - "Set to false to disable material->subdomain coverage check"); + MooseEnum material_coverage_check_modes("FALSE TRUE OFF ON SKIP_LIST ONLY_LIST", "TRUE"); + params.addParam( + "material_coverage_check", + material_coverage_check_modes, + coverage_check_description("material", "material_coverage_block_list")); + params.addParam>( + "material_coverage_block_list", + {}, + "List of subdomains for material coverage check. The meaning of this list is controlled by " + "the " + "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, " + "not to be checked or not taken into account)."); params.addParam("fv_bcs_integrity_check", true, "Set to false to disable checking of overlapping Dirichlet and Flux BCs " @@ -309,8 +339,10 @@ FEProblemBase::validParams() "specific handling, immediately error instead of allowing the time step to be cut"); params.addParamNamesToGroup( - "skip_nl_system_check kernel_coverage_check boundary_restricted_node_integrity_check " - "boundary_restricted_elem_integrity_check material_coverage_check fv_bcs_integrity_check " + "skip_nl_system_check kernel_coverage_check kernel_coverage_block_list " + "boundary_restricted_node_integrity_check " + "boundary_restricted_elem_integrity_check material_coverage_check " + "material_coverage_block_list fv_bcs_integrity_check " "material_dependency_check check_uo_aux_state error_on_jacobian_nonzero_reallocation", "Simulation checks"); params.addParamNamesToGroup("use_nonlinear previous_nl_solution_required nl_sys_names " @@ -397,12 +429,16 @@ FEProblemBase::FEProblemBase(const InputParameters & parameters) _needs_old_newton_iter(false), _has_nonlocal_coupling(false), _calculate_jacobian_in_uo(false), - _kernel_coverage_check(getParam("kernel_coverage_check")), + _kernel_coverage_check( + getParam("kernel_coverage_check").getEnum()), + _kernel_coverage_blocks(getParam>("kernel_coverage_block_list")), _boundary_restricted_node_integrity_check( getParam("boundary_restricted_node_integrity_check")), _boundary_restricted_elem_integrity_check( getParam("boundary_restricted_elem_integrity_check")), - _material_coverage_check(getParam("material_coverage_check")), + _material_coverage_check( + getParam("material_coverage_check").getEnum()), + _material_coverage_blocks(getParam>("material_coverage_block_list")), _fv_bcs_integrity_check(getParam("fv_bcs_integrity_check")), _material_dependency_check(getParam("material_dependency_check")), _uo_aux_state_check(getParam("check_uo_aux_state")), @@ -7760,9 +7796,38 @@ FEProblemBase::checkProblemIntegrity() const std::set & mesh_subdomains = _mesh.meshSubdomains(); // Check kernel coverage of subdomains (blocks) in the mesh - if (!_skip_nl_system_check && _solve && _kernel_coverage_check) - for (auto & nl : _nl) - nl->checkKernelCoverage(mesh_subdomains); + if (!_skip_nl_system_check && _solve && _kernel_coverage_check != CoverageCheckMode::FALSE && + _kernel_coverage_check != CoverageCheckMode::OFF) + { + std::set blocks; + if (_kernel_coverage_check == CoverageCheckMode::TRUE || + _kernel_coverage_check == CoverageCheckMode::ON) + blocks = mesh_subdomains; + else if (_kernel_coverage_check == CoverageCheckMode::SKIP_LIST) + { + blocks = mesh_subdomains; + for (const auto & subdomain_name : _kernel_coverage_blocks) + { + const auto id = _mesh.getSubdomainID(subdomain_name); + if (id == Moose::INVALID_BLOCK_ID) + paramError("kernel_coverage_block_list", + "Subdomain \"" + subdomain_name + "\" not found in mesh."); + blocks.erase(id); + } + } + else if (_kernel_coverage_check == CoverageCheckMode::ONLY_LIST) + for (const auto & subdomain_name : _kernel_coverage_blocks) + { + const auto id = _mesh.getSubdomainID(subdomain_name); + if (id == Moose::INVALID_BLOCK_ID) + paramError("kernel_coverage_block_list", + "Subdomain \"" + subdomain_name + "\" not found in mesh."); + blocks.insert(id); + } + if (!blocks.empty()) + for (auto & nl : _nl) + nl->checkKernelCoverage(blocks); + } // Check materials { @@ -7778,7 +7843,8 @@ FEProblemBase::checkProblemIntegrity() std::set local_mesh_subs(mesh_subdomains); - if (_material_coverage_check) + if (_material_coverage_check != CoverageCheckMode::FALSE && + _material_coverage_check != CoverageCheckMode::OFF) { /** * If a material is specified for any block in the simulation, then all blocks must @@ -7792,6 +7858,33 @@ FEProblemBase::checkProblemIntegrity() check_material_coverage = true; } + // did the user limit the subdomains to be checked? + if (_material_coverage_check == CoverageCheckMode::SKIP_LIST) + { + for (const auto & subdomain_name : _material_coverage_blocks) + { + const auto id = _mesh.getSubdomainID(subdomain_name); + if (id == Moose::INVALID_BLOCK_ID) + paramError("material_coverage_block_list", + "Subdomain \"" + subdomain_name + "\" not found in mesh."); + local_mesh_subs.erase(id); + } + } + else if (_material_coverage_check == CoverageCheckMode::ONLY_LIST) + { + std::set blocks(local_mesh_subs); + for (const auto & subdomain_name : _material_coverage_blocks) + { + const auto id = _mesh.getSubdomainID(subdomain_name); + if (id == Moose::INVALID_BLOCK_ID) + paramError("material_coverage_block_list", + "Subdomain \"" + subdomain_name + "\" not found in mesh."); + blocks.erase(id); + } + for (const auto id : blocks) + local_mesh_subs.erase(id); + } + // also exclude mortar spaces from the material check auto && mortar_subdomain_ids = _mortar_data.getMortarSubdomainIDs(); for (auto subdomain_id : mortar_subdomain_ids) diff --git a/modules/fluid_properties/src/actions/AddFluidPropertiesInterrogatorAction.C b/modules/fluid_properties/src/actions/AddFluidPropertiesInterrogatorAction.C index 5fd7acecfa74..4048f40b5b41 100644 --- a/modules/fluid_properties/src/actions/AddFluidPropertiesInterrogatorAction.C +++ b/modules/fluid_properties/src/actions/AddFluidPropertiesInterrogatorAction.C @@ -87,7 +87,7 @@ AddFluidPropertiesInterrogatorAction::act() params.set("use_nonlinear") = true; params.set("solve") = false; _problem = _factory.create(class_name, "Problem", params); - _problem->setKernelCoverageCheck(false); + _problem->setKernelCoverageCheck(FEProblemBase::CoverageCheckMode::FALSE); } // Add the fluid properties interrogator user object else if (_current_task == "add_user_object") diff --git a/modules/geochemistry/src/actions/AddGeochemicalModelInterrogatorAction.C b/modules/geochemistry/src/actions/AddGeochemicalModelInterrogatorAction.C index 722feccec1be..a3ccf2135d93 100644 --- a/modules/geochemistry/src/actions/AddGeochemicalModelInterrogatorAction.C +++ b/modules/geochemistry/src/actions/AddGeochemicalModelInterrogatorAction.C @@ -59,7 +59,7 @@ AddGeochemicalModelInterrogatorAction::act() params.set("use_nonlinear") = true; params.set("solve") = false; _problem = _factory.create(class_name, "Problem", params); - _problem->setKernelCoverageCheck(false); + _problem->setKernelCoverageCheck(FEProblemBase::CoverageCheckMode::FALSE); } // Set up an arbitrary steady executioner else if (_current_task == "setup_executioner") diff --git a/modules/geochemistry/src/actions/AddSpatialReactionSolverAction.C b/modules/geochemistry/src/actions/AddSpatialReactionSolverAction.C index 497fb3e9a36b..aa2229409df9 100644 --- a/modules/geochemistry/src/actions/AddSpatialReactionSolverAction.C +++ b/modules/geochemistry/src/actions/AddSpatialReactionSolverAction.C @@ -52,7 +52,9 @@ AddSpatialReactionSolverAction::act() params.set("use_nonlinear") = true; params.set("solve") = getParam("include_moose_solve"); _problem = _factory.create(class_name, "Problem", params); - _problem->setKernelCoverageCheck(getParam("include_moose_solve")); + _problem->setKernelCoverageCheck(getParam("include_moose_solve") + ? FEProblemBase::CoverageCheckMode::TRUE + : FEProblemBase::CoverageCheckMode::FALSE); } else if (_current_task == "add_geochemistry_reactor") { diff --git a/modules/geochemistry/src/actions/AddTimeDependentReactionSolverAction.C b/modules/geochemistry/src/actions/AddTimeDependentReactionSolverAction.C index b0f4c8e58693..16aa4064738e 100644 --- a/modules/geochemistry/src/actions/AddTimeDependentReactionSolverAction.C +++ b/modules/geochemistry/src/actions/AddTimeDependentReactionSolverAction.C @@ -70,7 +70,9 @@ AddTimeDependentReactionSolverAction::act() params.set("use_nonlinear") = true; params.set("solve") = getParam("include_moose_solve"); _problem = _factory.create(class_name, "Problem", params); - _problem->setKernelCoverageCheck(getParam("include_moose_solve")); + _problem->setKernelCoverageCheck(getParam("include_moose_solve") + ? FEProblemBase::CoverageCheckMode::TRUE + : FEProblemBase::CoverageCheckMode::FALSE); } else if (_current_task == "add_geochemistry_reactor") { diff --git a/modules/geochemistry/src/actions/AddTimeIndependentReactionSolverAction.C b/modules/geochemistry/src/actions/AddTimeIndependentReactionSolverAction.C index 223870385a9f..e056ed948b04 100644 --- a/modules/geochemistry/src/actions/AddTimeIndependentReactionSolverAction.C +++ b/modules/geochemistry/src/actions/AddTimeIndependentReactionSolverAction.C @@ -73,7 +73,9 @@ AddTimeIndependentReactionSolverAction::act() params.set("use_nonlinear") = true; params.set("solve") = getParam("include_moose_solve"); _problem = _factory.create(class_name, "Problem", params); - _problem->setKernelCoverageCheck(getParam("include_moose_solve")); + _problem->setKernelCoverageCheck(getParam("include_moose_solve") + ? FEProblemBase::CoverageCheckMode::TRUE + : FEProblemBase::CoverageCheckMode::FALSE); } // Set up an arbitrary steady executioner else if (_current_task == "setup_executioner") diff --git a/modules/navier_stokes/src/hdgkernels/NavierStokesHDGKernel.C b/modules/navier_stokes/src/hdgkernels/NavierStokesHDGKernel.C index fe1b47a3b244..b64ec93d751e 100644 --- a/modules/navier_stokes/src/hdgkernels/NavierStokesHDGKernel.C +++ b/modules/navier_stokes/src/hdgkernels/NavierStokesHDGKernel.C @@ -45,7 +45,7 @@ NavierStokesHDGKernel::NavierStokesHDGKernel(const InputParameters & parameters) _pressure_mms_forcing_function(getFunctor("pressure_mms_forcing_function")) { // This class handles residuals and Jacobians for multiple variables - _fe_problem.setKernelCoverageCheck(false); + _fe_problem.setKernelCoverageCheck(FEProblemBase::CoverageCheckMode::FALSE); _body_forces.push_back(&_body_force_x); _body_forces.push_back(&_body_force_y); diff --git a/modules/optimization/src/actions/OptimizationAction.C b/modules/optimization/src/actions/OptimizationAction.C index bdedd4bbb415..3bf89f573eec 100644 --- a/modules/optimization/src/actions/OptimizationAction.C +++ b/modules/optimization/src/actions/OptimizationAction.C @@ -79,7 +79,7 @@ OptimizationAction::act() // Set the object parameters InputParameters & params = action->getObjectParams(); - params.set("kernel_coverage_check") = false; + params.set("kernel_coverage_check") = "false"; params.set("skip_nl_system_check") = true; // Add Action to the warehouse diff --git a/modules/stochastic_tools/src/actions/StochasticToolsAction.C b/modules/stochastic_tools/src/actions/StochasticToolsAction.C index 896a3984101d..9dfd4cc6536a 100644 --- a/modules/stochastic_tools/src/actions/StochasticToolsAction.C +++ b/modules/stochastic_tools/src/actions/StochasticToolsAction.C @@ -84,7 +84,7 @@ StochasticToolsAction::act() params.set("solve") = false; if (!params.isParamSetByUser("kernel_coverage_check")) - params.set("kernel_coverage_check") = false; + params.set("kernel_coverage_check") = "false"; if (!params.isParamSetByUser("skip_nl_system_check")) params.set("skip_nl_system_check") = true; @@ -106,7 +106,7 @@ StochasticToolsAction::act() // Set the object parameters InputParameters & params = action->getObjectParams(); params.set("solve") = false; - params.set("kernel_coverage_check") = false; + params.set("kernel_coverage_check") = "false"; params.set("skip_nl_system_check") = true; // Add Action to the warehouse diff --git a/modules/thermal_hydraulics/test/src/actions/TestAction.C b/modules/thermal_hydraulics/test/src/actions/TestAction.C index b4b87b9f9a3a..76a8b7d36e52 100644 --- a/modules/thermal_hydraulics/test/src/actions/TestAction.C +++ b/modules/thermal_hydraulics/test/src/actions/TestAction.C @@ -89,7 +89,7 @@ TestAction::act() std::shared_ptr action = std::static_pointer_cast( _action_factory.create(class_name, "fe_problem", action_params)); - action->getObjectParams().set("kernel_coverage_check") = false; + action->getObjectParams().set("kernel_coverage_check") = "false"; _awh.addActionBlock(action); } } diff --git a/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_only_list_out.e b/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_only_list_out.e new file mode 100644 index 000000000000..763e22b85a10 Binary files /dev/null and b/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_only_list_out.e differ diff --git a/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_skip_list_out.e b/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_skip_list_out.e new file mode 100644 index 000000000000..56bbc4e50474 Binary files /dev/null and b/test/tests/problems/no_kernel_coverage_check/gold/kernel_coverage_skip_list_out.e differ diff --git a/test/tests/problems/no_kernel_coverage_check/kernel_coverage_only_list.i b/test/tests/problems/no_kernel_coverage_check/kernel_coverage_only_list.i new file mode 100644 index 000000000000..f3d8ae67b5c2 --- /dev/null +++ b/test/tests/problems/no_kernel_coverage_check/kernel_coverage_only_list.i @@ -0,0 +1,63 @@ +[Problem] + solve = true # coverage check needs solve to be true + + kernel_coverage_check = 'only_list' + kernel_coverage_block_list = 'BaseMesh' + + material_coverage_check = false +[] + +[Mesh] + [generate] + type = GeneratedMeshGenerator + subdomain_name = 'BaseMesh' + dim = 2 + nx = 10 + ny = 10 + [] + add_subdomain_names = 'empty_subdomain' +[] + +[Variables] + [u] + [] +[] + +[Kernels] + [diff] + type = Diffusion + variable = u + block = 'BaseMesh' + [] + [diff2] + type = MatDiffusion + diffusivity = 1e-4 + variable = u + block = 'BaseMesh' + [] +[] + +[BCs] + [left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [] + [right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [] +[] + +[Executioner] + type = Steady + petsc_options_iname = '-pc_type -pc_hypre_type' + petsc_options_value = 'hypre boomeramg' +[] + +[Outputs] + exodus = true +[] diff --git a/test/tests/problems/no_kernel_coverage_check/kernel_coverage_skip_list.i b/test/tests/problems/no_kernel_coverage_check/kernel_coverage_skip_list.i new file mode 100644 index 000000000000..49103264e825 --- /dev/null +++ b/test/tests/problems/no_kernel_coverage_check/kernel_coverage_skip_list.i @@ -0,0 +1,63 @@ +[Problem] + solve = true # coverage check needs solve to be true + + kernel_coverage_check = 'skip_list' + kernel_coverage_block_list = 'empty_subdomain' + + material_coverage_check = false +[] + +[Mesh] + [generate] + type = GeneratedMeshGenerator + subdomain_name = 'BaseMesh' + dim = 2 + nx = 10 + ny = 10 + [] + add_subdomain_names = 'empty_subdomain' +[] + +[Variables] + [u] + [] +[] + +[Kernels] + [diff] + type = Diffusion + variable = u + block = 'BaseMesh' + [] + [diff2] + type = MatDiffusion + diffusivity = 1e-4 + variable = u + block = 'BaseMesh' + [] +[] + +[BCs] + [left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [] + [right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [] +[] + +[Executioner] + type = Steady + petsc_options_iname = '-pc_type -pc_hypre_type' + petsc_options_value = 'hypre boomeramg' +[] + +[Outputs] + exodus = true +[] diff --git a/test/tests/problems/no_kernel_coverage_check/tests b/test/tests/problems/no_kernel_coverage_check/tests index 0699fe6db4b0..55e56352d61e 100644 --- a/test/tests/problems/no_kernel_coverage_check/tests +++ b/test/tests/problems/no_kernel_coverage_check/tests @@ -1,12 +1,29 @@ [Tests] - [./test] + [no_coverage_check] type = 'Exodiff' input = 'no_coverage_check.i' exodiff = 'no_coverage_check_out.e' - requirement = 'The system shall support the ability to disable the check for' ' PDE operators in all or some parts of the domain.' issues = '#2291' design = 'Problem/index.md' - [../] + [] + [kernel_coverage_only_list] + type = 'Exodiff' + input = 'kernel_coverage_only_list.i' + exodiff = 'kernel_coverage_only_list_out.e' + requirement = 'The system shall support the ability to disable the check for' + ' active kernels in some parts of the domain.' + issues = '#28117' + design = 'Problem/index.md' + [] + [kernel_coverage_skip_list] + type = 'Exodiff' + input = 'kernel_coverage_skip_list.i' + exodiff = 'kernel_coverage_skip_list_out.e' + requirement = 'The system shall support the ability to disable the check for' + ' active kernels in some parts of the domain.' + issues = '#28117' + design = 'Problem/index.md' + [] [] diff --git a/test/tests/problems/no_material_coverage_check/gold/material_coverage_only_list_out.e b/test/tests/problems/no_material_coverage_check/gold/material_coverage_only_list_out.e new file mode 100644 index 000000000000..01b3f8a81435 Binary files /dev/null and b/test/tests/problems/no_material_coverage_check/gold/material_coverage_only_list_out.e differ diff --git a/test/tests/problems/no_material_coverage_check/gold/material_coverage_skip_list_out.e b/test/tests/problems/no_material_coverage_check/gold/material_coverage_skip_list_out.e new file mode 100644 index 000000000000..4dc0fa001a67 Binary files /dev/null and b/test/tests/problems/no_material_coverage_check/gold/material_coverage_skip_list_out.e differ diff --git a/test/tests/problems/no_material_coverage_check/material_coverage_only_list.i b/test/tests/problems/no_material_coverage_check/material_coverage_only_list.i new file mode 100644 index 000000000000..b8fa10166639 --- /dev/null +++ b/test/tests/problems/no_material_coverage_check/material_coverage_only_list.i @@ -0,0 +1,67 @@ +[Problem] + solve = true # coverage check needs solve to be true + + kernel_coverage_check = false + + material_coverage_check = 'only_list' + material_coverage_block_list = 'BaseMesh' +[] + +[Mesh] + [generate] + type = GeneratedMeshGenerator + subdomain_name = 'BaseMesh' + dim = 2 + nx = 10 + ny = 10 + [] + add_subdomain_names = 'empty_subdomain' +[] + +[Variables] + [u] + block = 'BaseMesh' + [] +[] + +[Kernels] + [diff] + type = Diffusion + variable = u + block = 'BaseMesh' + [] +[] + +[BCs] + [left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [] + [right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [] +[] + +[Materials] + [diff] + type = GenericConstantMaterial + prop_names = 'rxn_coeff' + prop_values = '-2' + block = 'BaseMesh' + [] +[] + +[Executioner] + type = Steady + petsc_options_iname = '-pc_type -pc_hypre_type' + petsc_options_value = 'hypre boomeramg' +[] + +[Outputs] + exodus = true +[] diff --git a/test/tests/problems/no_material_coverage_check/material_coverage_skip_list.i b/test/tests/problems/no_material_coverage_check/material_coverage_skip_list.i new file mode 100644 index 000000000000..04af314233e4 --- /dev/null +++ b/test/tests/problems/no_material_coverage_check/material_coverage_skip_list.i @@ -0,0 +1,67 @@ +[Problem] + solve = true # coverage check needs solve to be true + + kernel_coverage_check = false + + material_coverage_check = 'skip_list' + material_coverage_block_list = 'empty_subdomain' +[] + +[Mesh] + [generate] + type = GeneratedMeshGenerator + subdomain_name = 'BaseMesh' + dim = 2 + nx = 10 + ny = 10 + [] + add_subdomain_names = 'empty_subdomain' +[] + +[Variables] + [u] + block = 'BaseMesh' + [] +[] + +[Kernels] + [diff] + type = Diffusion + variable = u + block = 'BaseMesh' + [] +[] + +[BCs] + [left] + type = DirichletBC + variable = u + boundary = left + value = 0 + [] + [right] + type = DirichletBC + variable = u + boundary = right + value = 1 + [] +[] + +[Materials] + [diff] + type = GenericConstantMaterial + prop_names = 'rxn_coeff' + prop_values = '-2' + block = 'BaseMesh' + [] +[] + +[Executioner] + type = Steady + petsc_options_iname = '-pc_type -pc_hypre_type' + petsc_options_value = 'hypre boomeramg' +[] + +[Outputs] + exodus = true +[] diff --git a/test/tests/problems/no_material_coverage_check/tests b/test/tests/problems/no_material_coverage_check/tests index 1b1cb716b1d5..77a0aa3726a2 100644 --- a/test/tests/problems/no_material_coverage_check/tests +++ b/test/tests/problems/no_material_coverage_check/tests @@ -1,12 +1,29 @@ [Tests] - [./test] + [no_material_coverage_check] type = 'Exodiff' input = 'no_material_coverage_check.i' exodiff = 'no_material_coverage_check_out.e' - requirement = 'The system shall support the ability to disable the check for' ' active materials in all parts of the domain.' issues = '#5306' design = 'Problem/index.md' - [../] + [] + [material_coverage_only_list] + type = 'Exodiff' + input = 'material_coverage_only_list.i' + exodiff = 'material_coverage_only_list_out.e' + requirement = 'The system shall support the ability to enable the check for' + ' active materials only in some parts of the domain.' + issues = '#28117' + design = 'Problem/index.md' + [] + [material_coverage_skip_list] + type = 'Exodiff' + input = 'material_coverage_skip_list.i' + exodiff = 'material_coverage_skip_list_out.e' + requirement = 'The system shall support the ability to disable the check for' + ' active materials in some parts of the domain.' + issues = '#28117' + design = 'Problem/index.md' + [] []