LCOV - code coverage report
Current view: top level - src/dirackernels - GapHeatPointSourceMaster.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 37 42 88.1 %
Date: 2025-09-04 07:53:51 Functions: 5 5 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 "GapHeatPointSourceMaster.h"
      11             : #include "SystemBase.h"
      12             : #include "PenetrationInfo.h"
      13             : #include "MooseMesh.h"
      14             : 
      15             : #include "libmesh/string_to_enum.h"
      16             : 
      17             : registerMooseObject("HeatTransferApp", GapHeatPointSourceMaster);
      18             : 
      19             : InputParameters
      20         969 : GapHeatPointSourceMaster::validParams()
      21             : {
      22        1938 :   MooseEnum orders("CONSTANT FIRST SECOND THIRD FOURTH", "FIRST");
      23             : 
      24         969 :   InputParameters params = DiracKernel::validParams();
      25        1938 :   params.addParam<BoundaryName>("boundary", "The primary boundary");
      26        1938 :   params.addParam<BoundaryName>("secondary", "The secondary boundary");
      27        1938 :   params.addParam<MooseEnum>("order", orders, "The finite element order");
      28         969 :   params.set<bool>("use_displaced_mesh") = true;
      29        1938 :   params.addParam<Real>("tangential_tolerance",
      30             :                         "Tangential distance to extend edges of contact surfaces");
      31        1938 :   params.addParam<Real>(
      32             :       "normal_smoothing_distance",
      33             :       "Distance from edge in parametric coordinates over which to smooth contact normal");
      34        1938 :   params.addParam<std::string>("normal_smoothing_method",
      35             :                                "Method to use to smooth normals (edge_based|nodal_normal_based)");
      36         969 :   params.addClassDescription(
      37             :       "Dirac kernel to create a heat source on the primary contact surface in thermal contact.");
      38             : 
      39         969 :   return params;
      40         969 : }
      41             : 
      42         519 : GapHeatPointSourceMaster::GapHeatPointSourceMaster(const InputParameters & parameters)
      43             :   : DiracKernel(parameters),
      44         519 :     _penetration_locator(
      45        2076 :         getPenetrationLocator(getParam<BoundaryName>("boundary"),
      46             :                               getParam<BoundaryName>("secondary"),
      47         519 :                               Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
      48        1038 :     _secondary_flux(_sys.getVector("secondary_flux"))
      49             : {
      50        1038 :   if (parameters.isParamValid("tangential_tolerance"))
      51           0 :     _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
      52             : 
      53        1038 :   if (parameters.isParamValid("normal_smoothing_distance"))
      54           0 :     _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
      55             : 
      56        1038 :   if (parameters.isParamValid("normal_smoothing_method"))
      57           0 :     _penetration_locator.setNormalSmoothingMethod(
      58             :         parameters.get<std::string>("normal_smoothing_method"));
      59         519 : }
      60             : 
      61             : void
      62       37770 : GapHeatPointSourceMaster::addPoints()
      63             : {
      64             :   point_to_node.clear();
      65       37770 :   _secondary_flux.close();
      66             : 
      67      319071 :   for (const auto & [id, pinfo] : _penetration_locator._penetration_info)
      68             :   {
      69      281301 :     if (!pinfo)
      70           0 :       continue;
      71             : 
      72      281301 :     const auto & node = _mesh.nodeRef(id);
      73             :     // Skip this pinfo if there are no DOFs on this node.
      74      281301 :     if (node.n_comp(_sys.number(), _var.number()) < 1)
      75           0 :       continue;
      76             : 
      77      281301 :     addPoint(pinfo->_elem, pinfo->_closest_point);
      78      281301 :     point_to_node[pinfo->_closest_point] = &node;
      79             :   }
      80       37770 : }
      81             : 
      82             : Real
      83     2150148 : GapHeatPointSourceMaster::computeQpResidual()
      84             : {
      85     2150148 :   const Node & node = *point_to_node[_current_point];
      86     2150148 :   const auto dof_number = node.dof_number(_sys.number(), _var.number(), 0);
      87             : 
      88     2150148 :   return -_test[_i][_qp] * _secondary_flux(dof_number);
      89             : }
      90             : 
      91             : Real
      92     5548311 : GapHeatPointSourceMaster::computeQpJacobian()
      93             : {
      94     5548311 :   return 0.0;
      95             : }

Generated by: LCOV version 1.14