https://mooseframework.inl.gov
ScalarTagVectorAux.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 
10 #include "ScalarTagVectorAux.h"
11 #include "SubProblem.h"
12 
14 
17 {
19  params.addParam<std::string>("vector_tag", "TagName", "Tag Name this Aux works on");
20  params.addClassDescription("Couple a tag vector, and return its value");
21  return params;
22 }
23 
25  : TagAuxBase<AuxScalarKernel>(parameters),
26  _tag_id(_subproblem.getVectorTagID(getParam<std::string>("vector_tag"))),
27  _v(coupledVectorTagScalarValue("v", _tag_id)),
28  _v_var(*getScalarVar("v", 0))
29 {
30 }
31 
32 Real
34 {
35  return _scaled ? _v[0] : _v[0] / _v_var.scalingFactor();
36 }
ScalarTagVectorAux(const InputParameters &parameters)
static InputParameters validParams()
registerMooseObject("MooseApp", ScalarTagVectorAux)
The value of a tagged vector for a given node and a given variable is coupled to the current AuxVaria...
Definition: TagAuxBase.h:21
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const VariableValue & _v
The value of a tagged vector for a given node and a given variable is coupled to the current AuxVaria...
const MooseVariableScalar & _v_var
Base class for making kernels that work on auxiliary scalar variables.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: TagAuxBase.h:45
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
virtual Real computeValue() override
Compute the value of this kernel.