LCOV - code coverage report
Current view: top level - src/materials - DirectionMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 12 13 92.3 %
Date: 2025-07-30 13:02:48 Functions: 3 3 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 "DirectionMaterial.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", DirectionMaterial);
      13             : 
      14             : InputParameters
      15       18858 : DirectionMaterial::validParams()
      16             : {
      17       18858 :   InputParameters params = Material::validParams();
      18       18858 :   params.set<MooseEnum>("constant_on") = 1; // constant on element
      19       18858 :   params.addClassDescription("Computes the direction of 1D elements");
      20       18858 :   return params;
      21           0 : }
      22             : 
      23       14760 : DirectionMaterial::DirectionMaterial(const InputParameters & parameters)
      24       14760 :   : Material(parameters), _dir(declareProperty<RealVectorValue>("direction"))
      25             : {
      26       14760 : }
      27             : 
      28             : void
      29    20845932 : DirectionMaterial::computeQpProperties()
      30             : {
      31    20845932 :   const Elem * el = _mesh.elemPtr(_current_elem->id());
      32             :   RealVectorValue dir = el->node_ref(1) - el->node_ref(0);
      33    20845932 :   _dir[_qp] = dir.unit();
      34    20845932 : }

Generated by: LCOV version 1.14