https://mooseframework.inl.gov
AuxKernelBase.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 "MooseVariableFE.h"
14 #include "SetupInterface.h"
17 #include "FunctionInterface.h"
18 #include "UserObjectInterface.h"
19 #include "TransientInterface.h"
20 #include "PostprocessorInterface.h"
22 #include "RandomInterface.h"
24 #include "BlockRestrictable.h"
25 #include "BoundaryRestrictable.h"
26 #include "Restartable.h"
27 #include "MeshChangedInterface.h"
29 #include "ElementIDInterface.h"
30 #include "UserObject.h"
31 #include "NonADFunctorInterface.h"
32 
33 // forward declarations
34 class SubProblem;
35 class AuxiliarySystem;
36 class SystemBase;
37 class MooseMesh;
38 
42 class AuxKernelBase : public MooseObject,
43  public BlockRestrictable,
44  public BoundaryRestrictable,
45  public SetupInterface,
47  public FunctionInterface,
48  public UserObjectInterface,
49  public TransientInterface,
53  public RandomInterface,
55  public Restartable,
56  public MeshChangedInterface,
58  public ElementIDInterface,
59  protected NonADFunctorInterface
60 {
61 public:
63 
65 
66 #ifdef MOOSE_KOKKOS_ENABLED
67 
70  AuxKernelBase(const AuxKernelBase & object, const Moose::Kokkos::FunctorCopy & key);
71 #endif
72 
73  virtual void compute() = 0;
74 
75  const std::set<UserObjectName> & getDependObjects() const { return _depend_uo; }
76 
77  void coupledCallback(const std::string & var_name, bool is_old) const override;
78 
79  virtual const std::set<std::string> & getRequestedItems() override;
80 
81  virtual const std::set<std::string> & getSuppliedItems() override;
82 
83 protected:
86 
88  const bool _bnd;
89 
99 
103 
110 
113 
116 
119 
120 private:
121  void addPostprocessorDependencyHelper(const PostprocessorName & name) const override final;
122  void addUserObjectDependencyHelper(const UserObject & uo) const override final;
123  void
124  addVectorPostprocessorDependencyHelper(const VectorPostprocessorName & name) const override final;
125 
128 
130  mutable std::set<std::string> _depend_vars;
131  std::set<std::string> _supplied_vars;
132 
134  mutable std::set<UserObjectName> _depend_uo;
135 };
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
Interface for objects that need parallel consistent random numbers without patterns over the course o...
A class for creating restricted objects.
Definition: Restartable.h:28
Base class for auxiliary kernels.
Definition: AuxKernelBase.h:42
Keeps track of stuff related to assembling.
Definition: Assembly.h:109
virtual const std::set< std::string > & getSuppliedItems() override
Return a set containing the names of items owned by the object.
MooseVariableFieldBase & _var
Base MooseVariable.
Definition: AuxKernelBase.h:85
AuxKernelBase(const InputParameters &parameters)
Definition: AuxKernelBase.C:68
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
void coupledCallback(const std::string &var_name, bool is_old) const override
A call-back function provided by the derived object for actions before coupling a variable with funct...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
AuxiliarySystem & _aux_sys
std::set< std::string > _supplied_vars
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
SubProblem & _subproblem
Subproblem this kernel is part of.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Base class for a system (of equations)
Definition: SystemBase.h:84
MooseMesh & _mesh
Mesh this kernel is active on.
const bool _bnd
true if the kernel is boundary kernel, false if it is interior kernels
Definition: AuxKernelBase.h:88
void addVectorPostprocessorDependencyHelper(const VectorPostprocessorName &name) const override final
Helper for deriving classes to override to add dependencies when a VectorPostprocessor is requested...
Interface for objects that needs transient capabilities.
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
const bool _check_boundary_restricted
Whether or not to check for repeated element sides on the sideset to which the auxkernel is restricte...
Definition: AuxKernelBase.h:98
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
SystemBase & _sys
System this kernel is part of.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:92
const std::set< UserObjectName > & getDependObjects() const
Definition: AuxKernelBase.h:75
Interface for objects that need to use UserObjects.
void addPostprocessorDependencyHelper(const PostprocessorName &name) const override final
Helper for deriving classes to override to add dependencies when a Postprocessor is requested...
static InputParameters validParams()
Definition: AuxKernelBase.C:20
virtual void compute()=0
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
An interface for accessing Materials.
void addUserObjectDependencyHelper(const UserObject &uo) const override final
Helper for deriving classes to override to add dependencies when a UserObject is requested.
const THREAD_ID _tid
Thread ID.
Assembly & _assembly
Assembly class.
Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with t...
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
virtual const std::set< std::string > & getRequestedItems() override
Return a set containing the names of items requested by the object.
Interface for sorting dependent vectors of objects.
std::set< UserObjectName > _depend_uo
Depend UserObjects.
std::set< std::string > _depend_vars
Depend AuxKernelTempls.
Interface for objects that need to use functions.
A system that holds auxiliary variables.
Base class for user-specific data.
Definition: UserObject.h:40
SystemBase & _nl_sys
MooseVariableFieldBase & getVariableHelper(const InputParameters &parameters)
Get MooseVariable of base type from parameter.
Interface class for classes which interact with Postprocessors.
const bool _coincident_lower_d_calc
Whether we are computing for a lower dimensional variable using boundary restriction, e.g.
unsigned int THREAD_ID
Definition: MooseTypes.h:209