LCOV - code coverage report
Current view: top level - src/materials - GenericConstantArray.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 16 20 80.0 %
Date: 2025-08-08 20:01:16 Functions: 3 4 75.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 "GenericConstantArray.h"
      11             : 
      12             : #include "libmesh/quadrature.h"
      13             : 
      14             : registerMooseObject("MooseApp", GenericConstantArray);
      15             : 
      16             : InputParameters
      17       17956 : GenericConstantArray::validParams()
      18             : {
      19             : 
      20       17956 :   InputParameters params = Material::validParams();
      21       17956 :   params.addRequiredParam<std::string>("prop_name",
      22             :                                        "The name of the property this material will have");
      23       17956 :   params.addRequiredParam<RealEigenVector>("prop_value",
      24             :                                            "The values associated with the named property");
      25       17956 :   params.declareControllable("prop_value");
      26       17956 :   params.addClassDescription(
      27             :       "A material evaluating one material property in type of RealEigenVector");
      28       17956 :   params.set<MooseEnum>("constant_on") = "SUBDOMAIN";
      29       17956 :   return params;
      30           0 : }
      31             : 
      32        2784 : GenericConstantArray::GenericConstantArray(const InputParameters & parameters)
      33             :   : Material(parameters),
      34        2784 :     _prop_name(getParam<std::string>("prop_name")),
      35        2784 :     _prop_value(getParam<RealEigenVector>("prop_value")),
      36        5568 :     _property(declareProperty<RealEigenVector>(_prop_name))
      37             : {
      38        2784 : }
      39             : 
      40             : void
      41           0 : GenericConstantArray::initQpStatefulProperties()
      42             : {
      43           0 :   computeQpProperties();
      44           0 : }
      45             : 
      46             : void
      47      247931 : GenericConstantArray::computeQpProperties()
      48             : {
      49      247931 :   _property[_qp] = _prop_value;
      50      247931 : }

Generated by: LCOV version 1.14