https://mooseframework.inl.gov
Marker.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 #pragma once
11 
12 #include "MooseObject.h"
13 #include "BlockRestrictable.h"
14 #include "SetupInterface.h"
17 #include "UserObjectInterface.h"
18 #include "Restartable.h"
19 #include "PostprocessorInterface.h"
20 #include "MeshChangedInterface.h"
21 #include "OutputInterface.h"
22 
23 // Forward declarations
24 class MooseMesh;
25 class SubProblem;
26 class FEProblemBase;
27 class SystemBase;
28 class Assembly;
29 template <typename>
33 class Adaptivity;
34 
35 namespace libMesh
36 {
37 class ErrorVector;
38 }
40 
41 class Marker : public MooseObject,
42  public BlockRestrictable,
43  public SetupInterface,
46  public UserObjectInterface,
47  public Restartable,
49  public MeshChangedInterface,
50  public OutputInterface
51 {
52 public:
54 
56  virtual ~Marker() {}
57 
60  {
61  DONT_MARK = -1,
65  };
66 
72  static MooseEnum markerStates();
73 
75  virtual void computeMarker();
76 
77  bool isActive() const;
78 
82  virtual void markerSetup();
83 
84  virtual const std::set<std::string> & getRequestedItems() override;
85 
86  virtual const std::set<std::string> & getSuppliedItems() override;
87 
88 protected:
89  virtual MarkerValue computeElementMarker() = 0;
90 
98  ErrorVector & getErrorVector(std::string indicator);
99 
108  const MooseArray<Real> & getMarkerValue(std::string name);
109 
114 
116 
118 
122  const Elem * const & _current_elem;
123 
126 
128  std::set<std::string> _depend;
129  std::set<std::string> _supplied;
130 };
virtual const std::set< std::string > & getRequestedItems() override
Return a set containing the names of items requested by the object.
Definition: Marker.C:101
SystemBase & _sys
Definition: Marker.h:113
THREAD_ID _tid
Definition: Marker.h:115
Assembly & _assembly
Definition: Marker.h:117
A class for creating restricted objects.
Definition: Restartable.h:28
Keeps track of stuff related to assembling.
Definition: Assembly.h:101
Class for stuff related to variables.
Definition: Adaptivity.h:31
SubProblem & _subproblem
Definition: Marker.h:110
FEProblemBase & _fe_problem
Definition: Marker.h:111
Definition: Marker.h:41
A class to provide an common interface to objects requiring "outputs" option.
const Elem *const & _current_elem
Pointer to the current element being considered in the marker element-based loop. ...
Definition: Marker.h:122
virtual ~Marker()
Definition: Marker.h:56
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void markerSetup()
Is called before any element looping is started so any "global" computation can be done...
Definition: Marker.C:96
MarkerValue
This mirrors the main refinement flag values in libMesh in Elem::RefinementState but adds "dont_mark"...
Definition: Marker.h:59
std::set< std::string > _supplied
Definition: Marker.h:129
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Base class for a system (of equations)
Definition: SystemBase.h:84
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Adaptivity & _adaptivity
Definition: Marker.h:112
virtual const std::set< std::string > & getSuppliedItems() override
Return a set containing the names of items owned by the object.
Definition: Marker.C:107
MooseVariableFE< VectorValue< Real > > VectorMooseVariable
Definition: Marker.h:32
MooseVariableFE< Real > MooseVariable
Definition: Marker.h:30
MooseMesh & _mesh
Reference to the mesh, obtained from the subproblem.
Definition: Marker.h:125
Interface for notifications that the mesh has changed.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
ErrorVector & getErrorVector(std::string indicator)
Get an ErrorVector that will be filled up with values corresponding to the indicator passed in...
Definition: Marker.C:77
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
static MooseEnum markerStates()
Helper function for getting the valid refinement flag states a marker can use as a MooseEnum...
Definition: Marker.C:62
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
Interface for objects that need to use UserObjects.
std::set< std::string > _depend
Depend Markers.
Definition: Marker.h:128
virtual MarkerValue computeElementMarker()=0
MooseVariable & _field_var
Reference to this marker as a variable.
Definition: Marker.h:120
Marker(const InputParameters &parameters)
Definition: Marker.C:34
bool isActive() const
Definition: Marker.C:90
Takes care of everything related to mesh adaptivity.
Definition: Adaptivity.h:49
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
const MooseArray< Real > & getMarkerValue(std::string name)
This is used to get the values of other Markers.
Definition: Marker.C:83
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
Interface for sorting dependent vectors of objects.
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Definition: Marker.C:19
virtual void computeMarker()
Computes and sets the value of the refinement flag.
Definition: Marker.C:70
Interface class for classes which interact with Postprocessors.
unsigned int THREAD_ID
Definition: MooseTypes.h:209