LCOV - code coverage report
Current view: top level - src/components - Component1DBoundary.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 27 28 96.4 %
Date: 2025-07-30 13:02:48 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14