https://mooseframework.inl.gov
MFEMRefinementMarker.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 #pragma once
12 
13 #include "MFEMObject.h"
14 #include "MFEMIndicator.h"
15 
21 {
22 public:
24 
25  MFEMRefinementMarker(const InputParameters & params);
26 
27  virtual ~MFEMRefinementMarker() = default;
28 
30  void initialSetup();
31 
33  bool pRefine();
34 
36  bool hRefine();
37 
38 protected:
40  std::unique_ptr<mfem::ThresholdRefiner> _threshold_refiner;
41 
43  const std::string & _estimator_name;
44 
46  const mfem::real_t _error_threshold;
47 
49  bool _rebalance;
50 
52  const unsigned _max_h_level;
53 
55  const unsigned _max_p_level;
56 
58  unsigned _h_ref_counter{0};
59 
61  unsigned _p_ref_counter{0};
62 
64  const MFEMIndicator * _estimator{nullptr};
65 };
66 
67 #endif
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
Definition: MFEMObject.h:25
const std::string & _estimator_name
The estimator/indicator&#39;s name.
const unsigned _max_h_level
The max no. of times h-refinement can be performed.
bool _rebalance
Whether to rebalance the mesh after h-refinement.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Class to construct threshold refiner.
virtual ~MFEMRefinementMarker()=default
bool pRefine()
Applies p-refinement wherever the refiner sees fit.
const unsigned _max_p_level
The max no. of times h-refinement can be performed.
std::unique_ptr< mfem::ThresholdRefiner > _threshold_refiner
Unique pointer to underlying mfem::ThresholdRefiner object.
MFEMRefinementMarker(const InputParameters &params)
unsigned _p_ref_counter
The no. of times p-refinement has been performed.
bool hRefine()
Applies h-refinement wherever the refiner sees fit.
static InputParameters validParams()
const MFEMIndicator * _estimator
Pointer to the estimator/indicator.
unsigned _h_ref_counter
The no. of times h-refinement has been performed.
const mfem::real_t _error_threshold
The error threshold determining which elements to refine.
void initialSetup()
Constructs associated mfem::ThresholdRefiner once mfem::ErrorEstimator is guaranteed to exist...