LCOV - code coverage report
Current view: top level - src/mfem/base - MFEMObject.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 20 25 80.0 %
Date: 2026-05-29 20:35:17 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             : #ifdef MOOSE_MFEM_ENABLED
      11             : 
      12             : #include "MFEMObject.h"
      13             : #include "MFEMProblem.h"
      14             : #include "SubProblem.h"
      15             : 
      16             : InputParameters
      17      219071 : MFEMObject::validParams()
      18             : {
      19      219071 :   InputParameters params = MooseObject::validParams();
      20      219071 :   params += FunctionInterface::validParams();
      21      219071 :   params += PostprocessorInterface::validParams();
      22      219071 :   params += VectorPostprocessorInterface::validParams();
      23      219071 :   params += ReporterInterface::validParams();
      24      219071 :   params.addClassDescription("Base class for MFEM objects backed directly by MooseObject.");
      25      219071 :   return params;
      26           0 : }
      27             : 
      28       14203 : MFEMObject::MFEMObject(const InputParameters & parameters)
      29             :   : MooseObject(parameters),
      30             :     FunctionInterface(this),
      31             :     PostprocessorInterface(this),
      32             :     VectorPostprocessorInterface(this),
      33             :     ReporterInterface(this),
      34       14203 :     _mfem_problem(
      35       56812 :         static_cast<MFEMProblem &>(*parameters.getCheckedPointerParam<SubProblem *>("_subproblem")))
      36             : {
      37       14203 : }
      38             : 
      39             : mfem::Coefficient &
      40        4056 : MFEMObject::getScalarCoefficientByName(const MFEMScalarCoefficientName & name)
      41             : {
      42        4056 :   return getMFEMProblem().getCoefficients().getScalarCoefficient(name);
      43             : }
      44             : 
      45             : mfem::VectorCoefficient &
      46         921 : MFEMObject::getVectorCoefficientByName(const MFEMVectorCoefficientName & name)
      47             : {
      48         921 :   return getMFEMProblem().getCoefficients().getVectorCoefficient(name);
      49             : }
      50             : 
      51             : mfem::MatrixCoefficient &
      52           0 : MFEMObject::getMatrixCoefficientByName(const MFEMMatrixCoefficientName & name)
      53             : {
      54           0 :   return getMFEMProblem().getCoefficients().getMatrixCoefficient(name);
      55             : }
      56             : 
      57             : mfem::Coefficient &
      58        4038 : MFEMObject::getScalarCoefficient(const std::string & name)
      59             : {
      60        4038 :   return getScalarCoefficientByName(getParam<MFEMScalarCoefficientName>(name));
      61             : }
      62             : 
      63             : mfem::VectorCoefficient &
      64         832 : MFEMObject::getVectorCoefficient(const std::string & name)
      65             : {
      66         832 :   return getVectorCoefficientByName(getParam<MFEMVectorCoefficientName>(name));
      67             : }
      68             : 
      69             : mfem::MatrixCoefficient &
      70           0 : MFEMObject::getMatrixCoefficient(const std::string & name)
      71             : {
      72           0 :   return getMatrixCoefficientByName(getParam<MFEMMatrixCoefficientName>(name));
      73             : }
      74             : 
      75             : #endif

Generated by: LCOV version 1.14