https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MaterialVectorBodyForce.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 "Function.h"
12
14
17{
19 params.addClassDescription("Apply a body force vector to the coupled displacement component.");
20 params.addParam<FunctionName>(
21 "function", "1", "Function to scale the coupled body force vector property");
22 params.addParam<Real>(
23 "hht_alpha", 0.0, "alpha parameter required for HHT time integration scheme");
24 params.addRequiredParam<MaterialPropertyName>("body_force", "Force per unit volume vector");
25 params.addCoupledVar("displacements", "The displacements");
26 return params;
27}
28
30 : Kernel(parameters),
31 _component(libMesh::invalid_uint),
32 _body_force(getMaterialProperty<RealVectorValue>("body_force")),
33 _function(getFunction("function")),
34 _alpha(getParam<Real>("hht_alpha"))
35{
36 for (unsigned int i = 0; i < coupledComponents("displacements"); ++i)
37 if (_var.number() == getVar("displacements", i)->number())
38 _component = i;
39
41 this->paramError("variable",
42 "The kernel variable needs to be one of the 'displacements' variables");
43}
44
45Real
registerMooseObject("SolidMechanicsApp", MaterialVectorBodyForce)
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
unsigned int coupledComponents(const std::string &var_name) const
virtual Real value(Real t, const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
const MooseArray< Point > & _q_point
unsigned int _i
MooseVariable & _var
const VariableTestValue & _test
static InputParameters validParams()
MaterialVectorBodyForce applies a body force (force/volume) given as a vector material property.
unsigned int _component
coordinate axis this Kernel acts on
MaterialVectorBodyForce(const InputParameters &parameters)
const MaterialProperty< RealVectorValue > & _body_force
coupled body force vector property
const Function & _function
optional scaling function
static InputParameters validParams()
void paramError(const std::string &param, Args... args) const
unsigned int number() const
Real & _dt
Real & _t
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const unsigned int invalid_uint