https://mooseframework.inl.gov
ElementMaxLevelPostProcessor.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 
11 
13 
16 {
18  params.addClassDescription(
19  "Computes the maximum element adaptivity level (for either h or p refinement).");
21  "level", MooseEnum("h p"), "The type of adaptivity level to compute.");
22  return params;
23 }
24 
26  : ElementPostprocessor(parameters), _level_type(getParam<MooseEnum>("level").getEnum<LevelType>())
27 {
28 }
29 
30 void
32 {
33  _max_level = 0;
34 }
35 
36 void
38 {
39 #ifdef LIBMESH_ENABLE_AMR
40  switch (_level_type)
41  {
42  case LevelType::H:
44  break;
45  case LevelType::P:
47  break;
48  default:
49  break;
50  }
51 #endif
52 }
53 
54 Real
56 {
57  return _max_level;
58 }
59 
60 void
62 {
63  const auto & pps = static_cast<const ElementMaxLevelPostProcessor &>(y);
64  _max_level = std::max(_max_level, pps._max_level);
65 }
66 
67 void
69 {
71 }
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
Definition: UserObject.h:138
ElementMaxLevelPostProcessor(const InputParameters &parameters)
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
virtual void threadJoin(const UserObject &y) override
Must override.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
auto max(const L &left, const R &right)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
registerMooseObject("MooseApp", ElementMaxLevelPostProcessor)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
virtual void execute() override
Execute method.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
enum ElementMaxLevelPostProcessor::LevelType _level_type
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
The current element pointer (available during execute())
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
This postprocessor computes the maximum element h-level or p-level.
Base class for user-specific data.
Definition: UserObject.h:40