www.mooseframework.org
AuxNodalScalarKernel.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 "AuxNodalScalarKernel.h"
11 #include "SystemBase.h"
12 
15 {
17  params.addRequiredParam<std::vector<dof_id_type>>("nodes", "Node ids");
18  return params;
19 }
20 
22  : AuxScalarKernel(parameters),
23  Coupleable(this, true),
25  _node_ids(getParam<std::vector<dof_id_type>>("nodes"))
26 {
27  // Fill in the MooseVariable dependencies
28  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
29  for (const auto & var : coupled_vars)
31 }
32 
33 void
35 {
36  _subproblem.reinitNodes(_node_ids, _tid); // compute variables at nodes
38 }
AuxNodalScalarKernel(const InputParameters &parameters)
virtual void compute() override
Evaluate the kernel.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
SubProblem & _subproblem
static InputParameters validParams()
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.
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:70
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
static InputParameters validParams()
uint8_t dof_id_type
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid)=0