LCOV - code coverage report
Current view: top level - src/mfem/ics - MFEMScalarIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33416 (b10b36) with base 9fbd27 Lines: 11 12 91.7 %
Date: 2026-07-23 16:15:30 Functions: 3 3 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 "MFEMScalarIC.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMScalarIC);
      16             : 
      17             : InputParameters
      18        3604 : MFEMScalarIC::validParams()
      19             : {
      20        3604 :   auto params = MFEMInitialCondition::validParams();
      21        7208 :   params.addClassDescription("Sets the initial values of an MFEM scalar variable from a "
      22             :                              "user-specified scalar coefficient.");
      23       10812 :   params.addRequiredParam<MFEMScalarCoefficientName>("coefficient", "The scalar coefficient");
      24        3604 :   return params;
      25           0 : }
      26             : 
      27         739 : MFEMScalarIC::MFEMScalarIC(const InputParameters & params) : MFEMInitialCondition(params) {}
      28             : 
      29             : void
      30         737 : MFEMScalarIC::execute()
      31             : {
      32        1474 :   auto & coeff = getScalarCoefficient("coefficient");
      33        1474 :   auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
      34         737 :   grid_function->ProjectCoefficient(coeff);
      35         737 : }
      36             : 
      37             : #endif

Generated by: LCOV version 1.14