LCOV - code coverage report
Current view: top level - src/mfem/ics - MFEMScalarBoundaryIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 14 15 93.3 %
Date: 2026-05-29 20:35:17 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 "MFEMScalarBoundaryIC.h"
      13             : #include "MFEMProblem.h"
      14             : 
      15             : registerMooseObject("MooseApp", MFEMScalarBoundaryIC);
      16             : 
      17             : InputParameters
      18        2198 : MFEMScalarBoundaryIC::validParams()
      19             : {
      20        2198 :   auto params = MFEMInitialCondition::validParams();
      21        2198 :   params += MFEMBoundaryRestrictable::validParams();
      22        4396 :   params.addClassDescription("Sets the initial values of an MFEM scalar variable from a "
      23             :                              "user-specified scalar coefficient.");
      24        6594 :   params.addRequiredParam<MFEMScalarCoefficientName>("coefficient", "The scalar coefficient");
      25        2198 :   return params;
      26           0 : }
      27             : 
      28          50 : MFEMScalarBoundaryIC::MFEMScalarBoundaryIC(const InputParameters & params)
      29             :   : MFEMInitialCondition(params),
      30             :     MFEMBoundaryRestrictable(
      31         100 :         params, getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("variable")))
      32             : {
      33          50 : }
      34             : 
      35             : void
      36          50 : MFEMScalarBoundaryIC::execute()
      37             : {
      38         100 :   auto & coeff = getScalarCoefficient("coefficient");
      39         100 :   auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
      40          50 :   grid_function->ProjectBdrCoefficient(coeff, getBoundaryMarkers());
      41          50 : }
      42             : 
      43             : #endif

Generated by: LCOV version 1.14