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

Generated by: LCOV version 1.14