https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMIndicator.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 "MFEMObject.h"
15#include "MFEMContainers.h"
16#include "MFEMVariable.h"
17
18/*
19 * Wrapper class for mfem::ErrorEstimator objects. To keep the
20 * naming consistent with MOOSE, we refer to it as an Indicator.
21 */
23{
24public:
26
27 MFEMIndicator(const InputParameters & params);
28
29 virtual ~MFEMIndicator() = default;
30
32 virtual void createEstimator() = 0;
33
35 mfem::ParFiniteElementSpace & getFESpace() const { return _fespace; }
36
38 mfem::ParMesh & getParMesh() const { return *(_fespace.GetParMesh()); }
39
41 std::shared_ptr<mfem::ErrorEstimator> getEstimator() const;
42
43protected:
45 const VariableName & _var_name;
46
48 const std::string & _kernel_name;
49
51 std::shared_ptr<mfem::ErrorEstimator> _error_estimator;
52
53 // FE space that the variable lives in
54 mfem::ParFiniteElementSpace & _fespace;
55};
56
57inline std::shared_ptr<mfem::ErrorEstimator>
59{
60 mooseAssert(_error_estimator,
61 "Attempting to retrieve error estimator before it's been constructed");
62 return _error_estimator;
63}
64
65#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
static InputParameters validParams()
mfem::ParFiniteElementSpace & getFESpace() const
Get reference to FE space using the name we store when setting up this class.
std::shared_ptr< mfem::ErrorEstimator > getEstimator() const
Method to fetch the error estimator after creation.
const std::string & _kernel_name
Name of the kernel providing the error estimate.
mfem::ParFiniteElementSpace & _fespace
virtual void createEstimator()=0
Create the estimator internally.
mfem::ParMesh & getParMesh() const
Get reference to the FE space's underlying mesh.
virtual ~MFEMIndicator()=default
std::shared_ptr< mfem::ErrorEstimator > _error_estimator
Shared pointer to the MFEM estimator wrapped by this class.
const VariableName & _var_name
Name of the variable associated with the weak form that the kernel is applied to.
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
Definition MFEMObject.h:30