https://mooseframework.inl.gov
TagMatrixAux.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 "TagMatrixAux.h"
11 #include "libmesh/utility.h"
12 
14 
17 {
19  params.addParam<TagName>("matrix_tag", "TagName", "Tag Name this Aux works on");
20  params.addClassDescription("Couple the diagonal of a tag matrix, and return its nodal value");
21  return params;
22 }
23 
25  : TagAuxBase<AuxKernel>(parameters),
26  _v(coupledMatrixTagValue("v", "matrix_tag")),
27  _v_var(*getVarHelper<MooseVariableField<Real>>("v", 0))
28 {
30 }
31 
32 Real
34 {
35  return _scaled ? _v[_qp] : _v[_qp] / _v_var.scalingFactor();
36 }
TagMatrixAux(const InputParameters &parameters)
Definition: TagMatrixAux.C:24
Class for stuff related to variables.
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...
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:68
virtual Real computeValue() override
Compute and return the value of the aux variable.
Definition: TagMatrixAux.C:33
registerMooseObject("MooseApp", TagMatrixAux)
const VariableValue & _v
Definition: TagMatrixAux.h:29
For visualization or other purposes, the diagnal of the matrix of a tag is extracted, and nodal values are assigned by using the matrix diagnal values.
Definition: TagMatrixAux.h:19
MooseVariableField< Real > & _var
This is a regular kernel so we cast to a regular MooseVariable.
Definition: AuxKernel.h:174
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: TagAuxBase.h:45
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:230
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...
static InputParameters validParams()
Definition: TagMatrixAux.C:16
const MooseVariableBase & _v_var
Definition: TagMatrixAux.h:30
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.