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 "SCMPinPositions.h" 11 : 12 : registerMooseObject("SubChannelApp", SCMPinPositions); 13 : 14 : InputParameters 15 10 : SCMPinPositions::validParams() 16 : { 17 10 : InputParameters params = Positions::validParams(); 18 10 : params.addClassDescription("Create positions at the pin positions in the SubChannel mesh."); 19 : 20 : // Use user-provided ordering 21 10 : params.set<bool>("auto_sort") = false; 22 : // SCM mesh only defined on process 0 23 10 : params.set<bool>("auto_broadcast") = true; 24 : 25 10 : return params; 26 0 : } 27 : 28 5 : SCMPinPositions::SCMPinPositions(const InputParameters & parameters) 29 5 : : Positions(parameters), _scm_mesh(dynamic_cast<const SubChannelMesh *>(&_fe_problem.mesh())) 30 : { 31 : // This makes this object half as useful. We should lift this 32 5 : if (!_scm_mesh) 33 0 : mooseError("Can only be used with a subchannel mesh at this time."); 34 : 35 : // Obtain the positions from the mesh 36 5 : initialize(); 37 : // Sort if needed (user-specified) 38 5 : finalize(); 39 5 : } 40 : 41 : void 42 5 : SCMPinPositions::initialize() 43 : { 44 5 : clearPositions(); 45 : // Add the pin positions 46 873 : for (const auto i_pin : make_range(_scm_mesh->getNumOfPins())) 47 868 : _positions.push_back(Point(*_scm_mesh->getPinNode(i_pin, 0))); 48 : 49 5 : _initialized = true; 50 5 : }