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 
13 template <>
16 {
18  params.addRequiredParam<std::vector<dof_id_type>>("nodes", "Node ids");
19  return params;
20 }
21 
23  : AuxScalarKernel(parameters),
24  Coupleable(this, true),
26  _node_ids(getParam<std::vector<dof_id_type>>("nodes"))
27 {
28  // Fill in the MooseVariable dependencies
29  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
30  for (const auto & var : coupled_vars)
32 }
33 
34 void
36 {
37  _subproblem.reinitNodes(_node_ids, _tid); // compute variables at nodes
39 }
AuxNodalScalarKernel(const InputParameters &parameters)
InputParameters validParams< AuxNodalScalarKernel >()
virtual void compute() override
Evaluate the kernel.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
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:62
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:90
InputParameters validParams< AuxScalarKernel >()