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 
14 
17 {
19  params.addRequiredParam<std::vector<dof_id_type>>("nodes", "Node ids");
20  return params;
21 }
22 
24  : AuxScalarKernel(parameters),
25  Coupleable(this, true),
27  _node_ids(getParam<std::vector<dof_id_type>>("nodes"))
28 {
29  // Fill in the MooseVariable dependencies
30  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
31  for (const auto & var : coupled_vars)
33 }
34 
35 void
37 {
38  _subproblem.reinitNodes(_node_ids, _tid); // compute variables at nodes
40 }
SystemBase.h
MooseVariableDependencyInterface::addMooseVariableDependency
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
Definition: MooseVariableDependencyInterface.h:36
AuxScalarKernel::_subproblem
SubProblem & _subproblem
Definition: AuxScalarKernel.h:75
AuxScalarKernel::compute
virtual void compute()
Evaluate the kernel.
Definition: AuxScalarKernel.C:72
MooseVariableDependencyInterface
Definition: MooseVariableDependencyInterface.h:17
AuxNodalScalarKernel::validParams
static InputParameters validParams()
Definition: AuxNodalScalarKernel.C:16
AuxNodalScalarKernel::compute
virtual void compute() override
Evaluate the kernel.
Definition: AuxNodalScalarKernel.C:36
AuxScalarKernel
Base class for making kernels that work on auxiliary scalar variables.
Definition: AuxScalarKernel.h:35
AuxScalarKernel::validParams
static InputParameters validParams()
Definition: AuxScalarKernel.C:20
AuxNodalScalarKernel::AuxNodalScalarKernel
AuxNodalScalarKernel(const InputParameters &parameters)
Definition: AuxNodalScalarKernel.C:23
AuxNodalScalarKernel
Definition: AuxNodalScalarKernel.h:25
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition: InputParameters.h:53
AuxScalarKernel::_tid
THREAD_ID _tid
Definition: AuxScalarKernel.h:78
Coupleable
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:62
AuxNodalScalarKernel::_node_ids
std::vector< dof_id_type > _node_ids
List of node IDs.
Definition: AuxNodalScalarKernel.h:38
defineLegacyParams
defineLegacyParams(AuxNodalScalarKernel)
AuxNodalScalarKernel.h
std
Definition: TheWarehouse.h:80
Coupleable::getCoupledMooseVars
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:85
InputParameters::addRequiredParam
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...
Definition: InputParameters.h:1176
SubProblem::reinitNodes
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid)=0