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

Generated by: LCOV version 1.14