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 "GravityInterface.h" 11 : #include "MooseUtils.h" 12 : #include "Numerics.h" 13 : 14 : InputParameters 15 8380 : GravityInterface::validParams() 16 : { 17 8380 : InputParameters params = emptyInputParameters(); 18 16760 : params.addParam<RealVectorValue>( 19 : "gravity_vector", THM::default_gravity_vector, "Gravitational acceleration vector [m/s^2]"); 20 8380 : return params; 21 0 : } 22 : 23 4189 : GravityInterface::GravityInterface(const InputParameters & parameters) 24 4189 : : _gravity_vector(parameters.get<RealVectorValue>("gravity_vector")), 25 4189 : _gravity_magnitude(_gravity_vector.norm()), 26 4189 : _gravity_is_zero(MooseUtils::absoluteFuzzyEqual(_gravity_magnitude, 0.0)), 27 4189 : _gravity_direction(_gravity_is_zero ? RealVectorValue(0.0, 0.0, 0.0) : _gravity_vector.unit()) 28 : { 29 4189 : }