https://mooseframework.inl.gov
ScalarTagMatrixAux.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 "ScalarTagMatrixAux.h"
11 #include "SubProblem.h"
12 
14 
17 {
19 
20  params.addParam<std::string>("matrix_tag", "TagName", "Tag Name this Aux works on");
21  params.addRequiredCoupledVar("v",
22  "The coupled variable whose components are coupled to AuxVariable");
23  params.addClassDescription("Couple a tag matrix, and return its nodal value");
24  return params;
25 }
26 
28  : TagAuxBase<AuxScalarKernel>(parameters),
29  _tag_id(_subproblem.getMatrixTagID(getParam<std::string>("matrix_tag"))),
30  _v(coupledMatrixTagScalarValue("v", _tag_id)),
31  _v_var(*getScalarVar("v", 0))
32 {
33 }
34 
35 Real
37 {
38  return _scaled ? _v[0] : _v[0] / _v_var.scalingFactor();
39 }
static InputParameters validParams()
The value of a tagged vector for a given node and a given variable is coupled to the current AuxVaria...
Definition: TagAuxBase.h:21
registerMooseObject("MooseApp", ScalarTagMatrixAux)
ScalarTagMatrixAux(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeValue() override
Compute the value of this kernel.
Base class for making kernels that work on auxiliary scalar variables.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
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...
const MooseVariableScalar & _v_var
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...
The value of a tagged matrix for a given node and a given variable is coupled to the current AuxVaria...
const VariableValue & _v
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.