www.mooseframework.org
NodalScalarKernel.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 "NodalScalarKernel.h"
16 
17 // MOOSE includes
18 #include "Assembly.h"
19 #include "MooseVariableScalar.h"
20 #include "SystemBase.h"
21 
22 template <>
25 {
27  params.addRequiredParam<std::vector<dof_id_type>>("nodes", "Node ids");
28  return params;
29 }
30 
32  : ScalarKernel(parameters),
33  Coupleable(this, true),
35  _node_ids(getParam<std::vector<dof_id_type>>("nodes"))
36 {
37  // Fill in the MooseVariable dependencies
38  const std::vector<MooseVariable *> & coupled_vars = getCoupledMooseVars();
39  for (const auto & var : coupled_vars)
41 }
42 
43 void
45 {
46  _subproblem.reinitNodes(_node_ids, _tid); // compute variables at nodes
48 }
49 
50 void
52 {
53  if (jvar == _var.number())
55 }
InputParameters validParams< ScalarKernel >()
Definition: ScalarKernel.C:25
NodalScalarKernel(const InputParameters &parameters)
const std::vector< MooseVariable * > & getCoupledMooseVars() const
Get the list of coupled variables.
Definition: Coupleable.h:63
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...
Assembly & _assembly
Definition: ScalarKernel.h:79
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...
InputParameters validParams< NodalScalarKernel >()
void prepareOffDiagScalar()
Definition: Assembly.C:1201
MooseVariableScalar & _var
Scalar variable.
Definition: ScalarKernel.h:81
THREAD_ID _tid
Definition: ScalarKernel.h:77
virtual void computeOffDiagJacobian(unsigned int jvar) override
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid)=0
virtual void computeJacobian()=0
virtual void reinit() override
SubProblem & _subproblem
Definition: ScalarKernel.h:74
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:35
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > _node_ids
List of node IDs.