https://mooseframework.inl.gov
MFEMVariable.h
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 #pragma once
13 
14 #include "MFEMFESpace.h"
15 #include "MFEMObject.h"
16 
20 class MFEMVariable : public MFEMObject
21 {
22 public:
24 
26 
28  inline std::shared_ptr<mfem::ParGridFunction> getGridFunction() const { return _gridfunction; }
29 
31  inline const MFEMFESpace & getFESpace() const { return _fespace; }
32 
34  inline const VariableName & getTimeDerivativeName() const { return _time_derivative_name; }
35 
37  void declareCoefficients();
38 
39 protected:
41 
42 private:
44  const std::shared_ptr<mfem::ParGridFunction> buildGridFunction();
45 
47  const std::shared_ptr<mfem::ParGridFunction> _gridfunction{nullptr};
48 
50  const VariableName _time_derivative_name;
51 };
52 
53 #endif
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
Definition: MFEMObject.h:25
const MFEMFESpace & _fespace
Definition: MFEMVariable.h:40
const VariableName & getTimeDerivativeName() const
Returns the variable name corresponding to the time derivative of the MFEMVariable.
Definition: MFEMVariable.h:34
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const std::shared_ptr< mfem::ParGridFunction > _gridfunction
Stores the constructed gridfunction.
Definition: MFEMVariable.h:47
Constructs and stores an mfem::ParGridFunction object.
Definition: MFEMVariable.h:20
const VariableName _time_derivative_name
Optional name of the time derivative to associate with this variable in transient problems...
Definition: MFEMVariable.h:50
MFEMVariable(const InputParameters &parameters)
Definition: MFEMVariable.C:38
const std::shared_ptr< mfem::ParGridFunction > buildGridFunction()
Constructs the gridfunction.
Definition: MFEMVariable.C:54
const MFEMFESpace & getFESpace() const
Returns a reference to the fespace used by the gridfunction.
Definition: MFEMVariable.h:31
std::shared_ptr< mfem::ParGridFunction > getGridFunction() const
Returns a shared pointer to the constructed gridfunction.
Definition: MFEMVariable.h:28
Constructs and stores an mfem::ParFiniteElementSpace object.
Definition: MFEMFESpace.h:20
static InputParameters validParams()
Definition: MFEMVariable.C:20
void declareCoefficients()
Declare default coefficients associated with this gridfunction.
Definition: MFEMVariable.C:60