https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMComplexVectorIC.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
12#include "MFEMComplexVectorIC.h"
13#include "MFEMProblem.h"
14
16
19{
21 params.addClassDescription("Sets the initial values of an MFEM vector variable from a "
22 "user-specified vector coefficient.");
23 params.addRequiredParam<MFEMVectorCoefficientName>("vector_coefficient_real",
24 "The real part of the vector coefficient");
25 params.addRequiredParam<MFEMVectorCoefficientName>(
26 "vector_coefficient_imag", "The imaginary part of the vector coefficient");
27 return params;
28}
29
34
35void
37{
38 auto & coeff_real = getVectorCoefficient("vector_coefficient_real");
39 auto & coeff_imag = getVectorCoefficient("vector_coefficient_imag");
40 auto grid_function = getMFEMProblem().getComplexGridFunction(getParam<VariableName>("variable"));
41 grid_function->ProjectCoefficient(coeff_real, coeff_imag);
42}
43
44#endif
registerMooseObject("MooseApp", MFEMComplexVectorIC)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Class used to set the initial value(s) on a complex vector valued MFEMVariable.
static InputParameters validParams()
MFEMComplexVectorIC(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()
mfem::VectorCoefficient & getVectorCoefficient(const std::string &name)
Retrieve a vector MFEM coefficient using the value of an input parameter.
Definition MFEMObject.C:64
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition MFEMObject.h:45
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)