https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
16 "add_mfem_complex_kernel_components");
17
20{
23 "Add an MFEMKernel to serve as the real or imaginary component of an MFEMComplexKernel.");
24 return params;
25}
26
32
33void
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
registerMooseAction("MooseApp", AddMFEMComplexKernelComponentAction, "add_mfem_complex_kernel_components")
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition Action.h:178
This class allows us to introduce the kernels that will be the real and imaginary components of MFEMC...
AddMFEMComplexKernelComponentAction(const InputParameters &parameters)
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
void addRealComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Adds a real component kernel to the parent MFEMComplexKernel.
void addImagComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Adds an imaginary component kernel to the parent MFEMComplexKernel.
const InputParameters & _pars
The object's parameters.
Definition MooseBase.h:384
const std::string & _name
The name of this class.
Definition MooseBase.h:381
InputParameters _moose_object_pars
The parameters for the object to be created.
static InputParameters validParams()
std::string _type
The Object type that is being created.