Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 : #pragma once 11 : 12 : // MOOSE 13 : #include "ResidualObject.h" 14 : #include "GeometricSearchInterface.h" 15 : #include "BlockRestrictable.h" 16 : #include "BoundaryRestrictable.h" 17 : #include "CoupleableMooseVariableDependencyIntermediateInterface.h" 18 : #include "MooseVariableInterface.h" 19 : #include "MooseFunctorArguments.h" 20 : 21 : /** 22 : * Base class for creating new types of nodal kernels 23 : */ 24 : class NodalKernelBase : public ResidualObject, 25 : public BlockRestrictable, 26 : public BoundaryRestrictable, 27 : public GeometricSearchInterface, 28 : public CoupleableMooseVariableDependencyIntermediateInterface, 29 : public MooseVariableInterface<Real> 30 : { 31 : public: 32 : /** 33 : * Class constructor. 34 : * @param parameters The InputParameters for the object 35 : */ 36 : static InputParameters validParams(); 37 : 38 : NodalKernelBase(const InputParameters & parameters); 39 : 40 : /** 41 : * Gets the variable this is active on 42 : * @return the variable 43 : */ 44 3985982 : const MooseVariable & variable() const override { return _var; } 45 : 46 3162297 : void setSubdomains(const std::set<SubdomainID> & sub_ids) { _sub_ids = &sub_ids; } 47 : 48 : protected: 49 114663 : Moose::NodeArg nodeArg() const { return Moose::NodeArg{_current_node, _sub_ids}; } 50 : 51 : /// Reference to FEProblemBase 52 : FEProblemBase & _fe_problem; 53 : 54 : /// variable this works on 55 : MooseVariable & _var; 56 : 57 : /// current node being processed 58 : const Node * const & _current_node; 59 : 60 : /// Quadrature point index 61 : unsigned int _qp; 62 : 63 : /// The set of subdomains connected to the current node 64 : const std::set<SubdomainID> * _sub_ids; 65 : };