https://mooseframework.inl.gov
ShaftConnectable.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 
10 #include "ShaftConnectable.h"
11 #include "Component.h"
12 
15 {
17  return params;
18 }
19 
21  : _moment_of_inertia_var_name(component->genName(component->name(), "moment_of_inertia")),
22  _torque_var_name(component->genName(component->name(), "torque")),
23  _user_object_name(component->genName(component->name(), "shaftconnected_uo")),
24  _connected_to_shaft(false)
25 {
26 }
27 
28 void
30 {
32  component->logError("This component must be connected to a shaft.");
33 }
34 
35 VariableName
37 {
39 }
40 
41 VariableName
43 {
44  return _torque_var_name;
45 }
46 
47 UserObjectName
49 {
50  return _user_object_name;
51 }
52 
53 void
54 ShaftConnectable::setShaftName(const std::string & name) const
55 {
56  _shaft_name = name;
57  _connected_to_shaft = true;
58 }
UserObjectName _user_object_name
Shaft-connectable user object name.
ShaftConnectable(const Component *const component)
bool _connected_to_shaft
Flag indicating that a shaft has this component connected.
std::string _shaft_name
Name of the shaft component.
static const std::string component
Definition: NS.h:153
static InputParameters validParams()
virtual void checkShaftConnection(const Component *const component) const
InputParameters emptyInputParameters()
virtual VariableName getMomentofInertiaVariableName() const
const std::string name
Definition: Setup.h:20
Base class for THM components.
Definition: Component.h:27
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.
virtual VariableName getTorqueVariableName() const
virtual UserObjectName getShaftConnectedUserObjectName() const
VariableName _torque_var_name
Torque of variable name.
virtual void setShaftName(const std::string &name) const