forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for ANY_BLOCK_ID in MooseMeshUtils::getSubdomainId
refs idaholab#17710
- Loading branch information
1 parent
19c7564
commit a970a0a
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "GeneralUserObject.h" | ||
|
||
class MooseMeshUtilsTest : public GeneralUserObject | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
MooseMeshUtilsTest(const InputParameters & parameters); | ||
|
||
virtual void execute() override{}; | ||
virtual void initialize() override{}; | ||
virtual void finalize() override{}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "MooseMeshUtilsTest.h" | ||
#include "MooseMeshUtils.h" | ||
|
||
registerMooseObject("MooseTestApp", MooseMeshUtilsTest); | ||
|
||
InputParameters | ||
MooseMeshUtilsTest::validParams() | ||
{ | ||
auto params = GeneralUserObject::validParams(); | ||
|
||
params.addParam<bool>( | ||
"get_subdomain_id_any", false, "Tests the error for getSubdomainID with ANY_BLOCK_ID"); | ||
|
||
return params; | ||
} | ||
|
||
MooseMeshUtilsTest::MooseMeshUtilsTest(const InputParameters & parameters) | ||
: GeneralUserObject(parameters) | ||
{ | ||
if (getParam<bool>("get_subdomain_id_any")) | ||
MooseMeshUtils::getSubdomainID("ANY_BLOCK_ID", _fe_problem.mesh().getMesh()); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Mesh] | ||
[gmg] | ||
type = GeneratedMeshGenerator | ||
dim = 1 | ||
[] | ||
[] | ||
|
||
[UserObjects/test] | ||
type = MooseMeshUtilsTest | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Tests] | ||
design = 'MooseMesh.md' | ||
issues = '#17710' | ||
|
||
[get_subdomain_id_any] | ||
type = RunException | ||
input = 'moose_mesh_utils.i' | ||
cli_args = 'UserObjects/test/get_subdomain_id_any=true' | ||
requirement = 'The mesh system shall report a reasonable error when using a subdomain name that is reserved for internal use' | ||
expect_err = 'getSubdomainID\(\) does not work with "ANY_BLOCK_ID"' | ||
[] | ||
[] |