www.mooseframework.org
TagMatrixAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 
14 template <>
17 {
19  params.addParam<std::string>("matrix_tag", "TagName", "Tag Name this Aux works on");
20  params.addRequiredCoupledVar("v",
21  "The coupled variable whose components are coupled to AuxVariable");
22 
23  params.addClassDescription("Couple the diag of a tag matrix, and return its nodal value");
24  return params;
25 }
26 
28  : AuxKernel(parameters),
29  _tag_id(_subproblem.getMatrixTagID(getParam<std::string>("matrix_tag"))),
30  _v(coupledMatrixTagValue("v", _tag_id))
31 {
32 }
33 
34 Real
36 {
37  return _v[_qp];
38 }
TagMatrixAux(const InputParameters &parameters)
Definition: TagMatrixAux.C:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeValue() override
Compute and return the value of the aux variable.
Definition: TagMatrixAux.C:35
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:25
registerMooseObject("MooseApp", TagMatrixAux)
const VariableValue & _v
Definition: TagMatrixAux.h:33
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:24
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:219
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 option parameter and a documentation string to the InputParameters object...
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:33
InputParameters validParams< TagMatrixAux >()
Definition: TagMatrixAux.C:16