Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "PatternedHexPeripheralModifier.h" 11 : 12 : #include "MooseMeshUtils.h" 13 : 14 : registerMooseObject("ReactorApp", PatternedHexPeripheralModifier); 15 : 16 : InputParameters 17 196 : PatternedHexPeripheralModifier::validParams() 18 : { 19 196 : InputParameters params = PatternedPolygonPeripheralModifierBase::validParams(); 20 196 : return params; 21 : } 22 : 23 98 : PatternedHexPeripheralModifier::PatternedHexPeripheralModifier(const InputParameters & parameters) 24 98 : : PatternedPolygonPeripheralModifierBase(parameters) 25 : { 26 96 : _num_sides = HEXAGON_NUM_SIDES; 27 96 : declareMeshProperty<bool>("hexagon_peripheral_trimmability", false); 28 96 : declareMeshProperty<bool>("hexagon_center_trimmability", false); 29 96 : } 30 : 31 : std::unique_ptr<MeshBase> 32 96 : PatternedHexPeripheralModifier::generate() 33 : { 34 192 : if (hasMeshProperty<bool>("hexagon_center_trimmability", _input_name)) 35 184 : setMeshProperty("hexagon_center_trimmability", 36 : getMeshProperty<bool>("hexagon_center_trimmability", _input_name)); 37 : 38 : // Check if the input mesh is compatible 39 192 : if (!hasMeshProperty<bool>("peripheral_modifier_compatible", _input_name) || 40 190 : !getMeshProperty<bool>("peripheral_modifier_compatible", _input_name)) 41 2 : paramError("input", 42 : "The input mesh is generated by a mesh generator that is not compatible with " 43 : "PatternedHexPeripheralModifier."); 44 : // Whether the input mesh is hexagonal 45 188 : if (!hasMeshProperty<bool>("hexagon_center_trimmability", _input_name)) 46 2 : paramError("input", "The input mesh is not declared as center-trimmable in its metadata."); 47 : 48 92 : return PatternedPolygonPeripheralModifierBase::generate(); 49 : }