Skip to content

Commit

Permalink
Merge pull request idaholab#23476 from miaoyinb/ExplicitErrorMsg
Browse files Browse the repository at this point in the history
Detailed error messages in Reactor Module
  • Loading branch information
GiudGiud committed Feb 18, 2023
2 parents 25c8d6e + 5c44f7e commit 644c614
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
3 changes: 2 additions & 1 deletion modules/reactor/src/meshgenerators/CartesianMeshTrimmer.C
Expand Up @@ -81,7 +81,8 @@ CartesianMeshTrimmer::generate()
}
else
paramError("input",
"The input mesh's meta data is not compatible with the CartesianMeshTrimmer.");
"The input mesh's meta data is not compatible with the CartesianMeshTrimmer because "
"the trimmability mesh meta data are absent.");

return PolygonMeshTrimmerBase::generate();
}
4 changes: 3 additions & 1 deletion modules/reactor/src/meshgenerators/HexagonMeshTrimmer.C
Expand Up @@ -81,7 +81,9 @@ HexagonMeshTrimmer::generate()
paramError("input", "The input mesh cannot be trimmed through its center.");
}
else
paramError("input", "The input mesh is not compatible with HexagonMeshTrimmer.");
paramError("input",
"The input mesh is not compatible with HexagonMeshTrimmer because "
"the trimmability mesh meta data are absent.");

return PolygonMeshTrimmerBase::generate();
}
Expand Up @@ -265,14 +265,18 @@ PatternedCartesianMeshGenerator::generate()
mooseError("In PatternedCartesianMeshGenerator ",
_name,
": the unit square input mesh does not contain appropriate meta data "
"required for generating a core mesh.");
"required for generating a core mesh. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pattern_pitch_meta' is missing.");
pattern_pitch_array.push_back(getMeshProperty<Real>("pattern_pitch_meta", _input_names[i]));
// throw an error message if the input mesh contains non-sense meta data
if (pattern_pitch_array.back() == 0.0)
mooseError("In PatternedCartesianMeshGenerator ",
_name,
": the unit square input mesh does not contain appropriate meta data "
"required for generating a core mesh.");
"required for generating a core mesh. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pattern_pitch_meta' is zero.");
is_control_drum_array.push_back(
getMeshProperty<bool>("is_control_drum_meta", _input_names[i]));
control_drum_azimuthal_array.push_back(
Expand Down Expand Up @@ -310,7 +314,9 @@ PatternedCartesianMeshGenerator::generate()
mooseError("In PatternedCartesianMeshGenerator ",
_name,
": the unit square input mesh does not contain appropriate meta data "
"required for generating an assembly.");
"required for generating an assembly. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pitch_meta' is missing");
pitch_array.push_back(getMeshProperty<Real>("pitch_meta", _input_names[i]));

num_sectors_per_side_array_tmp =
Expand Down
12 changes: 9 additions & 3 deletions modules/reactor/src/meshgenerators/PatternedHexMeshGenerator.C
Expand Up @@ -272,14 +272,18 @@ PatternedHexMeshGenerator::generate()
mooseError("In PatternedHexMeshGenerator ",
_name,
": the unit hexagonal input mesh does not contain appropriate meta data "
"required for generating a core mesh.");
"required for generating a core mesh. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pattern_pitch_meta' is missing.");
pattern_pitch_array.push_back(getMeshProperty<Real>("pattern_pitch_meta", _input_names[i]));
// throw an error message if the input mesh contains non-sense meta data
if (pattern_pitch_array.back() == 0.0)
mooseError("In PatternedHexMeshGenerator ",
_name,
": the unit hexagonal input mesh does not contain appropriate meta data "
"required for generating a core mesh.");
"required for generating a core mesh. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pattern_pitch_meta' is zero.");
is_control_drum_array.push_back(
getMeshProperty<bool>("is_control_drum_meta", _input_names[i]));
control_drum_azimuthal_array.push_back(
Expand Down Expand Up @@ -319,7 +323,9 @@ PatternedHexMeshGenerator::generate()
mooseError("In PatternedHexMeshGenerator ",
_name,
": the unit hexagonal input mesh does not contain appropriate meta data "
"required for generating an assembly.");
"required for generating an assembly. Involved input mesh: ",
_input_names[i],
"; metadata issue: 'pitch_meta' is missing");
pitch_array.push_back(getMeshProperty<Real>("pitch_meta", _input_names[i]));

num_sectors_per_side_array_tmp =
Expand Down
Expand Up @@ -409,12 +409,19 @@ PolygonConcentricCircleMeshGeneratorBase::PolygonConcentricCircleMeshGeneratorBa
if (!_ring_block_ids.empty() &&
_ring_block_ids.size() !=
(_ring_intervals.size() + (unsigned int)(_ring_intervals.front() != 1)))
paramError("ring_block_ids",
"This parameter must have the appropriate size if it is provided.");
paramError(
"ring_block_ids",
"This parameter must have the appropriate size if it is provided. The size should be the "
"same as the size of 'ring_intervals' if the innermost ring interval is unity; otherwise "
"the size should be greater than the size of 'ring_intervals' by one.");
if (!_ring_block_names.empty() &&
_ring_block_names.size() !=
(_ring_intervals.size() + (unsigned int)(_ring_intervals.front() != 1)))
paramError("ring_block_names", "This parameter must have the appropriate size if it is set.");
paramError(
"ring_block_names",
"This parameter must have the appropriate size if it is set. The size should be the "
"same as the size of 'ring_intervals' if the innermost ring interval is unity; otherwise "
"the size should be greater than the size of 'ring_intervals' by one.");
for (unsigned int i = 1; i < _ring_intervals.size(); i++)
if (_ring_radii[i] <= _ring_radii[i - 1])
paramError("ring_radii", "This parameter must be strictly ascending.");
Expand Down

0 comments on commit 644c614

Please sign in to comment.