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 : #include "ShaftConnectable.h" 11 : #include "Component.h" 12 : 13 : InputParameters 14 932 : ShaftConnectable::validParams() 15 : { 16 932 : InputParameters params = emptyInputParameters(); 17 932 : return params; 18 : } 19 : 20 466 : ShaftConnectable::ShaftConnectable(const Component * const component) 21 932 : : _moment_of_inertia_var_name(component->genName(component->name(), "moment_of_inertia")), 22 932 : _torque_var_name(component->genName(component->name(), "torque")), 23 932 : _user_object_name(component->genName(component->name(), "shaftconnected_uo")), 24 466 : _connected_to_shaft(false) 25 : { 26 466 : } 27 : 28 : void 29 451 : ShaftConnectable::checkShaftConnection(const Component * const component) const 30 : { 31 451 : if (!_connected_to_shaft) 32 14 : component->logError("This component must be connected to a shaft."); 33 451 : } 34 : 35 : VariableName 36 0 : ShaftConnectable::getMomentofInertiaVariableName() const 37 : { 38 0 : return _moment_of_inertia_var_name; 39 : } 40 : 41 : VariableName 42 0 : ShaftConnectable::getTorqueVariableName() const 43 : { 44 0 : return _torque_var_name; 45 : } 46 : 47 : UserObjectName 48 512 : ShaftConnectable::getShaftConnectedUserObjectName() const 49 : { 50 512 : return _user_object_name; 51 : } 52 : 53 : void 54 452 : ShaftConnectable::setShaftName(const std::string & name) const 55 : { 56 452 : _shaft_name = name; 57 452 : _connected_to_shaft = true; 58 452 : }