LCOV - code coverage report
Current view: top level - src/materials - GenericConstantRealVectorValue.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 15 19 78.9 %
Date: 2025-07-17 01:28:37 Functions: 6 8 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 "GenericConstantRealVectorValue.h"
      11             : 
      12             : registerMooseObject("MooseApp", GenericConstantRealVectorValue);
      13             : registerMooseObject("MooseApp", ADGenericConstantRealVectorValue);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17       28632 : GenericConstantRealVectorValueTempl<is_ad>::validParams()
      18             : {
      19       28632 :   InputParameters params = Material::validParams();
      20       28632 :   params.addClassDescription("Object for declaring a constant 3-vector as a material property.");
      21       28632 :   params.addRequiredParam<RealVectorValue>("vector_values", "Values defining the constant vector");
      22       28632 :   params.addRequiredParam<MaterialPropertyName>(
      23             :       "vector_name", "Name of the vector material property to be created");
      24       28632 :   params.set<MooseEnum>("constant_on") = "SUBDOMAIN";
      25       28632 :   return params;
      26           0 : }
      27             : 
      28             : template <bool is_ad>
      29          78 : GenericConstantRealVectorValueTempl<is_ad>::GenericConstantRealVectorValueTempl(
      30             :     const InputParameters & parameters)
      31             :   : Material(parameters),
      32          78 :     _vector(getParam<RealVectorValue>("vector_values")),
      33         234 :     _prop(declareGenericProperty<RealVectorValue, is_ad>(
      34         156 :         getParam<MaterialPropertyName>("vector_name")))
      35             : {
      36          78 : }
      37             : 
      38             : template <bool is_ad>
      39             : void
      40           0 : GenericConstantRealVectorValueTempl<is_ad>::initQpStatefulProperties()
      41             : {
      42           0 :   GenericConstantRealVectorValueTempl<is_ad>::computeQpProperties();
      43           0 : }
      44             : 
      45             : template <bool is_ad>
      46             : void
      47          50 : GenericConstantRealVectorValueTempl<is_ad>::computeQpProperties()
      48             : {
      49          50 :   _prop[_qp] = _vector;
      50          50 : }
      51             : 
      52             : template class GenericConstantRealVectorValueTempl<false>;
      53             : template class GenericConstantRealVectorValueTempl<true>;

Generated by: LCOV version 1.14