LCOV - code coverage report
Current view: top level - src/mfem/ics - MFEMVectorIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 909fe5 Lines: 11 12 91.7 %
Date: 2025-08-29 20:01:24 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        8694 : MFEMVectorIC::validParams()
      20             : {
      21        8694 :   auto params = MFEMInitialCondition::validParams();
      22       17388 :   params.addClassDescription("Sets the initial values of an MFEM vector variable from a "
      23             :                              "user-specified vector coefficient.");
      24       26082 :   params.addRequiredParam<MFEMVectorCoefficientName>("vector_coefficient",
      25             :                                                      "The vector coefficient");
      26        8694 :   return params;
      27           0 : }
      28             : 
      29          32 : MFEMVectorIC::MFEMVectorIC(const InputParameters & params) : MFEMInitialCondition(params) {}
      30             : 
      31             : void
      32          32 : MFEMVectorIC::execute()
      33             : {
      34          64 :   auto & coeff = getVectorCoefficient("vector_coefficient");
      35          64 :   auto grid_function = getMFEMProblem().getGridFunction(getParam<VariableName>("variable"));
      36          32 :   grid_function->ProjectCoefficient(coeff);
      37          32 : }
      38             : 
      39             : #endif

Generated by: LCOV version 1.14