Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
PresetVelocity.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 "PresetVelocity.h"
11 #include "Function.h"
12 
13 registerMooseObject("SolidMechanicsApp", PresetVelocity);
14 
17 {
19  params.addClassDescription(
20  "Sets the boundary displacements through time from an imposed velocity");
21 
22  params.addParam<Real>(
23  "velocity", 1, "Value of the velocity. Used as scale factor if function is given.");
24  params.addParam<FunctionName>("function", "1", "Function describing the velocity.");
25 
26  // Forcefully preset the BC
27  params.set<bool>("preset") = true;
28  params.suppressParameter<bool>("preset");
29 
30  return params;
31 }
32 
34  : DirichletBCBase(parameters),
35  _u_old(valueOld()),
36  _velocity(parameters.get<Real>("velocity")),
37  _function(getFunction("function"))
38 {
39 }
40 
41 Real
43 {
46  Real vel = _velocity * 0.5 * (v1 + v2);
47 
48  return _u_old[_qp] + _dt * vel;
49 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Function & _function
const Node *const & _current_node
T & set(const std::string &name, bool quiet_mode=false)
registerMooseObject("SolidMechanicsApp", PresetVelocity)
virtual Real computeQpValue()
const unsigned int _qp
void suppressParameter(const std::string &name)
static InputParameters validParams()
const VariableValue & _u_old
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
PresetVelocity(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
const Real _velocity
virtual Real value(Real t, const Point &p) const
const Elem & get(const ElemType type_in)