LCOV - code coverage report
Current view: top level - src/mfem/ics - MFEMScalarIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33380 (547b29) with base 8581c3 Lines: 11 12 91.7 %
Date: 2026-07-20 19:36:28 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        3522 : MFEMScalarIC::validParams()
      19             : {
      20        3522 :   auto params = MFEMInitialCondition::validParams();
      21        7044 :   params.addClassDescription("Sets the initial values of an MFEM scalar variable from a "
      22             :                              "user-specified scalar coefficient.");
      23       10566 :   params.addRequiredParam<MFEMScalarCoefficientName>("coefficient", "The scalar coefficient");
      24        3522 :   return params;
      25           0 : }
      26             : 
      27         698 : MFEMScalarIC::MFEMScalarIC(const InputParameters & params) : MFEMInitialCondition(params) {}
      28             : 
      29             : void
      30         698 : MFEMScalarIC::execute()
      31             : {
      32        1396 :   auto & coeff = getScalarCoefficient("coefficient");
      33        1396 :   auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
      34         698 :   grid_function->ProjectCoefficient(coeff);
      35         698 : }
      36             : 
      37             : #endif

Generated by: LCOV version 1.14