https://mooseframework.inl.gov
TagAuxBase.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 "InputParameters.h"
13 #include "MooseVariableBase.h"
14 #include "MooseVariableFieldBase.h"
15 
20 template <class T>
21 class TagAuxBase : public T
22 {
23 public:
25 
26  TagAuxBase(const InputParameters & parameters);
27 
28 protected:
29  const bool _scaled;
36  void checkCoupledVariable(const MooseVariableBase * input_var,
37  const MooseVariableFieldBase * aux_var);
38 
39  using T::_var;
40  using T::paramError;
41 };
42 
43 template <class T>
46 {
48 
49  params.addRequiredCoupledVar("v",
50  "The coupled variable whose components are coupled to AuxVariable");
51  params.set<ExecFlagEnum>("execute_on", true) = {EXEC_TIMESTEP_END};
52  params.suppressParameter<ExecFlagEnum>("execute_on");
53  params.addDeprecatedParam<bool>(
54  "scaled",
55  true,
56  "Return value depending on the variable scaling/autoscaling. Set this to "
57  "false to obtain unscaled physical reaction forces.",
58  "This parameter has been deprecated.");
59  return params;
60 }
61 
62 template <class T>
64  : T(parameters), _scaled(this->template getParam<bool>("scaled"))
65 {
66 }
67 
68 template <class T>
69 void
71  const MooseVariableFieldBase * aux_var)
72 {
73  if (input_var->feType() != aux_var->feType())
74  paramError("variable",
75  "The AuxVariable this AuxKernel is acting on has to have the same order and family "
76  "as the variable 'v'");
77  if (input_var->count() != aux_var->count())
78  paramError("variable",
79  "The AuxVariable this AuxKernel is acting on has to have the same number of "
80  "components as the variable 'v'");
81 }
const libMesh::FEType & feType() const
Get the type of finite element object.
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
The value of a tagged vector for a given node and a given variable is coupled to the current AuxVaria...
Definition: TagAuxBase.h:21
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class provides an interface for common operations on field variables of both FE and FV types wit...
const ExecFlagType EXEC_TIMESTEP_END
Definition: Moose.C:36
InputParameters validParams()
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn&#39;t required or valid in the derived class...
void checkCoupledVariable(const MooseVariableBase *input_var, const MooseVariableFieldBase *aux_var)
check the aux variable acting on this auxkernl has the consistent properties with the input coupled v...
Definition: TagAuxBase.h:70
TagAuxBase(const InputParameters &parameters)
Definition: TagAuxBase.h:63
const bool _scaled
Definition: TagAuxBase.h:29
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
static InputParameters validParams()
Definition: TagAuxBase.h:45
Base variable class.