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
28 const InputParameters & parameters)
29 : MooseObjectAction(parameters)
30{
31 // Block restriction is taken from the parent MFEMComplexKernel.
32 if (_moose_object_pars.have_parameter<std::vector<SubdomainName>>("block"))
33 _moose_object_pars.suppressParameter<std::vector<SubdomainName>>("block");
34}
35
36void
38{
39 std::vector<std::string> elements;
40 MooseUtils::tokenize<std::string>(_pars.blockFullpath(), elements);
41
42 if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "RealComponent")
43 cast_ref<MFEMProblem &>(*_problem).addRealComponentToKernel(
44 _type, elements[elements.size() - 2], _moose_object_pars);
45 else if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "ImagComponent")
46 cast_ref<MFEMProblem &>(*_problem).addImagComponentToKernel(
47 _type, elements[elements.size() - 2], _moose_object_pars);
48}
49
50#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.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
std::string blockFullpath() const
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
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.
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.