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 "Component1DBoundary.h" 11 : #include "THMMesh.h" 12 : 13 : InputParameters 14 5380 : Component1DBoundary::validParams() 15 : { 16 5380 : InputParameters params = Component1DConnection::validParams(); 17 10760 : params.addRequiredParam<BoundaryName>("input", "Name of the input"); 18 5380 : return params; 19 0 : } 20 : 21 2688 : Component1DBoundary::Component1DBoundary(const InputParameters & params) 22 2688 : : Component1DConnection(params), _input(getParam<BoundaryName>("input")) 23 : { 24 2688 : addConnection(_input); 25 2688 : if (getConnections().size() > 0) 26 : { 27 : const Connection & connection = getConnections()[0]; 28 2684 : _connected_component_name = connection._component_name; 29 2684 : _connected_component_end_type = connection._end_type; 30 : } 31 2688 : } 32 : 33 : void 34 2688 : Component1DBoundary::setupMesh() 35 : { 36 2688 : Component1DConnection::setupMesh(); 37 : 38 2688 : if (_nodes.size() > 0) 39 : { 40 2682 : _elem = _elems[0]; 41 2682 : _side = _sides[0]; 42 2682 : _node = _nodes[0]; 43 2682 : _normal = _normals[0]; 44 : 45 : // create a sideset corresponding to the side of the connected component end 46 2682 : const BoundaryID boundary_id = mesh().getNextBoundaryId(); 47 2682 : auto & binfo = mesh().getMesh().get_boundary_info(); 48 2682 : binfo.add_side(_elem, _side, boundary_id); 49 2682 : binfo.sideset_name(boundary_id) = name(); 50 : } 51 2688 : } 52 : 53 : void 54 2631 : Component1DBoundary::check() const 55 : { 56 2631 : Component1DConnection::check(); 57 : 58 2631 : checkNumberOfConnections(1); 59 2631 : }