https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
22#include "RandomInterface.h"
24#include "BlockRestrictable.h"
26#include "Restartable.h"
30#include "ElementIDInterface.h"
31#include "UserObjectBase.h"
33
34// forward declarations
35class SubProblem;
36class AuxiliarySystem;
37class SystemBase;
38class MooseMesh;
39
44 public BlockRestrictable,
46 public SetupInterface,
48 public FunctionInterface,
50 public TransientInterface,
54 public RandomInterface,
56 public Restartable,
60 public ElementIDInterface,
61 protected NonADFunctorInterface
62{
63public:
65
67
68#ifdef MOOSE_KOKKOS_ENABLED
72 AuxKernelBase(const AuxKernelBase & object, const Moose::Kokkos::FunctorCopy & key);
73#endif
74
75 virtual void compute() = 0;
76
77 const std::set<UserObjectName> & getDependObjects() const { return _depend_uo; }
78
79 void coupledCallback(const std::string & var_name, bool is_old) const override;
80
81 virtual const std::set<std::string> & getRequestedItems() override;
82
83 virtual const std::set<std::string> & getSuppliedItems() override;
84
85 virtual void initialSetup() override;
86
91 bool isNodal() const { return _is_nodal_kernel; }
92
93protected:
96 bool usesFaceCoupledValues() const override { return !_c_nodal && boundaryRestricted(); }
97
100
105
107 const bool _bnd;
108
118
125
128
131
134
139 static std::vector<AuxVariableName> getVariableNamesHelper(const InputParameters & parameters);
140
141private:
142 void addPostprocessorDependencyHelper(const PostprocessorName & name) const override final;
143 void addUserObjectDependencyHelper(const UserObjectBase & uo) const override final;
144 void
145 addVectorPostprocessorDependencyHelper(const VectorPostprocessorName & name) const override final;
146
149
151 mutable std::set<std::string> _depend_vars;
152 std::set<std::string> _supplied_vars;
153
155 mutable std::set<UserObjectName> _depend_uo;
156};
unsigned int THREAD_ID
Definition MooseTypes.h:237
Keeps track of stuff related to assembling.
Definition Assembly.h:102
Base class for auxiliary kernels.
MooseVariableFieldBase & getVariableHelper(const InputParameters &parameters)
Get MooseVariable of base type from parameter.
std::set< UserObjectName > _depend_uo
Depend UserObjects.
std::set< std::string > _supplied_vars
SubProblem & _subproblem
Subproblem this kernel is part of.
SystemBase & _nl_sys
bool usesFaceCoupledValues() const override
Elemental aux kernels restricted to a boundary are evaluated at the face quadrature points of the bou...
const bool _is_nodal_kernel
true if this kernel computes a nodal (as opposed to elemental) variable.
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...
static InputParameters validParams()
const bool _check_boundary_restricted
Whether or not to check for repeated element sides on the sideset to which the auxkernel is restricte...
void addPostprocessorDependencyHelper(const PostprocessorName &name) const override final
Helper for deriving classes to override to add dependencies when a Postprocessor is requested.
Assembly & _assembly
Assembly class.
const std::set< UserObjectName > & getDependObjects() const
SystemBase & _sys
System this kernel is part of.
static std::vector< AuxVariableName > getVariableNamesHelper(const InputParameters &parameters)
Get the names of the variables this object operates on: 'variable', or 'variables' for Kokkos objects...
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
const bool _bnd
true if the kernel is boundary kernel, false if it is interior kernels
virtual const std::set< std::string > & getSuppliedItems() override
Return a set containing the names of items owned by the object.
virtual const std::set< std::string > & getRequestedItems() override
Return a set containing the names of items requested by the object.
void addVectorPostprocessorDependencyHelper(const VectorPostprocessorName &name) const override final
Helper for deriving classes to override to add dependencies when a VectorPostprocessor is requested.
void addUserObjectDependencyHelper(const UserObjectBase &uo) const override final
Helper for deriving classes to override to add dependencies when a UserObject is requested.
const THREAD_ID _tid
Thread ID.
MooseVariableFieldBase & _var
Base MooseVariable.
virtual void compute()=0
MooseMesh & _mesh
Mesh this kernel is active on.
bool isNodal() const
Nodal or elemental kernel?
std::set< std::string > _depend_vars
Depend AuxKernelTempls.
SystemBase & _aux_sys
A system that holds auxiliary variables.
An interface that restricts an object to subdomains via the 'blocks' input parameter.
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
virtual bool boundaryRestricted() const
Returns true if this object has been restricted to a boundary.
Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with t...
bool _c_nodal
True if we provide coupling to nodal values.
Interface for sorting dependent vectors of objects.
Interface for objects that need to use functions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
An interface for accessing Materials.
Interface for notifications that the mesh has changed.
Interface for objects acting when the mesh has been displaced.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
This class provides an interface for common operations on field variables of both FE and FV types wit...
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
Interface class for classes which interact with Postprocessors.
Interface for objects that need parallel consistent random numbers without patterns over the course o...
A class for creating restricted objects.
Definition Restartable.h:29
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87
Interface for objects that needs transient capabilities.
Interface for objects that need to use UserObjects.