https://mooseframework.inl.gov
AddMFEMComplexKernelComponentAction.C
Go to the documentation of this file.
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 
13 
14 registerMooseAction("MooseApp",
16  "add_mfem_complex_kernel_components");
17 
20 {
22  params.addClassDescription(
23  "Add an MFEMKernel to serve as the real or imaginary component of an MFEMComplexKernel.");
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : MooseObjectAction(parameters)
30 {
31 }
32 
33 void
35 {
36  std::vector<std::string> elements;
37  MooseUtils::tokenize<std::string>(_pars.blockFullpath(), elements);
38 
39  if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "RealComponent")
40  static_cast<MFEMProblem &>(*_problem).addRealComponentToKernel(
41  _type, elements[elements.size() - 2], _moose_object_pars);
42  else if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "ImagComponent")
43  static_cast<MFEMProblem &>(*_problem).addImagComponentToKernel(
44  _type, elements[elements.size() - 2], _moose_object_pars);
45 }
46 
47 #endif
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
const InputParameters & _pars
The object&#39;s parameters.
Definition: MooseBase.h:394
const std::string & _name
The name of this class.
Definition: MooseBase.h:391
registerMooseAction("MooseApp", AddMFEMComplexKernelComponentAction, "add_mfem_complex_kernel_components")
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class allows us to introduce the kernels that will be the real and imaginary components of MFEMC...
AddMFEMComplexKernelComponentAction(const InputParameters &parameters)
std::string _type
The Object type that is being created.
InputParameters _moose_object_pars
The parameters for the object to be created.
std::string blockFullpath() const
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:178