www.mooseframework.org
AuxNodalScalarKernel.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "AuxNodalScalarKernel.h"
16 #include "SystemBase.h"
17 
18 template <>
21 {
23  params.addRequiredParam<std::vector<dof_id_type>>("nodes", "Node ids");
24  return params;
25 }
26 
28  : AuxScalarKernel(parameters),
29  Coupleable(this, true),
31  _node_ids(getParam<std::vector<dof_id_type>>("nodes"))
32 {
33  // Fill in the MooseVariable dependencies
34  const std::vector<MooseVariable *> & coupled_vars = getCoupledMooseVars();
35  for (const auto & var : coupled_vars)
37 }
38 
39 void
41 {
42  _subproblem.reinitNodes(_node_ids, _tid); // compute variables at nodes
44 }
AuxNodalScalarKernel(const InputParameters &parameters)
InputParameters validParams< AuxNodalScalarKernel >()
const std::vector< MooseVariable * > & getCoupledMooseVars() const
Get the list of coupled variables.
Definition: Coupleable.h:63
virtual void compute() override
Evaluate the kernel.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addMooseVariableDependency(MooseVariable *var)
Call this function to add the passed in MooseVariable as a variable that this object depends on...
SubProblem & _subproblem
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
virtual void compute()
Evaluate the kernel.
Base class for making kernels that work on auxiliary scalar variables.
std::vector< dof_id_type > _node_ids
List of node IDs.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid)=0
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:35
InputParameters validParams< AuxScalarKernel >()