https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AddMFEMComplexBCComponentAction.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
14registerMooseAction("MooseApp", AddMFEMComplexBCComponentAction, "add_mfem_complex_bc_components");
15
18{
21 "Add an MFEMIntegratedBC to serve as the real or imaginary component of "
22 "an MFEMComplexIntegratedBC.");
23 return params;
24}
25
27 : MooseObjectAction(parameters)
28{
29 // Boundary restriction is taken from the parent MFEMComplexIntegratedBC.
30 if (_moose_object_pars.have_parameter<std::vector<BoundaryName>>("boundary"))
31 _moose_object_pars.suppressParameter<std::vector<BoundaryName>>("boundary");
32}
33
34void
36{
37 std::vector<std::string> elements;
38 MooseUtils::tokenize<std::string>(_pars.blockFullpath(), elements);
39
40 if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "RealComponent")
41 cast_ref<MFEMProblem &>(*_problem).addRealComponentToBC(
42 _type, elements[elements.size() - 2], _moose_object_pars);
43 else if (_problem->feBackend() == Moose::FEBackend::MFEM && _name == "ImagComponent")
44 cast_ref<MFEMProblem &>(*_problem).addImagComponentToBC(
45 _type, elements[elements.size() - 2], _moose_object_pars);
46}
47
48#endif
registerMooseAction("MooseApp", AddMFEMComplexBCComponentAction, "add_mfem_complex_bc_components")
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition Action.h:178
This class allows us to add the user objects that will be the real and imaginary components of MFEMCo...
AddMFEMComplexBCComponentAction(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.