https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMComplexScalarBoundaryIC.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#include "MFEMProblem.h"
14
16
19{
22 params.addClassDescription("Sets the initial values of a complex MFEM scalar variable from a "
23 "pair of user-specified scalar coefficients.");
24 params.addRequiredParam<MFEMScalarCoefficientName>("coefficient_real",
25 "The real part of the scalar coefficient");
26 params.addRequiredParam<MFEMScalarCoefficientName>(
27 "coefficient_imag", "The imaginary part of the scalar coefficient");
28 return params;
29}
30
32 : MFEMInitialCondition(params),
34 params, getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("variable")))
35{
36}
37
38void
40{
41 auto & coeff_real = getScalarCoefficient("coefficient_real");
42 auto & coeff_imag = getScalarCoefficient("coefficient_imag");
43 auto grid_function = getMFEMProblem().getComplexGridFunction(getParam<VariableName>("variable"));
44 grid_function->ProjectBdrCoefficient(coeff_real, coeff_imag, getBoundaryMarkers());
45}
46
47#endif
registerMooseObject("MooseApp", MFEMComplexScalarBoundaryIC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for construction of an object that is restricted to a subset of boundaries of the problem ...
mfem::Array< int > & getBoundaryMarkers()
static InputParameters validParams()
Class used to set the initial value(s) on a complex scalar valued MFEMVariable.
MFEMComplexScalarBoundaryIC(const InputParameters &params)
virtual void execute() override
Perform the main work for this object.
Base class used to set the initial value(s) on an MFEMVariable.
static InputParameters validParams()
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition MFEMObject.h:45
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Retrieve a scalar MFEM coefficient using the value of an input parameter.
Definition MFEMObject.C:58
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)