LCOV - code coverage report
Current view: top level - src/mfem/functormaterials - MFEMGenericFunctorMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 16 17 94.1 %
Date: 2025-08-08 20:01:16 Functions: 4 4 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             : #ifdef MOOSE_MFEM_ENABLED
      11             : 
      12             : #include "MFEMGenericFunctorMaterial.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMGenericFunctorMaterial);
      16             : 
      17             : InputParameters
      18        8755 : MFEMGenericFunctorMaterial::validParams()
      19             : {
      20        8755 :   InputParameters params = MFEMFunctorMaterial::validParams();
      21        8755 :   params.addClassDescription("Declares material scalar properties based on names and coefficients "
      22             :                              "prescribed by input parameters.");
      23        8755 :   params.addRequiredParam<std::vector<std::string>>(
      24             :       "prop_names", "The names of the properties this material will have");
      25        8755 :   params.addRequiredParam<std::vector<MFEMScalarCoefficientName>>(
      26             :       "prop_values",
      27             :       "The corresponding names of coefficients associated with the named properties");
      28             : 
      29        8755 :   return params;
      30           0 : }
      31             : 
      32          63 : MFEMGenericFunctorMaterial::MFEMGenericFunctorMaterial(const InputParameters & parameters)
      33             :   : MFEMFunctorMaterial(parameters),
      34          63 :     _prop_names(getParam<std::vector<std::string>>("prop_names")),
      35         126 :     _prop_values(getParam<std::vector<MFEMScalarCoefficientName>>("prop_values"))
      36             : {
      37          63 :   if (_prop_names.size() != _prop_values.size())
      38           3 :     paramError("prop_names", "Must match the size of prop_values");
      39             : 
      40         155 :   for (const auto i : index_range(_prop_names))
      41          93 :     _properties.declareScalarProperty(
      42         186 :         _prop_names[i], subdomainsToStrings(_subdomain_names), _prop_values[i]);
      43          63 : }
      44             : 
      45         124 : MFEMGenericFunctorMaterial::~MFEMGenericFunctorMaterial() {}
      46             : 
      47             : #endif

Generated by: LCOV version 1.14