https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ShaftComponentTorqueScalarKernel.C
Go to the documentation of this file.
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
11#include "MooseVariableScalar.h"
12#include "Assembly.h"
13#include "UserObject.h"
15
17
20{
22 params.addRequiredParam<UserObjectName>("shaft_connected_component_uo",
23 "Shaft connected component user object name");
24 params.addClassDescription("Torque contributed by a component connected to a shaft");
25 return params;
26}
27
29 const InputParameters & parameters)
30 : ScalarKernel(parameters),
31 _shaft_connected_component_uo(
32 getUserObject<ShaftConnectableUserObjectInterface>("shaft_connected_component_uo"))
33{
34}
35
36void
40
41void
50
51void
53{
54 DenseMatrix<Real> jacobian_block;
55 std::vector<dof_id_type> dofs_j;
57 jacobian_block.scale(-1);
58 addJacobian(_assembly, jacobian_block, _var.dofIndices(), dofs_j, _var.scalingFactor());
59}
registerMooseObject("ThermalHydraulicsApp", ShaftComponentTorqueScalarKernel)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual const std::vector< dof_id_type > & dofIndices() const
void scalingFactor(const std::vector< Real > &factor)
unsigned int number() const
Assembly & _assembly
MooseVariableScalar & _var
static InputParameters validParams()
Torque contributed by a component connected to a shaft.
const ShaftConnectableUserObjectInterface & _shaft_connected_component_uo
Shaft connected component user object.
ShaftComponentTorqueScalarKernel(const InputParameters &parameters)
Interface class for user objects that are connected to a shaft.
virtual void getTorqueJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void accumulateTaggedLocalResidual()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
DenseVector< Number > _local_re