LCOV - code coverage report
Current view: top level - src/mfem/actions - AddMFEMComplexKernelComponentAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 19 20 95.0 %
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 "AddMFEMComplexKernelComponentAction.h"
      13             : 
      14             : registerMooseAction("MooseApp",
      15             :                     AddMFEMComplexKernelComponentAction,
      16             :                     "add_mfem_complex_kernel_components");
      17             : 
      18             : InputParameters
      19         144 : AddMFEMComplexKernelComponentAction::validParams()
      20             : {
      21         144 :   InputParameters params = MooseObjectAction::validParams();
      22         144 :   params.addClassDescription(
      23             :       "Add an MFEMKernel to serve as the real or imaginary component of an MFEMComplexKernel.");
      24         144 :   return params;
      25           0 : }
      26             : 
      27         116 : AddMFEMComplexKernelComponentAction::AddMFEMComplexKernelComponentAction(
      28         116 :     const InputParameters & parameters)
      29         116 :   : MooseObjectAction(parameters)
      30             : {
      31         116 : }
      32             : 
      33             : void
      34         116 : AddMFEMComplexKernelComponentAction::act()
      35             : {
      36         116 :   std::vector<std::string> elements;
      37         116 :   MooseUtils::tokenize<std::string>(_pars.blockFullpath(), elements);
      38         116 :   MFEMProblem * mfem_problem = dynamic_cast<MFEMProblem *>(_problem.get());
      39             : 
      40         116 :   if (mfem_problem && _name == "RealComponent")
      41         122 :     mfem_problem->addRealComponentToKernel(
      42          61 :         _type, elements[elements.size() - 2], _moose_object_pars);
      43          55 :   else if (mfem_problem && _name == "ImagComponent")
      44         110 :     mfem_problem->addImagComponentToKernel(
      45          55 :         _type, elements[elements.size() - 2], _moose_object_pars);
      46         116 : }
      47             : 
      48             : #endif

Generated by: LCOV version 1.14