LCOV - code coverage report
Current view: top level - src/mfem/ics - MFEMVectorIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31782 (615931) with base 7edd10 Lines: 11 12 91.7 %
Date: 2025-11-11 23:21:15 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 "MFEMVectorIC.h"
      13             : #include "MFEMProblem.h"
      14             : #include <mfem.hpp>
      15             : 
      16             : registerMooseObject("MooseApp", MFEMVectorIC);
      17             : 
      18             : InputParameters
      19        8724 : MFEMVectorIC::validParams()
      20             : {
      21        8724 :   auto params = MFEMInitialCondition::validParams();
      22       17448 :   params.addClassDescription("Sets the initial values of an MFEM vector variable from a "
      23             :                              "user-specified vector coefficient.");
      24       26172 :   params.addRequiredParam<MFEMVectorCoefficientName>("vector_coefficient",
      25             :                                                      "The vector coefficient");
      26        8724 :   return params;
      27           0 : }
      28             : 
      29          46 : MFEMVectorIC::MFEMVectorIC(const InputParameters & params) : MFEMInitialCondition(params) {}
      30             : 
      31             : void
      32          46 : MFEMVectorIC::execute()
      33             : {
      34          92 :   auto & coeff = getVectorCoefficient("vector_coefficient");
      35          92 :   auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
      36          46 :   grid_function->ProjectCoefficient(coeff);
      37          46 : }
      38             : 
      39             : #endif

Generated by: LCOV version 1.14