https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
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
30void
35
36void
38{
39#ifdef LIBMESH_ENABLE_AMR
40 switch (_level_type)
41 {
42 case LevelType::H:
43 _max_level = std::max(_max_level, _current_elem->level());
44 break;
45 case LevelType::P:
46 _max_level = std::max(_max_level, _current_elem->p_level());
47 break;
48 default:
49 break;
50 }
51#endif
52}
53
54Real
59
60void
62{
63 const auto & pps = static_cast<const ElementMaxLevelPostProcessor &>(y);
64 _max_level = std::max(_max_level, pps._max_level);
65}
66
67void
registerMooseObject("MooseApp", ElementMaxLevelPostProcessor)
This postprocessor computes the maximum element h-level or p-level.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void execute() override
Execute method.
enum ElementMaxLevelPostProcessor::LevelType _level_type
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
ElementMaxLevelPostProcessor(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y) override
Must override.
static InputParameters validParams()
const Elem *const & _current_elem
The current element pointer (available during execute())
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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...
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 is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
Base class for user-specific data.
Definition UserObject.h:20